; LLVM IR from Rhoban/IKWalk :: LegIK.ll (ZN5LegIK2IK7computeENS_8Vector3DENS_7Frame3DERNS_8PositionE)

; 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.LegIK::Vector3D" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.LegIK::IK" = type { [3 x double] }
%"class.LegIK::Position" = type { [6 x double] }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN5LegIK8Vector3D6lengthEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5LegIK8Vector3D9normalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind noalias writable sret(%"class.LegIK::Vector3D") align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5LegIK8Vector3DaSERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5LegIKplERKNS_8Vector3DES2_(ptr dead_on_unwind noalias writable sret(%"class.LegIK::Vector3D") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5LegIKmiERKNS_8Vector3DES2_(ptr dead_on_unwind noalias writable sret(%"class.LegIK::Vector3D") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind noalias writable sret(%"class.LegIK::Vector3D") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: nounwind
declare double @cos(double noundef) #5

; Function Attrs: nounwind
declare double @sin(double noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN5LegIK2IK7computeENS_8Vector3DENS_7Frame3DERNS_8PositionE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(48) %3) #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"class.LegIK::Vector3D", align 8
  %11 = alloca %"class.LegIK::Vector3D", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.LegIK::Vector3D", align 8
  %15 = alloca %"class.LegIK::Vector3D", align 8
  %16 = alloca %"class.LegIK::Vector3D", align 8
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.LegIK::Vector3D", align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca %"class.LegIK::Vector3D", align 8
  %23 = alloca %"class.LegIK::Vector3D", align 8
  %24 = alloca %"class.LegIK::Vector3D", align 8
  %25 = alloca double, align 8
  %26 = alloca %"class.LegIK::Vector3D", align 8
  %27 = alloca %"class.LegIK::Vector3D", align 8
  %28 = alloca %"class.LegIK::Vector3D", align 8
  %29 = alloca %"class.LegIK::Vector3D", align 8
  %30 = alloca %"class.LegIK::Vector3D", align 8
  %31 = alloca double, align 8
  %32 = alloca %"class.LegIK::Vector3D", align 8
  %33 = alloca double, align 8
  %34 = alloca %"class.LegIK::Vector3D", align 8
  %35 = alloca double, align 8
  %36 = alloca double, align 8
  %37 = alloca %"class.LegIK::Vector3D", align 8
  %38 = alloca %"class.LegIK::Vector3D", align 8
  %39 = alloca %"class.LegIK::Vector3D", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8
  %41 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %42 = getelementptr inbounds [3 x double], ptr %41, i64 0, i64 0
  %43 = load double, ptr %42, align 8, !tbaa !9
  %44 = call noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef %43)
  br i1 %44, label %50, label %45

45:                                               ; preds = %4
  %46 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %47 = getelementptr inbounds [3 x double], ptr %46, i64 0, i64 1
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = call noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef %48)
  br i1 %49, label %50, label %51

50:                                               ; preds = %45, %4
  store i1 false, ptr %5, align 1
  br label %462

51:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #7
  call void @_ZN5LegIK8Vector3DC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %10, double noundef 1.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #7
  invoke void @_ZN5LegIK8Vector3DC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %11, double noundef 0.000000e+00, double noundef 1.000000e+00, double noundef 0.000000e+00)
          to label %52 unwind label %69

52:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #7
  invoke void @_ZN5LegIK8Vector3DC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %14, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %53 unwind label %73

53:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #7
  %54 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %55 = getelementptr inbounds [3 x double], ptr %54, i64 0, i64 2
  %56 = load double, ptr %55, align 8, !tbaa !9
  %57 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 2) #7
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %16, double noundef %56, ptr noundef nonnull align 8 dereferenceable(24) %57)
          to label %58 unwind label %77

58:                                               ; preds = %53
  invoke void @_ZN5LegIKplERKNS_8Vector3DES2_(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %59 unwind label %81

59:                                               ; preds = %58
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %60 = call noundef double @_ZN5LegIK8Vector3D6lengthEv(ptr noundef nonnull align 8 dereferenceable(24) %15)
  store double %60, ptr %17, align 8, !tbaa !9
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef 2) #7
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = fcmp oge double %62, 0.000000e+00
  br i1 %63, label %68, label %64

64:                                               ; preds = %59
  %65 = load double, ptr %17, align 8, !tbaa !9
  %66 = invoke noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef %65)
          to label %67 unwind label %86

67:                                               ; preds = %64
  br i1 %66, label %68, label %90

68:                                               ; preds = %67, %59
  store i1 false, ptr %5, align 1
  store i32 1, ptr %18, align 4
  br label %457

69:                                               ; preds = %51
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %12, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %13, align 4
  br label %461

73:                                               ; preds = %52
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %12, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %13, align 4
  br label %460

77:                                               ; preds = %53
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %12, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %13, align 4
  br label %85

81:                                               ; preds = %58
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %12, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %13, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  br label %85

85:                                               ; preds = %81, %77
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  br label %459

86:                                               ; preds = %64
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %12, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %13, align 4
  br label %458

90:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #7
  invoke void @_ZN5LegIK8Vector3DC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %91 unwind label %114

91:                                               ; preds = %90
  %92 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #7
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %92, i64 noundef 2) #7
  %94 = load double, ptr %93, align 8, !tbaa !9
  %95 = invoke noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef %94)
          to label %96 unwind label %118

96:                                               ; preds = %91
  br i1 %95, label %146, label %97

97:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store double 1.000000e+00, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef 2) #7
  %99 = load double, ptr %98, align 8, !tbaa !9
  %100 = fneg double %99
  %101 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #7
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef 2) #7
  %103 = load double, ptr %102, align 8, !tbaa !9
  %104 = fdiv double %100, %103
  store double %104, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  %105 = load double, ptr %20, align 8, !tbaa !9
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %23, double noundef %105, ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %106 unwind label %122

106:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #7
  %107 = load double, ptr %21, align 8, !tbaa !9
  %108 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #7
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %24, double noundef %107, ptr noundef nonnull align 8 dereferenceable(24) %108)
          to label %109 unwind label %126

