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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._RcsGraph = type { ptr, [10 x %struct._RcsBody], i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct._RcsBody = type { double, i8, i32, [3 x double], [3 x double], double, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.HTr = type { [3 x double], [3 x [3 x double]] }
%struct._MatNd = type { ptr, i32, i32, i32, i8 }

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

; 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
declare dso_local void @RcsGraph_bodyPointHessian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @MatNd_create(i32 noundef, i32 noundef) #2

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

declare void @MatNd_destroy(ptr noundef) #2

declare ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @RcsGraph_computeCOGHessian(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, 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 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct._RcsGraph, ptr %11, i32 0, i32 3
  %13 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %13, ptr %6, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %14 = load i32, ptr %6, align 4, !tbaa !12
  %15 = mul nsw i32 3, %14
  %16 = load i32, ptr %6, align 4, !tbaa !12
  %17 = mul nsw i32 %15, %16
  store i32 %17, ptr %7, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store double 0.000000e+00, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %18 = load i32, ptr %7, align 4, !tbaa !12
  %19 = call ptr @MatNd_create(i32 noundef %18, i32 noundef 1)
  store ptr %19, ptr %9, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = load i32, ptr %7, align 4, !tbaa !12
  %22 = sext i32 %21 to i64
  %23 = mul i64 %22, 8
  call void @llvm.memset.p0.i64(ptr align 8 %20, i8 0, i64 %23, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct._RcsGraph, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !15
  store ptr %26, ptr %10, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %76, %2
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %79

31:                                               ; preds = %27
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._RcsBody, ptr %32, i32 0, i32 0
  %34 = load double, ptr %33, align 8, !tbaa !16
  %35 = fcmp ogt double %34, 0.000000e+00
  br i1 %35, label %36, label %75

36:                                               ; preds = %31
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._RcsBody, ptr %39, i32 0, i32 11
  %41 = load ptr, ptr %40, align 8, !tbaa !19
  %42 = getelementptr inbounds %struct.HTr, ptr %41, i32 0, i32 0
  %43 = getelementptr inbounds [3 x double], ptr %42, i64 0, i64 0
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  call void @RcsGraph_bodyPointHessian(ptr noundef %37, ptr noundef %38, ptr noundef %43, ptr noundef null, ptr noundef %44)
  store i32 0, ptr %5, align 4, !tbaa !12
  br label %45

45:                                               ; preds = %66, %36
  %46 = load i32, ptr %5, align 4, !tbaa !12
  %47 = load i32, ptr %7, align 4, !tbaa !12
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %49, label %69

49:                                               ; preds = %45
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._MatNd, ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !20
  %53 = load i32, ptr %5, align 4, !tbaa !12
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds double, ptr %52, i64 %54
  %56 = load double, ptr %55, align 8, !tbaa !13
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._RcsBody, ptr %57, i32 0, i32 0
  %59 = load double, ptr %58, align 8, !tbaa !16
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = load i32, ptr %5, align 4, !tbaa !12
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %60, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !13
  %65 = call double @llvm.fmuladd.f64(double %56, double %59, double %64)
  store double %65, ptr %63, align 8, !tbaa !13
  br label %66

66:                                               ; preds = %49
  %67 = load i32, ptr %5, align 4, !tbaa !12
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %5, align 4, !tbaa !12
  br label %45, !llvm.loop !22

69:                                               ; preds = %45
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._RcsBody, ptr %70, i32 0, i32 0
  %72 = load double, ptr %71, align 8, !tbaa !16
  %73 = load double, ptr %8, align 8, !tbaa !13
  %74 = fadd double %73, %72
  store double %74, ptr %8, align 8, !tbaa !13
  br label %75

75:                                               ; preds = %69, %31
  br label %76

76:                                               ; preds = %75
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = call ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef %77)
  store ptr %78, ptr %10, align 8, !tbaa !5
  br label %27, !llvm.loop !24

79:                                               ; preds = %30
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %80)
  %81 = load double, ptr %8, align 8, !tbaa !13
  %82 = fcmp ogt double %81, 0.000000e+00
  br i1 %82, label %83, label %100

83:                                               ; preds = %79
  store i32 0, ptr %5, align 4, !tbaa !12
  br label %84

84:                                               ; preds = %96, %83
  %85 = load i32, ptr %5, align 4, !tbaa !12
  %86 = load i32, ptr %7, align 4, !tbaa !12
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %88, label %99

88:                                               ; preds = %84
  %89 = load double, ptr %8, align 8, !tbaa !13
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load i32, ptr %5, align 4, !tbaa !12
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds double, ptr %90, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !13
  %95 = fdiv double %94, %89
  store double %95, ptr %93, align 8, !tbaa !13
  br label %96

96:                                               ; preds = %88
  %97 = load i32, ptr %5, align 4, !tbaa !12
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %5, align 4, !tbaa !12
  br label %84, !llvm.loop !25

99:                                               ; preds = %84
  br label %100

100:                                              ; preds = %99, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !11, i64 1852}
!10 = !{!"_RcsGraph", !6, i64 0, !7, i64 8, !11, i64 1848, !11, i64 1852, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!10, !6, i64 0}
!16 = !{!17, !14, i64 0}
!17 = !{!"_RcsBody", !14, i64 0, !18, i64 8, !11, i64 12, !7, i64 16, !7, i64 40, !14, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{!17, !6, i64 112}
!20 = !{!21, !6, i64 0}
!21 = !{!"_MatNd", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !18, i64 20}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !23}


; 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: nounwind uwtable
declare dso_local void @RcsGraph_bodyPointHessian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @MatNd_create(i32 noundef, i32 noundef) local_unnamed_addr #1

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

declare void @MatNd_destroy(ptr noundef) local_unnamed_addr #1

declare ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @RcsGraph_computeCOGHessian(ptr noundef %0, ptr nocapture noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 1852
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %5 = mul nsw i32 %4, 3
  %6 = mul nsw i32 %5, %4
  %7 = tail call ptr @MatNd_create(i32 noundef %6, i32 noundef 1) #5
  %8 = sext i32 %6 to i64
  %9 = shl nsw i64 %8, 3
  tail call void @llvm.memset.p0.i64(ptr align 8 %1, i8 0, i64 %9, i1 false)
  %10 = load ptr, ptr %0, align 8, !tbaa !11
  %.not35 = icmp eq ptr %10, null
  br i1 %.not35, label %._crit_edge40, label %.lr.ph39

.lr.ph39:                                         ; preds = %2
  %11 = icmp sgt i32 %6, 0
  br i1 %11, label %.lr.ph39.split.us.preheader, label %.lr.ph39.split

.lr.ph39.split.us.preheader:                      ; preds = %.lr.ph39
  %wide.trip.count = zext nneg i32 %6 to i64
  %12 = shl nuw nsw i64 %wide.trip.count, 3
  %scevgep = getelementptr i8, ptr %1, i64 %12
  %min.iters.check = icmp ult i32 %6, 4
  %n.vec = and i64 %wide.trip.count, 2147483644
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  %xtraiter = and i64 %wide.trip.count, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %13 = add nsw i64 %wide.trip.count, -1
  br label %.lr.ph39.split.us

.lr.ph39.split.us:                                ; preds = %.lr.ph39.split.us.preheader, %34
  %.037.us = phi ptr [ %35, %34 ], [ %10, %.lr.ph39.split.us.preheader ]
  %.03236.us = phi double [ %.133.us, %34 ], [ 0.000000e+00, %.lr.ph39.split.us.preheader ]
  %14 = load double, ptr %.037.us, align 8, !tbaa !12
  %15 = fcmp ogt double %14, 0.000000e+00
  br i1 %15, label %.lr.ph.us, label %34

.lr.ph.us:                                        ; preds = %.lr.ph39.split.us
  %16 = getelementptr inbounds i8, ptr %.037.us, i64 112
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  tail call void @RcsGraph_bodyPointHessian(ptr noundef nonnull %0, ptr noundef nonnull %.037.us, ptr noundef %17, ptr noundef null, ptr noundef %7)
  %18 = load ptr, ptr %7, align 8, !tbaa !17
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph.us
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph.us ], [ %n.vec, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %19 = getelementptr inbounds double, ptr %18, i64 %indvars.iv.ph
  %20 = load double, ptr %19, align 8, !tbaa !19
  %21 = load double, ptr %.037.us, align 8, !tbaa !12
  %22 = getelementptr inbounds double, ptr %1, i64 %indvars.iv.ph
  %23 = load double, ptr %22, align 8, !tbaa !19
  %24 = tail call double @llvm.fmuladd.f64(double %20, double %21, double %23)
  store double %24, ptr %22, align 8, !tbaa !19
  %indvars.iv.next.prol = or disjoint i64 %indvars.iv.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %25 = icmp eq i64 %indvars.iv.ph, %13
  br i1 %25, label %._crit_edge.us, label %scalar.ph

vector.memcheck:                                  ; preds = %.lr.ph.us
  %scevgep51 = getelementptr i8, ptr %18, i64 %12
  %scevgep52 = getelementptr i8, ptr %.037.us, i64 8
  %bound0 = icmp ugt ptr %scevgep51, %1
  %bound1 = icmp ult ptr %18, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound053 = icmp ugt ptr %scevgep52, %1
  %bound154 = icmp ult ptr %.037.us, %scevgep
  %found.conflict55 = and i1 %bound053, %bound154
  %conflict.rdx = or i1 %found.conflict, %found.conflict55
  br i1 %conflict.rdx, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %26 = load double, ptr %.037.us, align 8, !tbaa !12, !alias.scope !20
  %broadcast.splatinsert59 = insertelement <2 x double> poison, double %26, i64 0
  %broadcast.splat60 = shufflevector <2 x double> %broadcast.splatinsert59, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %27 = getelementptr inbounds double, ptr %18, i64 %index
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %wide.load = load <2 x double>, ptr %27, align 8, !tbaa !19, !alias.scope !23
  %wide.load56 = load <2 x double>, ptr %28, align 8, !tbaa !19, !alias.scope !23
  %29 = getelementptr inbounds double, ptr %1, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %wide.load57 = load <2 x double>, ptr %29, align 8, !tbaa !19, !alias.scope !25, !noalias !27
  %wide.load58 = load <2 x double>, ptr %30, align 8, !tbaa !19, !alias.scope !25, !noalias !27
  %31 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load, <2 x double> %broadcast.splat60, <2 x double> %wide.load57)
  %32 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load56, <2 x double> %broadcast.splat60, <2 x double> %wide.load58)
  store <2 x double> %31, ptr %29, align 8, !tbaa !19, !alias.scope !25, !noalias !27
  store <2 x double> %32, ptr %30, align 8, !tbaa !19, !alias.scope !25, !noalias !27
  %index.next = add nuw i64 %index, 4
  %33 = icmp eq i64 %index.next, %n.vec
  br i1 %33, label %middle.block, label %vector.body, !llvm.loop !28

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us, label %scalar.ph.preheader

