; LLVM IR from HRI-EU/Rcs :: external (Rcs_thirdPartyMath)

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local double @Mat3d_getAxisAngleSelf(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds [3 x double], ptr %9, i64 0
  %11 = getelementptr inbounds [3 x double], ptr %10, i64 0, i64 0
  %12 = load double, ptr %11, align 8, !tbaa !9
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds [3 x double], ptr %13, i64 1
  %15 = getelementptr inbounds [3 x double], ptr %14, i64 0, i64 1
  %16 = load double, ptr %15, align 8, !tbaa !9
  %17 = fadd double %12, %16
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds [3 x double], ptr %18, i64 2
  %20 = getelementptr inbounds [3 x double], ptr %19, i64 0, i64 2
  %21 = load double, ptr %20, align 8, !tbaa !9
  %22 = fadd double %17, %21
  store double %22, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %23 = load double, ptr %5, align 8, !tbaa !9
  %24 = fsub double %23, 1.000000e+00
  %25 = fmul double 5.000000e-01, %24
  store double %25, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %26 = load double, ptr %6, align 8, !tbaa !9
  %27 = call double @Math_acos(double noundef %26)
  store double %27, ptr %7, align 8, !tbaa !9
  %28 = load double, ptr %7, align 8, !tbaa !9
  %29 = fcmp ogt double %28, 0.000000e+00
  br i1 %29, label %30, label %263

30:                                               ; preds = %2
  %31 = load double, ptr %7, align 8, !tbaa !9
  %32 = fcmp olt double %31, 0x400921FB54442D18
  br i1 %32, label %33, label %69

33:                                               ; preds = %30
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds [3 x double], ptr %34, i64 1
  %36 = getelementptr inbounds [3 x double], ptr %35, i64 0, i64 2
  %37 = load double, ptr %36, align 8, !tbaa !9
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds [3 x double], ptr %38, i64 2
  %40 = getelementptr inbounds [3 x double], ptr %39, i64 0, i64 1
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = fsub double %37, %41
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds double, ptr %43, i64 0
  store double %42, ptr %44, align 8, !tbaa !9
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds [3 x double], ptr %45, i64 2
  %47 = getelementptr inbounds [3 x double], ptr %46, i64 0, i64 0
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds [3 x double], ptr %49, i64 0
  %51 = getelementptr inbounds [3 x double], ptr %50, i64 0, i64 2
  %52 = load double, ptr %51, align 8, !tbaa !9
  %53 = fsub double %48, %52
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds double, ptr %54, i64 1
  store double %53, ptr %55, align 8, !tbaa !9
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds [3 x double], ptr %56, i64 0
  %58 = getelementptr inbounds [3 x double], ptr %57, i64 0, i64 1
  %59 = load double, ptr %58, align 8, !tbaa !9
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds [3 x double], ptr %60, i64 1
  %62 = getelementptr inbounds [3 x double], ptr %61, i64 0, i64 0
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = fsub double %59, %63
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds double, ptr %65, i64 2
  store double %64, ptr %66, align 8, !tbaa !9
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = call double @Vec3d_normalizeSelf(ptr noundef %67)
  br label %262

69:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds [3 x double], ptr %70, i64 0
  %72 = getelementptr inbounds [3 x double], ptr %71, i64 0, i64 0
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds [3 x double], ptr %74, i64 1
  %76 = getelementptr inbounds [3 x double], ptr %75, i64 0, i64 1
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = fcmp oge double %73, %77
  br i1 %78, label %79, label %170

79:                                               ; preds = %69
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds [3 x double], ptr %80, i64 0
  %82 = getelementptr inbounds [3 x double], ptr %81, i64 0, i64 0
  %83 = load double, ptr %82, align 8, !tbaa !9
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds [3 x double], ptr %84, i64 2
  %86 = getelementptr inbounds [3 x double], ptr %85, i64 0, i64 2
  %87 = load double, ptr %86, align 8, !tbaa !9
  %88 = fcmp oge double %83, %87
  br i1 %88, label %89, label %129

89:                                               ; preds = %79
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds [3 x double], ptr %90, i64 0
  %92 = getelementptr inbounds [3 x double], ptr %91, i64 0, i64 0
  %93 = load double, ptr %92, align 8, !tbaa !9
  %94 = fadd double 1.000000e+00, %93
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds [3 x double], ptr %95, i64 1
  %97 = getelementptr inbounds [3 x double], ptr %96, i64 0, i64 1
  %98 = load double, ptr %97, align 8, !tbaa !9
  %99 = fsub double %94, %98
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds [3 x double], ptr %100, i64 2
  %102 = getelementptr inbounds [3 x double], ptr %101, i64 0, i64 2
  %103 = load double, ptr %102, align 8, !tbaa !9
  %104 = fsub double %99, %103
  %105 = call double @sqrt(double noundef %104) #4
  %106 = fmul double 5.000000e-01, %105
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = getelementptr inbounds double, ptr %107, i64 0
  store double %106, ptr %108, align 8, !tbaa !9
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds double, ptr %109, i64 0
  %111 = load double, ptr %110, align 8, !tbaa !9
  %112 = fdiv double 5.000000e-01, %111
  store double %112, ptr %8, align 8, !tbaa !9
  %113 = load double, ptr %8, align 8, !tbaa !9
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds [3 x double], ptr %114, i64 1
  %116 = getelementptr inbounds [3 x double], ptr %115, i64 0, i64 0
  %117 = load double, ptr %116, align 8, !tbaa !9
  %118 = fmul double %113, %117
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds double, ptr %119, i64 1
  store double %118, ptr %120, align 8, !tbaa !9
  %121 = load double, ptr %8, align 8, !tbaa !9
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds [3 x double], ptr %122, i64 2
  %124 = getelementptr inbounds [3 x double], ptr %123, i64 0, i64 0
  %125 = load double, ptr %124, align 8, !tbaa !9
  %126 = fmul double %121, %125
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds double, ptr %127, i64 2
  store double %126, ptr %128, align 8, !tbaa !9
  br label %169

129:                                              ; preds = %79
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds [3 x double], ptr %130, i64 2
  %132 = getelementptr inbounds [3 x double], ptr %131, i64 0, i64 2
  %133 = load double, ptr %132, align 8, !tbaa !9
  %134 = fadd double 1.000000e+00, %133
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds [3 x double], ptr %135, i64 0
  %137 = getelementptr inbounds [3 x double], ptr %136, i64 0, i64 0
  %138 = load double, ptr %137, align 8, !tbaa !9
  %139 = fsub double %134, %138
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds [3 x double], ptr %140, i64 1
  %142 = getelementptr inbounds [3 x double], ptr %141, i64 0, i64 1
  %143 = load double, ptr %142, align 8, !tbaa !9
  %144 = fsub double %139, %143
  %145 = call double @sqrt(double noundef %144) #4
  %146 = fmul double 5.000000e-01, %145
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = getelementptr inbounds double, ptr %147, i64 2
  store double %146, ptr %148, align 8, !tbaa !9
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = getelementptr inbounds double, ptr %149, i64 2
  %151 = load double, ptr %150, align 8, !tbaa !9
  %152 = fdiv double 5.000000e-01, %151
  store double %152, ptr %8, align 8, !tbaa !9
  %153 = load double, ptr %8, align 8, !tbaa !9
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds [3 x double], ptr %154, i64 2
  %156 = getelementptr inbounds [3 x double], ptr %155, i64 0, i64 0
  %157 = load double, ptr %156, align 8, !tbaa !9
  %158 = fmul double %153, %157
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds double, ptr %159, i64 0
  store double %158, ptr %160, align 8, !tbaa !9
  %161 = load double, ptr %8, align 8, !tbaa !9
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = getelementptr inbounds [3 x double], ptr %162, i64 2
  %164 = getelementptr inbounds [3 x double], ptr %163, i64 0, i64 1
  %165 = load double, ptr %164, align 8, !tbaa !9
  %166 = fmul double %161, %165
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  %168 = getelementptr inbounds double, ptr %167, i64 1
  store double %166, ptr %168, align 8, !tbaa !9
  br label %169

169:                                              ; preds = %129, %89
  br label %261

170:                                              ; preds = %69
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds [3 x double], ptr %171, i64 1
  %173 = getelementptr inbounds [3 x double], ptr %172, i64 0, i64 1
  %174 = load double, ptr %173, align 8, !tbaa !9
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = getelementptr inbounds [3 x double], ptr %175, i64 2
  %177 = getelementptr inbounds [3 x double], ptr %176, i64 0, i64 2
  %178 = load double, ptr %177, align 8, !tbaa !9
  %179 = fcmp oge double %174, %178
  br i1 %179, label %180, label %220

180:                                              ; preds = %170
  %181 = load ptr, ptr %4, align 8, !tbaa !5
  %182 = getelementptr inbounds [3 x double], ptr %181, i64 1
  %183 = getelementptr inbounds [3 x double], ptr %182, i64 0, i64 1
  %184 = load double, ptr %183, align 8, !tbaa !9
  %185 = fadd double 1.000000e+00, %184
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = getelementptr inbounds [3 x double], ptr %186, i64 0
  %188 = getelementptr inbounds [3 x double], ptr %187, i64 0, i64 0
  %189 = load double, ptr %188, align 8, !tbaa !9
  %190 = fsub double %185, %189
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %192 = getelementptr inbounds [3 x double], ptr %191, i64 2
  %193 = getelementptr inbounds [3 x double], ptr %192, i64 0, i64 2
  %194 = load double, ptr %193, align 8, !tbaa !9
  %195 = fsub double %190, %194
  %196 = call double @sqrt(double noundef %195) #4
  %197 = fmul double 5.000000e-01, %196
  %198 = load ptr, ptr %3, align 8, !tbaa !5
  %199 = getelementptr inbounds double, ptr %198, i64 1
  store double %197, ptr %199, align 8, !tbaa !9
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = getelementptr inbounds double, ptr %200, i64 1
  %202 = load double, ptr %201, align 8, !tbaa !9
  %203 = fdiv double 5.000000e-01, %202
  store double %203, ptr %8, align 8, !tbaa !9
  %204 = load double, ptr %8, align 8, !tbaa !9
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = getelementptr inbounds [3 x double], ptr %205, i64 1
  %207 = getelementptr inbounds [3 x double], ptr %206, i64 0, i64 0
  %208 = load double, ptr %207, align 8, !tbaa !9
  %209 = fmul double %204, %208
  %210 = load ptr, ptr %3, align 8, !tbaa !5
  %211 = getelementptr inbounds double, ptr %210, i64 0
  store double %209, ptr %211, align 8, !tbaa !9
  %212 = load double, ptr %8, align 8, !tbaa !9
  %213 = load ptr, ptr %4, align 8, !tbaa !5
  %214 = getelementptr inbounds [3 x double], ptr %213, i64 2
  %215 = getelementptr inbounds [3 x double], ptr %214, i64 0, i64 1
  %216 = load double, ptr %215, align 8, !tbaa !9
  %217 = fmul double %212, %216
  %218 = load ptr, ptr %3, align 8, !tbaa !5
  %219 = getelementptr inbounds double, ptr %218, i64 2
  store double %217, ptr %219, align 8, !tbaa !9
  br label %260

220:                                              ; preds = %170
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = getelementptr inbounds [3 x double], ptr %221, i64 2
  %223 = getelementptr inbounds [3 x double], ptr %222, i64 0, i64 2
  %224 = load double, ptr %223, align 8, !tbaa !9
  %225 = fadd double 1.000000e+00, %224
  %226 = load ptr, ptr %4, align 8, !tbaa !5
  %227 = getelementptr inbounds [3 x double], ptr %226, i64 0
  %228 = getelementptr inbounds [3 x double], ptr %227, i64 0, i64 0
  %229 = load double, ptr %228, align 8, !tbaa !9
  %230 = fsub double %225, %229
  %231 = load ptr, ptr %4, align 8, !tbaa !5
  %232 = getelementptr inbounds [3 x double], ptr %231, i64 1
  %233 = getelementptr inbounds [3 x double], ptr %232, i64 0, i64 1
  %234 = load double, ptr %233, align 8, !tbaa !9
  %235 = fsub double %230, %234
  %236 = call double @sqrt(double noundef %235) #4
  %237 = fmul double 5.000000e-01, %236
  %238 = load ptr, ptr %3, align 8, !tbaa !5
  %239 = getelementptr inbounds double, ptr %238, i64 2
  store double %237, ptr %239, align 8, !tbaa !9
  %240 = load ptr, ptr %3, align 8, !tbaa !5
  %241 = getelementptr inbounds double, ptr %240, i64 2
  %242 = load double, ptr %241, align 8, !tbaa !9
  %243 = fdiv double 5.000000e-01, %242
  store double %243, ptr %8, align 8, !tbaa !9
  %244 = load double, ptr %8, align 8, !tbaa !9
  %245 = load ptr, ptr %4, align 8, !tbaa !5
  %246 = getelementptr inbounds [3 x double], ptr %245, i64 2
  %247 = getelementptr inbounds [3 x double], ptr %246, i64 0, i64 0
  %248 = load double, ptr %247, align 8, !tbaa !9
  %249 = fmul double %244, %248
  %250 = load ptr, ptr %3, align 8, !tbaa !5
  %251 = getelementptr inbounds double, ptr %250, i64 0
  store double %249, ptr %251, align 8, !tbaa !9
  %252 = load double, ptr %8, align 8, !tbaa !9
  %253 = load ptr, ptr %4, align 8, !tbaa !5
  %254 = getelementptr inbounds [3 x double], ptr %253, i64 2
  %255 = getelementptr inbounds [3 x double], ptr %254, i64 0, i64 1
  %256 = load double, ptr %255, align 8, !tbaa !9
  %257 = fmul double %252, %256
  %258 = load ptr, ptr %3, align 8, !tbaa !5
  %259 = getelementptr inbounds double, ptr %258, i64 1
  store double %257, ptr %259, align 8, !tbaa !9
  br label %260

260:                                              ; preds = %220, %180
  br label %261

261:                                              ; preds = %260, %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %262

262:                                              ; preds = %261, %33
  br label %270

263:                                              ; preds = %2
  %264 = load ptr, ptr %3, align 8, !tbaa !5
  %265 = getelementptr inbounds double, ptr %264, i64 0
  store double 1.000000e+00, ptr %265, align 8, !tbaa !9
  %266 = load ptr, ptr %3, align 8, !tbaa !5
  %267 = getelementptr inbounds double, ptr %266, i64 1
  store double 0.000000e+00, ptr %267, align 8, !tbaa !9
  %268 = load ptr, ptr %3, align 8, !tbaa !5
  %269 = getelementptr inbounds double, ptr %268, i64 2
  store double 0.000000e+00, ptr %269, align 8, !tbaa !9
  br label %270

270:                                              ; preds = %263, %262
  %271 = load double, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret double %271
}