109:                                              ; preds = %106
  invoke void @_ZN5LegIKplERKNS_8Vector3DES2_(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %110 unwind label %130

110:                                              ; preds = %109
  %111 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5LegIK8Vector3DaSERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %112 unwind label %134

112:                                              ; preds = %110
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  invoke void @_ZN5LegIK8Vector3D9normalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %113 unwind label %141

113:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %151

114:                                              ; preds = %90
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %12, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %13, align 4
  br label %456

118:                                              ; preds = %149, %146, %91
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %12, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %13, align 4
  br label %455

122:                                              ; preds = %97
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %12, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %13, align 4
  br label %140

126:                                              ; preds = %106
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %12, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %13, align 4
  br label %139

130:                                              ; preds = %109
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %12, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %13, align 4
  br label %138

134:                                              ; preds = %110
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %12, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %13, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  br label %138

138:                                              ; preds = %134, %130
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #7
  br label %139

139:                                              ; preds = %138, %126
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  br label %140

140:                                              ; preds = %139, %122
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  br label %145

141:                                              ; preds = %112
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %12, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %13, align 4
  br label %145

145:                                              ; preds = %141, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %455

146:                                              ; preds = %96
  %147 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #7
  %148 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5LegIK8Vector3DaSERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %147)
          to label %149 unwind label %118

149:                                              ; preds = %146
  invoke void @_ZN5LegIK8Vector3D9normalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %150 unwind label %118

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150, %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %152 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %10)
  store double %152, ptr %25, align 8, !tbaa !9
  %153 = load double, ptr %25, align 8, !tbaa !9
  %154 = fcmp ogt double %153, 0.000000e+00
  br i1 %154, label %179, label %155

155:                                              ; preds = %151
  %156 = load double, ptr %25, align 8, !tbaa !9
  %157 = invoke noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef %156)
          to label %158 unwind label %166

158:                                              ; preds = %155
  br i1 %157, label %159, label %162

159:                                              ; preds = %158
  %160 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %11)
  %161 = fcmp oge double %160, 0.000000e+00
  br i1 %161, label %179, label %162

162:                                              ; preds = %159, %158
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #7
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %26, double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %163 unwind label %170

163:                                              ; preds = %162
  %164 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5LegIK8Vector3DaSERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %26)
          to label %165 unwind label %174

165:                                              ; preds = %163
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #7
  br label %179

166:                                              ; preds = %155
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %12, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %13, align 4
  br label %454

170:                                              ; preds = %162
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %12, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %13, align 4
  br label %178

174:                                              ; preds = %163
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %12, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %13, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #7
  br label %178

178:                                              ; preds = %174, %170
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #7
  br label %454

179:                                              ; preds = %165, %159, %151
  %180 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef 1) #7
  %181 = load double, ptr %180, align 8, !tbaa !9
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef 0) #7
  %183 = load double, ptr %182, align 8, !tbaa !9
  %184 = call double @atan2(double noundef %181, double noundef %183) #7
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  %186 = getelementptr inbounds %"class.LegIK::Position", ptr %185, i32 0, i32 0
  %187 = getelementptr inbounds [6 x double], ptr %186, i64 0, i64 0
  store double %184, ptr %187, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #7
  %188 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %19)
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %27, double noundef %188, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %189 unwind label %234

189:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #7
  invoke void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %29, ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %190 unwind label %238

190:                                              ; preds = %189
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %28, double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(24) %29)
          to label %191 unwind label %242

191:                                              ; preds = %190
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #7
  invoke void @_ZN5LegIKmiERKNS_8Vector3DES2_(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %30, ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %27)
          to label %192 unwind label %247

192:                                              ; preds = %191
  %193 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(24) %28)
  %194 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef 2) #7
  %195 = load double, ptr %194, align 8, !tbaa !9
  %196 = fneg double %195
  %197 = call double @atan2(double noundef %193, double noundef %196) #7
  %198 = load ptr, ptr %9, align 8, !tbaa !5
  %199 = getelementptr inbounds %"class.LegIK::Position", ptr %198, i32 0, i32 0
  %200 = getelementptr inbounds [6 x double], ptr %199, i64 0, i64 1
  store double %197, ptr %200, align 8, !tbaa !9
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %201 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %202 = getelementptr inbounds [3 x double], ptr %201, i64 0, i64 0
  %203 = load double, ptr %202, align 8, !tbaa !9
  %204 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %205 = getelementptr inbounds [3 x double], ptr %204, i64 0, i64 0
  %206 = load double, ptr %205, align 8, !tbaa !9
  %207 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %208 = getelementptr inbounds [3 x double], ptr %207, i64 0, i64 1
  %209 = load double, ptr %208, align 8, !tbaa !9
  %210 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %211 = getelementptr inbounds [3 x double], ptr %210, i64 0, i64 1
  %212 = load double, ptr %211, align 8, !tbaa !9
  %213 = fmul double %209, %212
  %214 = call double @llvm.fmuladd.f64(double %203, double %206, double %213)
  %215 = load double, ptr %17, align 8, !tbaa !9
  %216 = load double, ptr %17, align 8, !tbaa !9
  %217 = fneg double %215
  %218 = call double @llvm.fmuladd.f64(double %217, double %216, double %214)
  %219 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %220 = getelementptr inbounds [3 x double], ptr %219, i64 0, i64 0
  %221 = load double, ptr %220, align 8, !tbaa !9
  %222 = fmul double 2.000000e+00, %221
  %223 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %224 = getelementptr inbounds [3 x double], ptr %223, i64 0, i64 1
  %225 = load double, ptr %224, align 8, !tbaa !9
  %226 = fmul double %222, %225
  %227 = fdiv double %218, %226
  store double %227, ptr %31, align 8, !tbaa !9
  %228 = load double, ptr %31, align 8, !tbaa !9
  %229 = fcmp olt double %228, 0xBFF000001AD7F29B
  br i1 %229, label %233, label %230

230:                                              ; preds = %192
  %231 = load double, ptr %31, align 8, !tbaa !9
  %232 = fcmp ogt double %231, 0x3FF000001AD7F29B
  br i1 %232, label %233, label %251

233:                                              ; preds = %230, %192
  store i1 false, ptr %5, align 1
  store i32 1, ptr %18, align 4
  br label %449