34:                                               ; preds = %._crit_edge.us, %.lr.ph39.split.us
  %.133.us = phi double [ %49, %._crit_edge.us ], [ %.03236.us, %.lr.ph39.split.us ]
  %35 = tail call ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef nonnull %.037.us) #5
  %.not.us = icmp eq ptr %35, null
  br i1 %.not.us, label %._crit_edge40, label %.lr.ph39.split.us, !llvm.loop !32

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %36 = getelementptr inbounds double, ptr %18, i64 %indvars.iv
  %37 = load double, ptr %36, align 8, !tbaa !19
  %38 = load double, ptr %.037.us, align 8, !tbaa !12
  %39 = getelementptr inbounds double, ptr %1, i64 %indvars.iv
  %40 = load double, ptr %39, align 8, !tbaa !19
  %41 = tail call double @llvm.fmuladd.f64(double %37, double %38, double %40)
  store double %41, ptr %39, align 8, !tbaa !19
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = getelementptr inbounds double, ptr %18, i64 %indvars.iv.next
  %43 = load double, ptr %42, align 8, !tbaa !19
  %44 = load double, ptr %.037.us, align 8, !tbaa !12
  %45 = getelementptr inbounds double, ptr %1, i64 %indvars.iv.next
  %46 = load double, ptr %45, align 8, !tbaa !19
  %47 = tail call double @llvm.fmuladd.f64(double %43, double %44, double %46)
  store double %47, ptr %45, align 8, !tbaa !19
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.not.1, label %._crit_edge.us, label %scalar.ph, !llvm.loop !33