declare double @Math_acos(double noundef) #3

declare double @Vec3d_normalizeSelf(ptr noundef) #3

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

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

; Function Attrs: nounwind uwtable
define dso_local double @Mat3d_getAxisAngleSelf(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 {
  %3 = load double, ptr %1, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 24
  %5 = getelementptr inbounds i8, ptr %1, i64 32
  %6 = load double, ptr %5, align 8, !tbaa !5
  %7 = fadd double %3, %6
  %8 = getelementptr inbounds i8, ptr %1, i64 48
  %9 = getelementptr inbounds i8, ptr %1, i64 64
  %10 = load double, ptr %9, align 8, !tbaa !5
  %11 = fadd double %7, %10
  %12 = fadd double %11, -1.000000e+00
  %13 = fmul double %12, 5.000000e-01
  %14 = tail call double @Math_acos(double noundef %13) #4
  %15 = fcmp ogt double %14, 0.000000e+00
  br i1 %15, label %16, label %98

16:                                               ; preds = %2
  %17 = fcmp olt double %14, 0x400921FB54442D18
  br i1 %17, label %18, label %35

18:                                               ; preds = %16
  %19 = getelementptr inbounds i8, ptr %1, i64 40
  %20 = load double, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %1, i64 56
  %22 = load double, ptr %21, align 8, !tbaa !5
  %23 = fsub double %20, %22
  store double %23, ptr %0, align 8, !tbaa !5
  %24 = load double, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %1, i64 16
  %26 = load double, ptr %25, align 8, !tbaa !5
  %27 = fsub double %24, %26
  %28 = getelementptr inbounds i8, ptr %0, i64 8
  store double %27, ptr %28, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %1, i64 8
  %30 = load double, ptr %29, align 8, !tbaa !5
  %31 = load double, ptr %4, align 8, !tbaa !5
  %32 = fsub double %30, %31
  %33 = getelementptr inbounds i8, ptr %0, i64 16
  store double %32, ptr %33, align 8, !tbaa !5
  %34 = tail call double @Vec3d_normalizeSelf(ptr noundef nonnull %0) #4
  br label %100

35:                                               ; preds = %16
  %36 = load double, ptr %1, align 8, !tbaa !5
  %37 = load double, ptr %5, align 8, !tbaa !5
  %38 = fcmp ult double %36, %37
  %39 = load double, ptr %9, align 8, !tbaa !5
  br i1 %38, label %69, label %40

40:                                               ; preds = %35
  %41 = fcmp ult double %36, %39
  br i1 %41, label %55, label %42

42:                                               ; preds = %40
  %43 = fadd double %36, 1.000000e+00
  %44 = fsub double %43, %37
  %45 = fsub double %44, %39
  %46 = tail call double @sqrt(double noundef %45) #4
  %47 = fmul double %46, 5.000000e-01
  store double %47, ptr %0, align 8, !tbaa !5
  %48 = fdiv double 5.000000e-01, %47
  %49 = load double, ptr %4, align 8, !tbaa !5
  %50 = fmul double %48, %49
  %51 = getelementptr inbounds i8, ptr %0, i64 8
  store double %50, ptr %51, align 8, !tbaa !5
  %52 = load double, ptr %8, align 8, !tbaa !5
  %53 = fmul double %48, %52
  %54 = getelementptr inbounds i8, ptr %0, i64 16
  store double %53, ptr %54, align 8, !tbaa !5
  br label %100

55:                                               ; preds = %40
  %56 = fadd double %39, 1.000000e+00
  %57 = fsub double %56, %36
  %58 = fsub double %57, %37
  %59 = tail call double @sqrt(double noundef %58) #4
  %60 = fmul double %59, 5.000000e-01
  %61 = getelementptr inbounds i8, ptr %0, i64 16
  store double %60, ptr %61, align 8, !tbaa !5
  %62 = fdiv double 5.000000e-01, %60
  %63 = load double, ptr %8, align 8, !tbaa !5
  %64 = fmul double %62, %63
  store double %64, ptr %0, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %1, i64 56
  %66 = load double, ptr %65, align 8, !tbaa !5
  %67 = fmul double %62, %66
  %68 = getelementptr inbounds i8, ptr %0, i64 8
  store double %67, ptr %68, align 8, !tbaa !5
  br label %100

69:                                               ; preds = %35
  %70 = fcmp ult double %37, %39
  %71 = getelementptr inbounds i8, ptr %1, i64 56
  br i1 %70, label %85, label %72

72:                                               ; preds = %69
  %73 = fadd double %37, 1.000000e+00
  %74 = fsub double %73, %36
  %75 = fsub double %74, %39
  %76 = tail call double @sqrt(double noundef %75) #4
  %77 = fmul double %76, 5.000000e-01
  %78 = getelementptr inbounds i8, ptr %0, i64 8
  store double %77, ptr %78, align 8, !tbaa !5
  %79 = fdiv double 5.000000e-01, %77
  %80 = load double, ptr %4, align 8, !tbaa !5
  %81 = fmul double %79, %80
  store double %81, ptr %0, align 8, !tbaa !5
  %82 = load double, ptr %71, align 8, !tbaa !5
  %83 = fmul double %79, %82
  %84 = getelementptr inbounds i8, ptr %0, i64 16
  store double %83, ptr %84, align 8, !tbaa !5
  br label %100

85:                                               ; preds = %69
  %86 = fadd double %39, 1.000000e+00
  %87 = fsub double %86, %36
  %88 = fsub double %87, %37
  %89 = tail call double @sqrt(double noundef %88) #4
  %90 = fmul double %89, 5.000000e-01
  %91 = getelementptr inbounds i8, ptr %0, i64 16
  store double %90, ptr %91, align 8, !tbaa !5
  %92 = fdiv double 5.000000e-01, %90
  %93 = load double, ptr %8, align 8, !tbaa !5
  %94 = fmul double %92, %93
  store double %94, ptr %0, align 8, !tbaa !5
  %95 = load double, ptr %71, align 8, !tbaa !5
  %96 = fmul double %92, %95
  %97 = getelementptr inbounds i8, ptr %0, i64 8
  store double %96, ptr %97, align 8, !tbaa !5
  br label %100

98:                                               ; preds = %2
  store double 1.000000e+00, ptr %0, align 8, !tbaa !5
  %99 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %99, i8 0, i64 16, i1 false)
  br label %100

100:                                              ; preds = %55, %42, %85, %72, %18, %98
  ret double %14
}

declare double @Math_acos(double noundef) local_unnamed_addr #2

declare double @Vec3d_normalizeSelf(ptr noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { 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 #1 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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/C++ TBAA"}


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