234:                                              ; preds = %179
  %235 = landingpad { ptr, i32 }
          cleanup
  %236 = extractvalue { ptr, i32 } %235, 0
  store ptr %236, ptr %12, align 8
  %237 = extractvalue { ptr, i32 } %235, 1
  store i32 %237, ptr %13, align 4
  br label %453

238:                                              ; preds = %189
  %239 = landingpad { ptr, i32 }
          cleanup
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %12, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %13, align 4
  br label %246

242:                                              ; preds = %190
  %243 = landingpad { ptr, i32 }
          cleanup
  %244 = extractvalue { ptr, i32 } %243, 0
  store ptr %244, ptr %12, align 8
  %245 = extractvalue { ptr, i32 } %243, 1
  store i32 %245, ptr %13, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #7
  br label %246

246:                                              ; preds = %242, %238
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #7
  br label %452

247:                                              ; preds = %191
  %248 = landingpad { ptr, i32 }
          cleanup
  %249 = extractvalue { ptr, i32 } %248, 0
  store ptr %249, ptr %12, align 8
  %250 = extractvalue { ptr, i32 } %248, 1
  store i32 %250, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #7
  br label %451

251:                                              ; preds = %230
  invoke void @_ZN5LegIK7IKTools5boundEddRd(double noundef -1.000000e+00, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %252 unwind label %332

252:                                              ; preds = %251
  %253 = load double, ptr %31, align 8, !tbaa !9
  %254 = call double @acos(double noundef %253) #7
  %255 = fsub double 0x400921FB54442D18, %254
  %256 = load ptr, ptr %9, align 8, !tbaa !5
  %257 = getelementptr inbounds %"class.LegIK::Position", ptr %256, i32 0, i32 0
  %258 = getelementptr inbounds [6 x double], ptr %257, i64 0, i64 3
  store double %255, ptr %258, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %32) #7
  %259 = load ptr, ptr %9, align 8, !tbaa !5
  %260 = getelementptr inbounds %"class.LegIK::Position", ptr %259, i32 0, i32 0
  %261 = getelementptr inbounds [6 x double], ptr %260, i64 0, i64 0
  %262 = load double, ptr %261, align 8, !tbaa !9
  %263 = call double @sin(double noundef %262) #7
  %264 = fneg double %263
  %265 = load ptr, ptr %9, align 8, !tbaa !5
  %266 = getelementptr inbounds %"class.LegIK::Position", ptr %265, i32 0, i32 0
  %267 = getelementptr inbounds [6 x double], ptr %266, i64 0, i64 1
  %268 = load double, ptr %267, align 8, !tbaa !9
  %269 = call double @sin(double noundef %268) #7
  %270 = fmul double %264, %269
  %271 = load ptr, ptr %9, align 8, !tbaa !5
  %272 = getelementptr inbounds %"class.LegIK::Position", ptr %271, i32 0, i32 0
  %273 = getelementptr inbounds [6 x double], ptr %272, i64 0, i64 0
  %274 = load double, ptr %273, align 8, !tbaa !9
  %275 = call double @cos(double noundef %274) #7
  %276 = load ptr, ptr %9, align 8, !tbaa !5
  %277 = getelementptr inbounds %"class.LegIK::Position", ptr %276, i32 0, i32 0
  %278 = getelementptr inbounds [6 x double], ptr %277, i64 0, i64 1
  %279 = load double, ptr %278, align 8, !tbaa !9
  %280 = call double @sin(double noundef %279) #7
  %281 = fmul double %275, %280
  %282 = load ptr, ptr %9, align 8, !tbaa !5
  %283 = getelementptr inbounds %"class.LegIK::Position", ptr %282, i32 0, i32 0
  %284 = getelementptr inbounds [6 x double], ptr %283, i64 0, i64 1
  %285 = load double, ptr %284, align 8, !tbaa !9
  %286 = call double @cos(double noundef %285) #7
  %287 = fneg double %286
  invoke void @_ZN5LegIK8Vector3DC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %32, double noundef %270, double noundef %281, double noundef %287)
          to label %288 unwind label %336

288:                                              ; preds = %252
  %289 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %32)
  %290 = load double, ptr %17, align 8, !tbaa !9
  %291 = fdiv double %289, %290
  store double %291, ptr %31, align 8, !tbaa !9
  invoke void @_ZN5LegIK7IKTools5boundEddRd(double noundef -1.000000e+00, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %292 unwind label %340

292:                                              ; preds = %288
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %34) #7
  invoke void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %34, ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %32)
          to label %293 unwind label %344

293:                                              ; preds = %292
  %294 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %28)
  %295 = invoke noundef i32 @_ZN5LegIK7IKTools4signEd(double noundef %294)
          to label %296 unwind label %348

296:                                              ; preds = %293
  %297 = sitofp i32 %295 to double
  %298 = load double, ptr %31, align 8, !tbaa !9
  %299 = call double @acos(double noundef %298) #7
  %300 = fmul double %297, %299
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %34) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %34) #7
  store double %300, ptr %33, align 8, !tbaa !9
  %301 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %302 = getelementptr inbounds [3 x double], ptr %301, i64 0, i64 0
  %303 = load double, ptr %302, align 8, !tbaa !9
  %304 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %305 = getelementptr inbounds [3 x double], ptr %304, i64 0, i64 0
  %306 = load double, ptr %305, align 8, !tbaa !9
  %307 = load double, ptr %17, align 8, !tbaa !9
  %308 = load double, ptr %17, align 8, !tbaa !9
  %309 = fmul double %307, %308
  %310 = call double @llvm.fmuladd.f64(double %303, double %306, double %309)
  %311 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %312 = getelementptr inbounds [3 x double], ptr %311, i64 0, i64 1
  %313 = load double, ptr %312, align 8, !tbaa !9
  %314 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %315 = getelementptr inbounds [3 x double], ptr %314, i64 0, i64 1
  %316 = load double, ptr %315, align 8, !tbaa !9
  %317 = fneg double %313
  %318 = call double @llvm.fmuladd.f64(double %317, double %316, double %310)
  %319 = getelementptr inbounds %"class.LegIK::IK", ptr %40, i32 0, i32 0
  %320 = getelementptr inbounds [3 x double], ptr %319, i64 0, i64 0
  %321 = load double, ptr %320, align 8, !tbaa !9
  %322 = fmul double 2.000000e+00, %321
  %323 = load double, ptr %17, align 8, !tbaa !9
  %324 = fmul double %322, %323
  %325 = fdiv double %318, %324
  store double %325, ptr %31, align 8, !tbaa !9
  %326 = load double, ptr %31, align 8, !tbaa !9
  %327 = fcmp olt double %326, 0xBFF000001AD7F29B
  br i1 %327, label %331, label %328

