; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_Vec3d)

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

@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [68 x i8], align 1
@__func__.Vec3d_getPolarErrorFromDirection = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [45 x i8], align 1

; 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 i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

declare double @Math_acos(double noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_set(ptr noundef, double noundef, double noundef, double noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local double @Vec3d_getLength(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_getPolarAxis(ptr noundef, double noundef, double noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_copy(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_crossProduct(ptr noundef, ptr noundef, ptr noundef) #3

declare void @Mat3d_mulTranspose(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_rotate(ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @Vec3d_getPolarErrorFromDirection(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca [3 x double], align 16
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca [3 x [3 x double]], align 16
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca [3 x [3 x double]], align 16
  %16 = alloca [3 x double], align 16
  %17 = alloca double, align 8
  %18 = alloca [3 x double], align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %4
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = icmp sge i32 %20, 0
  br i1 %21, label %22, label %25

22:                                               ; preds = %19
  %23 = load i32, ptr %8, align 4, !tbaa !9
  %24 = icmp sle i32 %23, 2
  br i1 %24, label %33, label %25

25:                                               ; preds = %22, %19
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.4, ptr noundef @.str.5, ptr noundef @__func__.Vec3d_getPolarErrorFromDirection, i32 noundef 252, ptr noundef @.str.6) #5
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str.7, i32 noundef %29) #5
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.2) #5
  call void @print_trace()
  call void @exit(i32 noundef 1) #6
  unreachable

33:                                               ; preds = %22
  br label %34

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [3 x double], ptr %35, i64 %37
  %39 = getelementptr inbounds [3 x double], ptr %38, i64 0, i64 0
  store ptr %39, ptr %10, align 8, !tbaa !5
  %40 = getelementptr inbounds [3 x double], ptr %9, i64 0, i64 0
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds double, ptr %41, i64 0
  %43 = load double, ptr %42, align 8, !tbaa !11
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds double, ptr %44, i64 1
  %46 = load double, ptr %45, align 8, !tbaa !11
  call void @Vec3d_getPolarAxis(ptr noundef %40, double noundef %43, double noundef %46)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = getelementptr inbounds [3 x double], ptr %9, i64 0, i64 0
  %49 = call double @Vec3d_innerProduct(ptr noundef %47, ptr noundef %48)
  store double %49, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 72, ptr %12) #5
  %50 = getelementptr inbounds [3 x [3 x double]], ptr %12, i64 0, i64 2
  %51 = getelementptr inbounds [3 x double], ptr %50, i64 0, i64 0
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  call void @Vec3d_copy(ptr noundef %51, ptr noundef %52)
  %53 = getelementptr inbounds [3 x [3 x double]], ptr %12, i64 0, i64 1
  %54 = getelementptr inbounds [3 x double], ptr %53, i64 0, i64 0
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds [3 x double], ptr %9, i64 0, i64 0
  call void @Vec3d_crossProduct(ptr noundef %54, ptr noundef %55, ptr noundef %56)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %57 = getelementptr inbounds [3 x [3 x double]], ptr %12, i64 0, i64 1
  %58 = getelementptr inbounds [3 x double], ptr %57, i64 0, i64 0
  %59 = call double @Vec3d_getLength(ptr noundef %58)
  store double %59, ptr %13, align 8, !tbaa !11
  %60 = load double, ptr %13, align 8, !tbaa !11
  %61 = fcmp oeq double %60, 0.000000e+00
  br i1 %61, label %62, label %95

62:                                               ; preds = %34
  %63 = load double, ptr %11, align 8, !tbaa !11
  %64 = fcmp ogt double %63, 0.000000e+00
  br i1 %64, label %65, label %70

65:                                               ; preds = %62
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds double, ptr %66, i64 0
  store double 0.000000e+00, ptr %67, align 8, !tbaa !11
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds double, ptr %68, i64 1
  store double 0.000000e+00, ptr %69, align 8, !tbaa !11
  store i32 1, ptr %14, align 4
  br label %146

70:                                               ; preds = %62
  %71 = load i32, ptr %8, align 4, !tbaa !9
  switch i32 %71, label %93 [
    i32 0, label %72
    i32 1, label %79
    i32 2, label %86
  ]

72:                                               ; preds = %70
  %73 = getelementptr inbounds [3 x [3 x double]], ptr %12, i64 0, i64 1
  %74 = getelementptr inbounds [3 x double], ptr %73, i64 0, i64 0
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds [3 x double], ptr %76, i64 1
  %78 = getelementptr inbounds [3 x double], ptr %77, i64 0, i64 0
  call void @Vec3d_crossProduct(ptr noundef %74, ptr noundef %75, ptr noundef %78)
  br label %93

79:                                               ; preds = %70
  %80 = getelementptr inbounds [3 x [3 x double]], ptr %12, i64 0, i64 1
  %81 = getelementptr inbounds [3 x double], ptr %80, i64 0, i64 0
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds [3 x double], ptr %83, i64 2
  %85 = getelementptr inbounds [3 x double], ptr %84, i64 0, i64 0
  call void @Vec3d_crossProduct(ptr noundef %81, ptr noundef %82, ptr noundef %85)
  br label %93

86:                                               ; preds = %70
  %87 = getelementptr inbounds [3 x [3 x double]], ptr %12, i64 0, i64 1
  %88 = getelementptr inbounds [3 x double], ptr %87, i64 0, i64 0
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = load ptr, ptr %7, 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
  call void @Vec3d_crossProduct(ptr noundef %88, ptr noundef %89, ptr noundef %92)
  br label %93

93:                                               ; preds = %86, %79, %72, %70
  br label %94

94:                                               ; preds = %93
  br label %100

95:                                               ; preds = %34
  %96 = getelementptr inbounds [3 x [3 x double]], ptr %12, i64 0, i64 1
  %97 = getelementptr inbounds [3 x double], ptr %96, i64 0, i64 0
  %98 = load double, ptr %13, align 8, !tbaa !11
  %99 = fdiv double 1.000000e+00, %98
  call void @Vec3d_constMulSelf(ptr noundef %97, double noundef %99)
  br label %100

100:                                              ; preds = %95, %94
  %101 = getelementptr inbounds [3 x [3 x double]], ptr %12, i64 0, i64 0
  %102 = getelementptr inbounds [3 x double], ptr %101, i64 0, i64 0
  %103 = getelementptr inbounds [3 x [3 x double]], ptr %12, i64 0, i64 1
  %104 = getelementptr inbounds [3 x double], ptr %103, i64 0, i64 0
  %105 = getelementptr inbounds [3 x [3 x double]], ptr %12, i64 0, i64 2
  %106 = getelementptr inbounds [3 x double], ptr %105, i64 0, i64 0
  call void @Vec3d_crossProduct(ptr noundef %102, ptr noundef %104, ptr noundef %106)
  call void @llvm.lifetime.start.p0(i64 72, ptr %15) #5
  %107 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 0
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds [3 x [3 x double]], ptr %12, i64 0, i64 0
  call void @Mat3d_mulTranspose(ptr noundef %107, ptr noundef %108, ptr noundef %109)
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %110 = load double, ptr %11, align 8, !tbaa !11
  %111 = call double @Math_acos(double noundef %110)
  store double %111, ptr %17, align 8, !tbaa !11
  %112 = getelementptr inbounds [3 x double], ptr %16, i64 0, i64 0
  %113 = load double, ptr %17, align 8, !tbaa !11
  call void @Vec3d_set(ptr noundef %112, double noundef 0.000000e+00, double noundef %113, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #5
  %114 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  %115 = getelementptr inbounds [3 x [3 x double]], ptr %15, i64 0, i64 0
  %116 = getelementptr inbounds [3 x double], ptr %16, i64 0, i64 0
  call void @Vec3d_rotate(ptr noundef %114, ptr noundef %115, ptr noundef %116)
  %117 = load i32, ptr %8, align 4, !tbaa !9
  switch i32 %117, label %145 [
    i32 0, label %118
    i32 1, label %127
    i32 2, label %136
  ]

118:                                              ; preds = %100
  %119 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 1
  %120 = load double, ptr %119, align 8, !tbaa !11
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds double, ptr %121, i64 0
  store double %120, ptr %122, align 8, !tbaa !11
  %123 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 2
  %124 = load double, ptr %123, align 16, !tbaa !11
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds double, ptr %125, i64 1
  store double %124, ptr %126, align 8, !tbaa !11
  br label %145

127:                                              ; preds = %100
  %128 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  %129 = load double, ptr %128, align 16, !tbaa !11
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds double, ptr %130, i64 0
  store double %129, ptr %131, align 8, !tbaa !11
  %132 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 2
  %133 = load double, ptr %132, align 16, !tbaa !11
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds double, ptr %134, i64 1
  store double %133, ptr %135, align 8, !tbaa !11
  br label %145

136:                                              ; preds = %100
  %137 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  %138 = load double, ptr %137, align 16, !tbaa !11
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = getelementptr inbounds double, ptr %139, i64 0
  store double %138, ptr %140, align 8, !tbaa !11
  %141 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 1
  %142 = load double, ptr %141, align 8, !tbaa !11
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds double, ptr %143, i64 1
  store double %142, ptr %144, align 8, !tbaa !11
  br label %145

145:                                              ; preds = %136, %127, %118, %100
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %15) #5
  store i32 0, ptr %14, align 4
  br label %146

146:                                              ; preds = %145, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  %147 = load i32, ptr %14, align 4
  switch i32 %147, label %149 [
    i32 0, label %148
    i32 1, label %148
  ]

148:                                              ; preds = %146, %146
  ret void

149:                                              ; preds = %146
  unreachable
}

declare void @print_trace() #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local double @Vec3d_innerProduct(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_constMulSelf(ptr noundef, double 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [68 x i8], align 1
@__func__.Vec3d_getPolarErrorFromDirection = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [45 x i8], align 1

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

declare double @Math_acos(double noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_set(ptr noundef, double noundef, double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local double @Vec3d_getLength(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_getPolarAxis(ptr noundef, double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_copy(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_crossProduct(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @Mat3d_mulTranspose(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_rotate(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @Vec3d_getPolarErrorFromDirection(ptr nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = alloca [3 x double], align 16
  %6 = alloca [3 x [3 x double]], align 16
  %7 = alloca [3 x [3 x double]], align 16
  %8 = alloca [3 x double], align 16
  %9 = alloca [3 x double], align 16
  %or.cond = icmp ult i32 %3, 3
  br i1 %or.cond, label %17, label %10

10:                                               ; preds = %4
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, ptr noundef nonnull @__func__.Vec3d_getPolarErrorFromDirection, i32 noundef 252, ptr noundef nonnull @.str.6) #6
  %13 = load ptr, ptr @stderr, align 8, !tbaa !5
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.7, i32 noundef %3) #6
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.2) #6
  tail call void @print_trace() #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

17:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  %18 = zext nneg i32 %3 to i64
  %19 = getelementptr inbounds [3 x double], ptr %2, i64 %18
  %20 = load double, ptr %1, align 8, !tbaa !9
  %21 = getelementptr inbounds i8, ptr %1, i64 8
  %22 = load double, ptr %21, align 8, !tbaa !9
  call void @Vec3d_getPolarAxis(ptr noundef nonnull %5, double noundef %20, double noundef %22)
  %23 = call double @Vec3d_innerProduct(ptr noundef %19, ptr noundef nonnull %5)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #7
  %24 = getelementptr inbounds i8, ptr %6, i64 48
  call void @Vec3d_copy(ptr noundef nonnull %24, ptr noundef %19)
  %25 = getelementptr inbounds i8, ptr %6, i64 24
  call void @Vec3d_crossProduct(ptr noundef nonnull %25, ptr noundef %19, ptr noundef nonnull %5)
  %26 = call double @Vec3d_getLength(ptr noundef nonnull %25)
  %27 = fcmp oeq double %26, 0.000000e+00
  br i1 %27, label %28, label %37

28:                                               ; preds = %17
  %29 = fcmp ogt double %23, 0.000000e+00
  br i1 %29, label %30, label %31

30:                                               ; preds = %28
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %0, i8 0, i64 16, i1 false)
  br label %56

31:                                               ; preds = %28
  switch i32 %3, label %default.unreachable [
    i32 0, label %32
    i32 1, label %34
    i32 2, label %36
  ]

32:                                               ; preds = %31
  %33 = getelementptr inbounds i8, ptr %2, i64 24
  call void @Vec3d_crossProduct(ptr noundef nonnull %25, ptr noundef %19, ptr noundef nonnull %33)
  br label %39

34:                                               ; preds = %31
  %35 = getelementptr inbounds i8, ptr %2, i64 48
  call void @Vec3d_crossProduct(ptr noundef nonnull %25, ptr noundef %19, ptr noundef nonnull %35)
  br label %39

36:                                               ; preds = %31
  call void @Vec3d_crossProduct(ptr noundef nonnull %25, ptr noundef %19, ptr noundef %2)
  br label %39

37:                                               ; preds = %17
  %38 = fdiv double 1.000000e+00, %26
  call void @Vec3d_constMulSelf(ptr noundef nonnull %25, double noundef %38)
  br label %39

default.unreachable:                              ; preds = %39, %31
  unreachable

39:                                               ; preds = %36, %34, %32, %37
  call void @Vec3d_crossProduct(ptr noundef nonnull %6, ptr noundef nonnull %25, ptr noundef nonnull %24)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %7) #7
  call void @Mat3d_mulTranspose(ptr noundef nonnull %7, ptr noundef %2, ptr noundef nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  %40 = call double @Math_acos(double noundef %23) #7
  call void @Vec3d_set(ptr noundef nonnull %8, double noundef 0.000000e+00, double noundef %40, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  call void @Vec3d_rotate(ptr noundef nonnull %9, ptr noundef nonnull %7, ptr noundef nonnull %8)
  switch i32 %3, label %default.unreachable [
    i32 0, label %41
    i32 1, label %46
    i32 2, label %50
  ]

41:                                               ; preds = %39
  %42 = getelementptr inbounds i8, ptr %9, i64 8
  %43 = load double, ptr %42, align 8, !tbaa !9
  store double %43, ptr %0, align 8, !tbaa !9
  %44 = getelementptr inbounds i8, ptr %9, i64 16
  %45 = load double, ptr %44, align 16, !tbaa !9
  br label %54

46:                                               ; preds = %39
  %47 = load double, ptr %9, align 16, !tbaa !9
  store double %47, ptr %0, align 8, !tbaa !9
  %48 = getelementptr inbounds i8, ptr %9, i64 16
  %49 = load double, ptr %48, align 16, !tbaa !9
  br label %54

50:                                               ; preds = %39
  %51 = load double, ptr %9, align 16, !tbaa !9
  store double %51, ptr %0, align 8, !tbaa !9
  %52 = getelementptr inbounds i8, ptr %9, i64 8
  %53 = load double, ptr %52, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %50, %46, %41
  %.sink = phi double [ %53, %50 ], [ %49, %46 ], [ %45, %41 ]
  %55 = getelementptr inbounds i8, ptr %0, i64 8
  store double %.sink, ptr %55, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %7) #7
  br label %56

56:                                               ; preds = %54, %30
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  ret void
}

declare void @print_trace() local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local double @Vec3d_innerProduct(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @Vec3d_constMulSelf(ptr noundef, double noundef) local_unnamed_addr #3

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

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


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