._crit_edge.us:                                   ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %48 = load double, ptr %.037.us, align 8, !tbaa !12
  %49 = fadd double %.03236.us, %48
  br label %34

._crit_edge40:                                    ; preds = %62, %34, %2
  %.032.lcssa = phi double [ 0.000000e+00, %2 ], [ %.133.us, %34 ], [ %.133, %62 ]
  tail call void @MatNd_destroy(ptr noundef %7) #5
  %50 = fcmp ogt double %.032.lcssa, 0.000000e+00
  %51 = icmp sgt i32 %6, 0
  %or.cond = and i1 %50, %51
  br i1 %or.cond, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %._crit_edge40
  %wide.trip.count47 = zext nneg i32 %6 to i64
  %min.iters.check63 = icmp ult i32 %6, 2
  br i1 %min.iters.check63, label %.lr.ph.preheader73, label %vector.ph64

.lr.ph.preheader73:                               ; preds = %middle.block61, %.lr.ph.preheader
  %indvars.iv44.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec66, %middle.block61 ]
  br label %.lr.ph

vector.ph64:                                      ; preds = %.lr.ph.preheader
  %n.vec66 = and i64 %wide.trip.count47, 2147483646
  %broadcast.splatinsert = insertelement <2 x double> poison, double %.032.lcssa, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body68