328:                                              ; preds = %296
  %329 = load double, ptr %31, align 8, !tbaa !9
  %330 = fcmp ogt double %329, 0x3FF000001AD7F29B
  br i1 %330, label %331, label %353

331:                                              ; preds = %328, %296
  store i1 false, ptr %5, align 1
  store i32 1, ptr %18, align 4
  br label %445

332:                                              ; preds = %251
  %333 = landingpad { ptr, i32 }
          cleanup
  %334 = extractvalue { ptr, i32 } %333, 0
  store ptr %334, ptr %12, align 8
  %335 = extractvalue { ptr, i32 } %333, 1
  store i32 %335, ptr %13, align 4
  br label %450

336:                                              ; preds = %252
  %337 = landingpad { ptr, i32 }
          cleanup
  %338 = extractvalue { ptr, i32 } %337, 0
  store ptr %338, ptr %12, align 8
  %339 = extractvalue { ptr, i32 } %337, 1
  store i32 %339, ptr %13, align 4
  br label %448

340:                                              ; preds = %288
  %341 = landingpad { ptr, i32 }
          cleanup
  %342 = extractvalue { ptr, i32 } %341, 0
  store ptr %342, ptr %12, align 8
  %343 = extractvalue { ptr, i32 } %341, 1
  store i32 %343, ptr %13, align 4
  br label %447

344:                                              ; preds = %292
  %345 = landingpad { ptr, i32 }
          cleanup
  %346 = extractvalue { ptr, i32 } %345, 0
  store ptr %346, ptr %12, align 8
  %347 = extractvalue { ptr, i32 } %345, 1
  store i32 %347, ptr %13, align 4
  br label %352

348:                                              ; preds = %293
  %349 = landingpad { ptr, i32 }
          cleanup
  %350 = extractvalue { ptr, i32 } %349, 0
  store ptr %350, ptr %12, align 8
  %351 = extractvalue { ptr, i32 } %349, 1
  store i32 %351, ptr %13, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %34) #7
  br label %352

352:                                              ; preds = %348, %344
  call void @llvm.lifetime.end.p0(i64 24, ptr %34) #7
  br label %446

353:                                              ; preds = %328
  invoke void @_ZN5LegIK7IKTools5boundEddRd(double noundef -1.000000e+00, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %354 unwind label %407

354:                                              ; preds = %353
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  %355 = load double, ptr %31, align 8, !tbaa !9
  %356 = call double @acos(double noundef %355) #7
  store double %356, ptr %35, align 8, !tbaa !9
  %357 = load double, ptr %33, align 8, !tbaa !9
  %358 = load double, ptr %35, align 8, !tbaa !9
  %359 = fadd double %357, %358
  %360 = load ptr, ptr %9, align 8, !tbaa !5
  %361 = getelementptr inbounds %"class.LegIK::Position", ptr %360, i32 0, i32 0
  %362 = getelementptr inbounds [6 x double], ptr %361, i64 0, i64 2
  store double %359, ptr %362, align 8, !tbaa !9
  %363 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #7
  %364 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %363)
  store double %364, ptr %31, align 8, !tbaa !9
  invoke void @_ZN5LegIK7IKTools5boundEddRd(double noundef -1.000000e+00, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %365 unwind label %411

365:                                              ; preds = %354
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %37) #7
  %366 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #7
  invoke void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %37, ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %366)
          to label %367 unwind label %415

367:                                              ; preds = %365
  %368 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 8 dereferenceable(24) %28)
  %369 = invoke noundef i32 @_ZN5LegIK7IKTools4signEd(double noundef %368)
          to label %370 unwind label %419

370:                                              ; preds = %367
  %371 = sub nsw i32 0, %369
  %372 = sitofp i32 %371 to double
  %373 = load double, ptr %31, align 8, !tbaa !9
  %374 = call double @acos(double noundef %373) #7
  %375 = fmul double %372, %374
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %37) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #7
  store double %375, ptr %36, align 8, !tbaa !9
  %376 = load double, ptr %36, align 8, !tbaa !9
  %377 = load ptr, ptr %9, align 8, !tbaa !5
  %378 = getelementptr inbounds %"class.LegIK::Position", ptr %377, i32 0, i32 0
  %379 = getelementptr inbounds [6 x double], ptr %378, i64 0, i64 3
  %380 = load double, ptr %379, align 8, !tbaa !9
  %381 = fadd double %376, %380
  %382 = load ptr, ptr %9, align 8, !tbaa !5
  %383 = getelementptr inbounds %"class.LegIK::Position", ptr %382, i32 0, i32 0
  %384 = getelementptr inbounds [6 x double], ptr %383, i64 0, i64 2
  %385 = load double, ptr %384, align 8, !tbaa !9
  %386 = fsub double %381, %385
  %387 = load ptr, ptr %9, align 8, !tbaa !5
  %388 = getelementptr inbounds %"class.LegIK::Position", ptr %387, i32 0, i32 0
  %389 = getelementptr inbounds [6 x double], ptr %388, i64 0, i64 4
  store double %386, ptr %389, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %38) #7
  invoke void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %38, ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %32)
          to label %390 unwind label %424

390:                                              ; preds = %370
  %391 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 1) #7
  %392 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef nonnull align 8 dereferenceable(24) %391)
  store double %392, ptr %31, align 8, !tbaa !9
  invoke void @_ZN5LegIK7IKTools5boundEddRd(double noundef -1.000000e+00, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %393 unwind label %428

393:                                              ; preds = %390
  call void @llvm.lifetime.start.p0(i64 24, ptr %39) #7
  %394 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 1) #7
  invoke void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind writable sret(%"class.LegIK::Vector3D") align 8 %39, ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef nonnull align 8 dereferenceable(24) %394)
          to label %395 unwind label %432

395:                                              ; preds = %393
  %396 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #7
  %397 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 8 dereferenceable(24) %396)
  %398 = invoke noundef i32 @_ZN5LegIK7IKTools4signEd(double noundef %397)
          to label %399 unwind label %436

399:                                              ; preds = %395
  %400 = sitofp i32 %398 to double
  %401 = load double, ptr %31, align 8, !tbaa !9
  %402 = call double @acos(double noundef %401) #7
  %403 = fmul double %400, %402
  %404 = load ptr, ptr %9, align 8, !tbaa !5
  %405 = getelementptr inbounds %"class.LegIK::Position", ptr %404, i32 0, i32 0
  %406 = getelementptr inbounds [6 x double], ptr %405, i64 0, i64 5
  store double %403, ptr %406, align 8, !tbaa !9
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %39) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %39) #7
  store i1 true, ptr %5, align 1
  store i32 1, ptr %18, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %38) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  br label %445

407:                                              ; preds = %353
  %408 = landingpad { ptr, i32 }
          cleanup
  %409 = extractvalue { ptr, i32 } %408, 0
  store ptr %409, ptr %12, align 8
  %410 = extractvalue { ptr, i32 } %408, 1
  store i32 %410, ptr %13, align 4
  br label %446

411:                                              ; preds = %354
  %412 = landingpad { ptr, i32 }
          cleanup
  %413 = extractvalue { ptr, i32 } %412, 0
  store ptr %413, ptr %12, align 8
  %414 = extractvalue { ptr, i32 } %412, 1
  store i32 %414, ptr %13, align 4
  br label %444

415:                                              ; preds = %365
  %416 = landingpad { ptr, i32 }
          cleanup
  %417 = extractvalue { ptr, i32 } %416, 0
  store ptr %417, ptr %12, align 8
  %418 = extractvalue { ptr, i32 } %416, 1
  store i32 %418, ptr %13, align 4
  br label %423

419:                                              ; preds = %367
  %420 = landingpad { ptr, i32 }
          cleanup
  %421 = extractvalue { ptr, i32 } %420, 0
  store ptr %421, ptr %12, align 8
  %422 = extractvalue { ptr, i32 } %420, 1
  store i32 %422, ptr %13, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %37) #7
  br label %423

423:                                              ; preds = %419, %415
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #7
  br label %443

424:                                              ; preds = %370
  %425 = landingpad { ptr, i32 }
          cleanup
  %426 = extractvalue { ptr, i32 } %425, 0
  store ptr %426, ptr %12, align 8
  %427 = extractvalue { ptr, i32 } %425, 1
  store i32 %427, ptr %13, align 4
  br label %442

428:                                              ; preds = %390
  %429 = landingpad { ptr, i32 }
          cleanup
  %430 = extractvalue { ptr, i32 } %429, 0
  store ptr %430, ptr %12, align 8
  %431 = extractvalue { ptr, i32 } %429, 1
  store i32 %431, ptr %13, align 4
  br label %441

432:                                              ; preds = %393
  %433 = landingpad { ptr, i32 }
          cleanup
  %434 = extractvalue { ptr, i32 } %433, 0
  store ptr %434, ptr %12, align 8
  %435 = extractvalue { ptr, i32 } %433, 1
  store i32 %435, ptr %13, align 4
  br label %440

436:                                              ; preds = %395
  %437 = landingpad { ptr, i32 }
          cleanup
  %438 = extractvalue { ptr, i32 } %437, 0
  store ptr %438, ptr %12, align 8
  %439 = extractvalue { ptr, i32 } %437, 1
  store i32 %439, ptr %13, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %39) #7
  br label %440

440:                                              ; preds = %436, %432
  call void @llvm.lifetime.end.p0(i64 24, ptr %39) #7
  br label %441

441:                                              ; preds = %440, %428
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %38) #7
  br label %442

442:                                              ; preds = %441, %424
  call void @llvm.lifetime.end.p0(i64 24, ptr %38) #7
  br label %443

443:                                              ; preds = %442, %423
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #7
  br label %444

444:                                              ; preds = %443, %411
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  br label %446

445:                                              ; preds = %399, %331
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %32) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %32) #7
  br label %449

446:                                              ; preds = %444, %407, %352
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  br label %447

447:                                              ; preds = %446, %340
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %32) #7
  br label %448

448:                                              ; preds = %447, %336
  call void @llvm.lifetime.end.p0(i64 24, ptr %32) #7
  br label %450

449:                                              ; preds = %445, %233
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  br label %457

450:                                              ; preds = %448, %332
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  br label %451

451:                                              ; preds = %450, %247
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #7
  br label %452

452:                                              ; preds = %451, %246
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  br label %453

453:                                              ; preds = %452, %234
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #7
  br label %454

454:                                              ; preds = %453, %178, %166
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %455

455:                                              ; preds = %454, %145, %118
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  br label %456

456:                                              ; preds = %455, %114
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  br label %458

457:                                              ; preds = %449, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #7
  br label %462

458:                                              ; preds = %456, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  br label %459

459:                                              ; preds = %458, %85
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  br label %460

460:                                              ; preds = %459, %73
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  br label %461

461:                                              ; preds = %460, %69
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #7
  br label %464

462:                                              ; preds = %457, %50
  %463 = load i1, ptr %5, align 1
  ret i1 %463

464:                                              ; preds = %461
  %465 = load ptr, ptr %12, align 8
  %466 = load i32, ptr %13, align 4
  %467 = insertvalue { ptr, i32 } poison, ptr %465, 0
  %468 = insertvalue { ptr, i32 } %467, i32 %466, 1
  resume { ptr, i32 } %468
}

; Function Attrs: nounwind
declare double @atan2(double noundef, double noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5LegIK7IKTools5boundEddRd(double noundef, double noundef, ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: nounwind
declare double @acos(double noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5LegIK7IKTools4signEd(double noundef) #6

declare void @_ZN5LegIK8Vector3DC1Ev(ptr)

declare void @_ZN5LegIK8Vector3DC1Eddd(ptr, double, double, double)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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 #7 = { 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 = !{!"double", !7, i64 0}


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

%"class.LegIK::Vector3D" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN5LegIK8Vector3D6lengthEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5LegIK8Vector3D9normalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind noalias writable sret(%"class.LegIK::Vector3D") align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5LegIK8Vector3DaSERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5LegIKplERKNS_8Vector3DES2_(ptr dead_on_unwind noalias writable sret(%"class.LegIK::Vector3D") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5LegIKmiERKNS_8Vector3DES2_(ptr dead_on_unwind noalias writable sret(%"class.LegIK::Vector3D") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind noalias writable sret(%"class.LegIK::Vector3D") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN5LegIK2IK7computeENS_8Vector3DENS_7Frame3DERNS_8PositionE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef nonnull align 8 dereferenceable(48) %3) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.LegIK::Vector3D", align 8
  %6 = alloca %"class.LegIK::Vector3D", align 8
  %7 = alloca %"class.LegIK::Vector3D", align 8
  %8 = alloca %"class.LegIK::Vector3D", align 8
  %9 = alloca %"class.LegIK::Vector3D", align 8
  %10 = alloca %"class.LegIK::Vector3D", align 8
  %11 = alloca %"class.LegIK::Vector3D", align 8
  %12 = alloca %"class.LegIK::Vector3D", align 8
  %13 = alloca %"class.LegIK::Vector3D", align 8
  %14 = alloca %"class.LegIK::Vector3D", align 8
  %15 = alloca %"class.LegIK::Vector3D", align 8
  %16 = alloca %"class.LegIK::Vector3D", align 8
  %17 = alloca %"class.LegIK::Vector3D", align 8
  %18 = alloca %"class.LegIK::Vector3D", align 8
  %19 = alloca double, align 8
  %20 = alloca %"class.LegIK::Vector3D", align 8
  %21 = alloca %"class.LegIK::Vector3D", align 8
  %22 = alloca %"class.LegIK::Vector3D", align 8
  %23 = alloca %"class.LegIK::Vector3D", align 8
  %24 = alloca %"class.LegIK::Vector3D", align 8
  %25 = load double, ptr %0, align 8, !tbaa !5
  %26 = tail call noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef %25)
  br i1 %26, label %253, label %27

27:                                               ; preds = %4
  %28 = getelementptr inbounds i8, ptr %0, i64 8
  %29 = load double, ptr %28, align 8, !tbaa !5
  %30 = tail call noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef %29)
  br i1 %30, label %253, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #8
  call void @_ZN5LegIK8Vector3DC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %5, double noundef 1.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #8
  invoke void @_ZN5LegIK8Vector3DC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %6, double noundef 0.000000e+00, double noundef 1.000000e+00, double noundef 0.000000e+00)
          to label %32 unwind label %46

32:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  invoke void @_ZN5LegIK8Vector3DC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %7, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %33 unwind label %48

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #8
  %34 = getelementptr inbounds i8, ptr %0, i64 16
  %35 = load double, ptr %34, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 2) #8
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %9, double noundef %35, ptr noundef nonnull align 8 dereferenceable(24) %36)
          to label %37 unwind label %50

37:                                               ; preds = %33
  invoke void @_ZN5LegIKplERKNS_8Vector3DES2_(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %38 unwind label %52

38:                                               ; preds = %37
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #8
  %39 = call noundef double @_ZN5LegIK8Vector3D6lengthEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 2) #8
  %41 = load double, ptr %40, align 8, !tbaa !5
  %42 = fcmp ult double %41, 0.000000e+00
  br i1 %42, label %43, label %248

43:                                               ; preds = %38
  %44 = invoke noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef %39)
          to label %45 unwind label %55

45:                                               ; preds = %43
  br i1 %44, label %248, label %57

46:                                               ; preds = %31
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %252

48:                                               ; preds = %32
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %251

50:                                               ; preds = %33
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %54

52:                                               ; preds = %37
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #8
  br label %54

54:                                               ; preds = %52, %50
  %.pn = phi { ptr, i32 } [ %53, %52 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #8
  br label %250

55:                                               ; preds = %43
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %249

57:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #8
  invoke void @_ZN5LegIK8Vector3DC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %58 unwind label %78

58:                                               ; preds = %57
  %59 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #8
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef 2) #8
  %61 = load double, ptr %60, align 8, !tbaa !5
  %62 = invoke noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef %61)
          to label %63 unwind label %80

63:                                               ; preds = %58
  br i1 %62, label %95, label %64

64:                                               ; preds = %63
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 2) #8
  %66 = load double, ptr %65, align 8, !tbaa !5
  %67 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #8
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %67, i64 noundef 2) #8
  %69 = load double, ptr %68, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #8
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %12, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %70 unwind label %82

70:                                               ; preds = %64
  %71 = fneg double %66
  %72 = fdiv double %71, %69
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #8
  %73 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #8
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %13, double noundef %72, ptr noundef nonnull align 8 dereferenceable(24) %73)
          to label %74 unwind label %84

74:                                               ; preds = %70
  invoke void @_ZN5LegIKplERKNS_8Vector3DES2_(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %11, ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %75 unwind label %86

75:                                               ; preds = %74
  %76 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5LegIK8Vector3DaSERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %77 unwind label %88

77:                                               ; preds = %75
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #8
  invoke void @_ZN5LegIK8Vector3D9normalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %99 unwind label %93

78:                                               ; preds = %57
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %247

80:                                               ; preds = %98, %95, %58
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %246

82:                                               ; preds = %64
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %92

84:                                               ; preds = %70
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %91

86:                                               ; preds = %74
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %90

88:                                               ; preds = %75
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #8
  br label %90

90:                                               ; preds = %88, %86
  %.pn60 = phi { ptr, i32 } [ %89, %88 ], [ %87, %86 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #8
  br label %91

91:                                               ; preds = %90, %84
  %.pn60.pn = phi { ptr, i32 } [ %.pn60, %90 ], [ %85, %84 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  br label %92

92:                                               ; preds = %91, %82
  %.pn60.pn.pn = phi { ptr, i32 } [ %.pn60.pn, %91 ], [ %83, %82 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #8
  br label %246

93:                                               ; preds = %77
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %246

95:                                               ; preds = %63
  %96 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #8
  %97 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5LegIK8Vector3DaSERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %96)
          to label %98 unwind label %80

98:                                               ; preds = %95
  invoke void @_ZN5LegIK8Vector3D9normalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %99 unwind label %80

99:                                               ; preds = %77, %98
  %100 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %101 = fcmp ogt double %100, 0.000000e+00
  br i1 %101, label %119, label %102

102:                                              ; preds = %99
  %103 = invoke noundef zeroext i1 @_ZN5LegIK7IKTools7is_zeroEd(double noundef %100)
          to label %104 unwind label %112

104:                                              ; preds = %102
  br i1 %103, label %105, label %108

105:                                              ; preds = %104
  %106 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %6)
  %107 = fcmp ult double %106, 0.000000e+00
  br i1 %107, label %108, label %119

108:                                              ; preds = %105, %104
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #8
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %14, double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %109 unwind label %114

109:                                              ; preds = %108
  %110 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5LegIK8Vector3DaSERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %111 unwind label %116

111:                                              ; preds = %109
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #8
  br label %119

112:                                              ; preds = %102
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %246

114:                                              ; preds = %108
  %115 = landingpad { ptr, i32 }
          cleanup
  br label %118

116:                                              ; preds = %109
  %117 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #8
  br label %118

118:                                              ; preds = %116, %114
  %.pn66 = phi { ptr, i32 } [ %117, %116 ], [ %115, %114 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #8
  br label %246

119:                                              ; preds = %111, %105, %99
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef 1) #8
  %121 = load double, ptr %120, align 8, !tbaa !5
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef 0) #8
  %123 = load double, ptr %122, align 8, !tbaa !5
  %124 = call double @atan2(double noundef %121, double noundef %123) #8
  store double %124, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #8
  %125 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %10)
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %15, double noundef %125, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %126 unwind label %146

126:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #8
  invoke void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %17, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %127 unwind label %148

127:                                              ; preds = %126
  invoke void @_ZN5LegIKmlEdRKNS_8Vector3DE(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %16, double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %128 unwind label %150

128:                                              ; preds = %127
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #8
  invoke void @_ZN5LegIKmiERKNS_8Vector3DES2_(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %129 unwind label %153

129:                                              ; preds = %128
  %130 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %16)
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 2) #8
  %132 = load double, ptr %131, align 8, !tbaa !5
  %133 = fneg double %132
  %134 = call double @atan2(double noundef %130, double noundef %133) #8
  %135 = getelementptr inbounds i8, ptr %3, i64 8
  store double %134, ptr %135, align 8, !tbaa !5
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #8
  %136 = load double, ptr %0, align 8, !tbaa !5
  %137 = load double, ptr %28, align 8, !tbaa !5
  %138 = fmul double %137, %137
  %139 = call double @llvm.fmuladd.f64(double %136, double %136, double %138)
  %140 = fneg double %39
  %141 = call double @llvm.fmuladd.f64(double %140, double %39, double %139)
  %142 = fmul double %136, 2.000000e+00
  %143 = fmul double %142, %137
  %144 = fdiv double %141, %143
  store double %144, ptr %19, align 8, !tbaa !5
  %145 = call double @llvm.fabs.f64(double %144)
  %or.cond = fcmp ogt double %145, 0x3FF000001AD7F29B
  br i1 %or.cond, label %242, label %155

146:                                              ; preds = %119
  %147 = landingpad { ptr, i32 }
          cleanup
  br label %245

148:                                              ; preds = %126
  %149 = landingpad { ptr, i32 }
          cleanup
  br label %152

150:                                              ; preds = %127
  %151 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  br label %152

152:                                              ; preds = %150, %148
  %.pn68 = phi { ptr, i32 } [ %151, %150 ], [ %149, %148 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #8
  br label %244

153:                                              ; preds = %128
  %154 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #8
  br label %243

155:                                              ; preds = %129
  call void @_ZN5LegIK7IKTools5boundEddRd(double noundef -1.000000e+00, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %156 = load double, ptr %19, align 8, !tbaa !5
  %157 = call double @acos(double noundef %156) #8
  %158 = fsub double 0x400921FB54442D18, %157
  %159 = getelementptr inbounds i8, ptr %3, i64 24
  store double %158, ptr %159, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %20) #8
  %160 = load double, ptr %3, align 8, !tbaa !5
  %161 = call double @sin(double noundef %160) #8
  %162 = fneg double %161
  %163 = load double, ptr %135, align 8, !tbaa !5
  %164 = call double @sin(double noundef %163) #8
  %165 = fmul double %164, %162
  %166 = load double, ptr %3, align 8, !tbaa !5
  %167 = call double @cos(double noundef %166) #8
  %168 = load double, ptr %135, align 8, !tbaa !5
  %169 = call double @sin(double noundef %168) #8
  %170 = fmul double %167, %169
  %171 = load double, ptr %135, align 8, !tbaa !5
  %172 = call double @cos(double noundef %171) #8
  %173 = fneg double %172
  invoke void @_ZN5LegIK8Vector3DC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %20, double noundef %165, double noundef %170, double noundef %173)
          to label %174 unwind label %192

174:                                              ; preds = %155
  %175 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %20)
  %176 = fdiv double %175, %39
  store double %176, ptr %19, align 8, !tbaa !5
  call void @_ZN5LegIK7IKTools5boundEddRd(double noundef -1.000000e+00, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(8) %19)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %21) #8
  invoke void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %21, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %177 unwind label %194

177:                                              ; preds = %174
  %178 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(24) %16)
  %179 = call noundef i32 @_ZN5LegIK7IKTools4signEd(double noundef %178)
  %180 = load double, ptr %19, align 8, !tbaa !5
  %181 = call double @acos(double noundef %180) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %21) #8
  %182 = load double, ptr %0, align 8, !tbaa !5
  %183 = fmul double %39, %39
  %184 = call double @llvm.fmuladd.f64(double %182, double %182, double %183)
  %185 = load double, ptr %28, align 8, !tbaa !5
  %186 = fneg double %185
  %187 = call double @llvm.fmuladd.f64(double %186, double %185, double %184)
  %188 = fmul double %182, 2.000000e+00
  %189 = fmul double %39, %188
  %190 = fdiv double %187, %189
  store double %190, ptr %19, align 8, !tbaa !5
  %191 = call double @llvm.fabs.f64(double %190)
  %or.cond3 = fcmp ule double %191, 0x3FF000001AD7F29B
  br i1 %or.cond3, label %196, label %239

192:                                              ; preds = %155
  %193 = landingpad { ptr, i32 }
          cleanup
  br label %241

194:                                              ; preds = %174
  %195 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %21) #8
  br label %240

196:                                              ; preds = %177
  %197 = sitofp i32 %179 to double
  %198 = fmul double %181, %197
  call void @_ZN5LegIK7IKTools5boundEddRd(double noundef -1.000000e+00, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %199 = load double, ptr %19, align 8, !tbaa !5
  %200 = call double @acos(double noundef %199) #8
  %201 = fadd double %198, %200
  %202 = getelementptr inbounds i8, ptr %3, i64 16
  store double %201, ptr %202, align 8, !tbaa !5
  %203 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #8
  %204 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %203)
  store double %204, ptr %19, align 8, !tbaa !5
  call void @_ZN5LegIK7IKTools5boundEddRd(double noundef -1.000000e+00, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(8) %19)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %22) #8
  %205 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #8
  invoke void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %205)
          to label %206 unwind label %232

206:                                              ; preds = %196
  %207 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(24) %16)
  %208 = call noundef i32 @_ZN5LegIK7IKTools4signEd(double noundef %207)
  %209 = sub nsw i32 0, %208
  %210 = sitofp i32 %209 to double
  %211 = load double, ptr %19, align 8, !tbaa !5
  %212 = call double @acos(double noundef %211) #8
  %213 = fmul double %212, %210
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %22) #8
  %214 = load double, ptr %159, align 8, !tbaa !5
  %215 = fadd double %213, %214
  %216 = load double, ptr %202, align 8, !tbaa !5
  %217 = fsub double %215, %216
  %218 = getelementptr inbounds i8, ptr %3, i64 32
  store double %217, ptr %218, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %23) #8
  invoke void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %23, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %219 unwind label %234

219:                                              ; preds = %206
  %220 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 1) #8
  %221 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %220)
  store double %221, ptr %19, align 8, !tbaa !5
  call void @_ZN5LegIK7IKTools5boundEddRd(double noundef -1.000000e+00, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(8) %19)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %24) #8
  %222 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 1) #8
  invoke void @_ZN5LegIK9vect_prodERKNS_8Vector3DES2_(ptr dead_on_unwind nonnull writable sret(%"class.LegIK::Vector3D") align 8 %24, ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %222)
          to label %223 unwind label %236

223:                                              ; preds = %219
  %224 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5LegIK8Vector3DESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #8
  %225 = call noundef double @_ZN5LegIK11scalar_prodERKNS_8Vector3DES2_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(24) %224)
  %226 = call noundef i32 @_ZN5LegIK7IKTools4signEd(double noundef %225)
  %227 = sitofp i32 %226 to double
  %228 = load double, ptr %19, align 8, !tbaa !5
  %229 = call double @acos(double noundef %228) #8
  %230 = fmul double %229, %227
  %231 = getelementptr inbounds i8, ptr %3, i64 40
  store double %230, ptr %231, align 8, !tbaa !5
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %23) #8
  br label %239

232:                                              ; preds = %196
  %233 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %22) #8
  br label %240

234:                                              ; preds = %206
  %235 = landingpad { ptr, i32 }
          cleanup
  br label %238

236:                                              ; preds = %219
  %237 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #8
  br label %238

238:                                              ; preds = %236, %234
  %.pn70 = phi { ptr, i32 } [ %237, %236 ], [ %235, %234 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %23) #8
  br label %240

239:                                              ; preds = %177, %223
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %20) #8
  br label %242

240:                                              ; preds = %232, %238, %194
  %.pn70.pn.pn = phi { ptr, i32 } [ %195, %194 ], [ %.pn70, %238 ], [ %233, %232 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #8
  br label %241

241:                                              ; preds = %240, %192
  %.pn70.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn, %240 ], [ %193, %192 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #8
  br label %243

242:                                              ; preds = %129, %239
  %.1 = phi i1 [ %or.cond3, %239 ], [ false, %129 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #8
  br label %248

243:                                              ; preds = %241, %153
  %.pn70.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn, %241 ], [ %154, %153 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #8
  br label %244

244:                                              ; preds = %243, %152
  %.pn70.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn.pn, %243 ], [ %.pn68, %152 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  br label %245

245:                                              ; preds = %244, %146
  %.pn70.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn.pn.pn, %244 ], [ %147, %146 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #8
  br label %246

246:                                              ; preds = %112, %118, %245, %92, %93, %80
  %.pn70.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %81, %80 ], [ %94, %93 ], [ %.pn60.pn.pn, %92 ], [ %.pn70.pn.pn.pn.pn.pn.pn, %245 ], [ %.pn66, %118 ], [ %113, %112 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  br label %247

247:                                              ; preds = %246, %78
  %.pn70.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn.pn.pn.pn.pn.pn, %246 ], [ %79, %78 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #8
  br label %249

248:                                              ; preds = %38, %45, %242
  %.2 = phi i1 [ %.1, %242 ], [ false, %45 ], [ false, %38 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  br label %253

249:                                              ; preds = %247, %55
  %.pn70.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn.pn.pn.pn.pn.pn.pn, %247 ], [ %56, %55 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  br label %250

250:                                              ; preds = %249, %54
  %.pn70.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %249 ], [ %.pn, %54 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  br label %251

251:                                              ; preds = %250, %48
  %.pn70.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %250 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  br label %252

252:                                              ; preds = %251, %46
  %.pn70.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %251 ], [ %47, %46 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #8
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  resume { ptr, i32 } %.pn70.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn

253:                                              ; preds = %4, %27, %248
  %.3 = phi i1 [ %.2, %248 ], [ false, %27 ], [ false, %4 ]
  ret i1 %.3
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan2(double noundef, double noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5LegIK7IKTools5boundEddRd(double noundef, double noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @acos(double noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5LegIK7IKTools4signEd(double noundef) local_unnamed_addr #6

declare void @_ZN5LegIK8Vector3DC1Ev(ptr) local_unnamed_addr

declare void @_ZN5LegIK8Vector3DC1Eddd(ptr, double, double, double) local_unnamed_addr

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(write) "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 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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