vector.body68:                                    ; preds = %vector.body68, %vector.ph64
  %index69 = phi i64 [ 0, %vector.ph64 ], [ %index.next71, %vector.body68 ]
  %52 = getelementptr inbounds double, ptr %1, i64 %index69
  %wide.load70 = load <2 x double>, ptr %52, align 8, !tbaa !19
  %53 = fdiv <2 x double> %wide.load70, %broadcast.splat
  store <2 x double> %53, ptr %52, align 8, !tbaa !19
  %index.next71 = add nuw i64 %index69, 2
  %54 = icmp eq i64 %index.next71, %n.vec66
  br i1 %54, label %middle.block61, label %vector.body68, !llvm.loop !34

middle.block61:                                   ; preds = %vector.body68
  %cmp.n72 = icmp eq i64 %n.vec66, %wide.trip.count47
  br i1 %cmp.n72, label %.loopexit, label %.lr.ph.preheader73

.lr.ph39.split:                                   ; preds = %.lr.ph39, %62
  %.037 = phi ptr [ %63, %62 ], [ %10, %.lr.ph39 ]
  %.03236 = phi double [ %.133, %62 ], [ 0.000000e+00, %.lr.ph39 ]
  %55 = load double, ptr %.037, align 8, !tbaa !12
  %56 = fcmp ogt double %55, 0.000000e+00
  br i1 %56, label %57, label %62

57:                                               ; preds = %.lr.ph39.split
  %58 = getelementptr inbounds i8, ptr %.037, i64 112
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  tail call void @RcsGraph_bodyPointHessian(ptr noundef nonnull %0, ptr noundef nonnull %.037, ptr noundef %59, ptr noundef null, ptr noundef %7)
  %60 = load double, ptr %.037, align 8, !tbaa !12
  %61 = fadd double %.03236, %60
  br label %62

62:                                               ; preds = %.lr.ph39.split, %57
  %.133 = phi double [ %61, %57 ], [ %.03236, %.lr.ph39.split ]
  %63 = tail call ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef nonnull %.037) #5
  %.not = icmp eq ptr %63, null
  br i1 %.not, label %._crit_edge40, label %.lr.ph39.split, !llvm.loop !32

.lr.ph:                                           ; preds = %.lr.ph.preheader73, %.lr.ph
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %.lr.ph ], [ %indvars.iv44.ph, %.lr.ph.preheader73 ]
  %64 = getelementptr inbounds double, ptr %1, i64 %indvars.iv44
  %65 = load double, ptr %64, align 8, !tbaa !19
  %66 = fdiv double %65, %.032.lcssa
  store double %66, ptr %64, align 8, !tbaa !19
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %exitcond48.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count47
  br i1 %exitcond48.not, label %.loopexit, label %.lr.ph, !llvm.loop !35

.loopexit:                                        ; preds = %.lr.ph, %middle.block61, %._crit_edge40
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #4

attributes #0 = { 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 #1 = { "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 nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !10, i64 1852}
!6 = !{!"_RcsGraph", !7, i64 0, !8, i64 8, !10, i64 1848, !10, i64 1852, !7, i64 1856, !7, i64 1864, !7, i64 1872, !7, i64 1880, !7, i64 1888}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"_RcsBody", !14, i64 0, !15, i64 8, !10, i64 12, !8, i64 16, !8, i64 40, !14, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176}
!14 = !{!"double", !8, i64 0}
!15 = !{!"_Bool", !8, i64 0}
!16 = !{!13, !7, i64 112}
!17 = !{!18, !7, i64 0}
!18 = !{!"_MatNd", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !15, i64 20}
!19 = !{!14, !14, i64 0}
!20 = !{!21}
!21 = distinct !{!21, !22}
!22 = distinct !{!22, !"LVerDomain"}
!23 = !{!24}
!24 = distinct !{!24, !22}
!25 = !{!26}
!26 = distinct !{!26, !22}
!27 = !{!24, !21}
!28 = distinct !{!28, !29, !30, !31}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!"llvm.loop.isvectorized", i32 1}
!31 = !{!"llvm.loop.unroll.runtime.disable"}
!32 = distinct !{!32, !29}
!33 = distinct !{!33, !29, !30}
!34 = distinct !{!34, !29, !30, !31}
!35 = distinct !{!35, !29, !31, !30}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass