; 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._RcsJoint = type { ptr, double, double, double, double, double, double, double, i8, i32, i32, i32, i32, ptr, %struct.HTr, double, double, double, double, i32, 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

declare void @MatNd_reshapeAndSetZero(ptr noundef, i32 noundef, i32 noundef) #1

declare ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef) #1

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

declare double @MatNd_get(ptr noundef, i32 noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local double @RcsGraph_jointLimitGradientPlateau(ptr noundef %0, ptr noundef %1, double noundef %2, i32 noundef %3) #4 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store double %2, ptr %7, align 8, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %19 = load i32, ptr %8, align 4, !tbaa !11
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %25

21:                                               ; preds = %4
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._RcsGraph, ptr %22, i32 0, i32 2
  %24 = load i32, ptr %23, align 8, !tbaa !13
  br label %29

25:                                               ; preds = %4
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._RcsGraph, ptr %26, i32 0, i32 3
  %28 = load i32, ptr %27, align 4, !tbaa !15
  br label %29

29:                                               ; preds = %25, %21
  %30 = phi i32 [ %24, %21 ], [ %28, %25 ]
  store i32 %30, ptr %10, align 4, !tbaa !11
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load i32, ptr %10, align 4, !tbaa !11
  call void @MatNd_reshapeAndSetZero(ptr noundef %31, i32 noundef 1, i32 noundef %32)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._RcsGraph, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  store ptr %35, ptr %11, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %209, %29
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = icmp ne ptr %37, null
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %212

40:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._RcsBody, ptr %41, i32 0, i32 18
  %43 = load ptr, ptr %42, align 8, !tbaa !17
  store ptr %43, ptr %13, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %204, %40
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %208

48:                                               ; preds = %44
  %49 = load ptr, ptr %13, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._RcsJoint, ptr %49, i32 0, i32 12
  %51 = load i32, ptr %50, align 8, !tbaa !20
  %52 = icmp eq i32 %51, -1
  br i1 %52, label %53, label %57

53:                                               ; preds = %48
  %54 = load i32, ptr %8, align 4, !tbaa !11
  %55 = icmp eq i32 %54, 1
  br i1 %55, label %56, label %57

56:                                               ; preds = %53
  br label %204

57:                                               ; preds = %53, %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %58 = load i32, ptr %8, align 4, !tbaa !11
  %59 = icmp eq i32 %58, 1
  br i1 %59, label %60, label %64

60:                                               ; preds = %57
  %61 = load ptr, ptr %13, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._RcsJoint, ptr %61, i32 0, i32 12
  %63 = load i32, ptr %62, align 8, !tbaa !20
  br label %68

64:                                               ; preds = %57
  %65 = load ptr, ptr %13, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._RcsJoint, ptr %65, i32 0, i32 11
  %67 = load i32, ptr %66, align 4, !tbaa !23
  br label %68

68:                                               ; preds = %64, %60
  %69 = phi i32 [ %63, %60 ], [ %67, %64 ]
  store i32 %69, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._RcsGraph, ptr %70, i32 0, i32 4
  %72 = load ptr, ptr %71, align 8, !tbaa !24
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._RcsJoint, ptr %73, i32 0, i32 11
  %75 = load i32, ptr %74, align 4, !tbaa !23
  %76 = call double @MatNd_get(ptr noundef %72, i32 noundef %75, i32 noundef 0)
  store double %76, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._RcsJoint, ptr %77, i32 0, i32 4
  %79 = load double, ptr %78, align 8, !tbaa !25
  %80 = load ptr, ptr %13, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._RcsJoint, ptr %80, i32 0, i32 3
  %82 = load double, ptr %81, align 8, !tbaa !26
  %83 = fsub double %79, %82
  %84 = load double, ptr %7, align 8, !tbaa !9
  %85 = fmul double %83, %84
  store double %85, ptr %16, align 8, !tbaa !9
  %86 = load double, ptr %16, align 8, !tbaa !9
  %87 = fcmp ogt double %86, 0.000000e+00
  br i1 %87, label %88, label %203

88:                                               ; preds = %68
  %89 = load ptr, ptr %13, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._RcsJoint, ptr %89, i32 0, i32 12
  %91 = load i32, ptr %90, align 8, !tbaa !20
  %92 = icmp ne i32 %91, -1
  br i1 %92, label %93, label %203

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._RcsJoint, ptr %94, i32 0, i32 3
  %96 = load double, ptr %95, align 8, !tbaa !26
  %97 = load double, ptr %16, align 8, !tbaa !9
  %98 = fadd double %96, %97
  store double %98, ptr %17, align 8, !tbaa !9
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._RcsJoint, ptr %99, i32 0, i32 1
  %101 = load double, ptr %100, align 8, !tbaa !27
  %102 = load double, ptr %17, align 8, !tbaa !9
  %103 = fcmp olt double %101, %102
  br i1 %103, label %104, label %114

104:                                              ; preds = %93
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._MatNd, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !28
  %108 = load i32, ptr %14, align 4, !tbaa !11
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds double, ptr %107, i64 %109
  store double 0.000000e+00, ptr %110, align 8, !tbaa !9
  %111 = load ptr, ptr %13, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._RcsJoint, ptr %111, i32 0, i32 1
  %113 = load double, ptr %112, align 8, !tbaa !27
  store double %113, ptr %17, align 8, !tbaa !9
  br label %114

114:                                              ; preds = %104, %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._RcsJoint, ptr %115, i32 0, i32 4
  %117 = load double, ptr %116, align 8, !tbaa !25
  %118 = load double, ptr %16, align 8, !tbaa !9
  %119 = fsub double %117, %118
  store double %119, ptr %18, align 8, !tbaa !9
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._RcsJoint, ptr %120, i32 0, i32 1
  %122 = load double, ptr %121, align 8, !tbaa !27
  %123 = load double, ptr %18, align 8, !tbaa !9
  %124 = fcmp ogt double %122, %123
  br i1 %124, label %125, label %135

125:                                              ; preds = %114
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._MatNd, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !28
  %129 = load i32, ptr %14, align 4, !tbaa !11
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds double, ptr %128, i64 %130
  store double 0.000000e+00, ptr %131, align 8, !tbaa !9
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._RcsJoint, ptr %132, i32 0, i32 1
  %134 = load double, ptr %133, align 8, !tbaa !27
  store double %134, ptr %18, align 8, !tbaa !9
  br label %135

135:                                              ; preds = %125, %114
  %136 = load double, ptr %15, align 8, !tbaa !9
  %137 = load double, ptr %17, align 8, !tbaa !9
  %138 = fcmp olt double %136, %137
  br i1 %138, label %139, label %168

139:                                              ; preds = %135
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._RcsJoint, ptr %140, i32 0, i32 5
  %142 = load double, ptr %141, align 8, !tbaa !30
  %143 = load double, ptr %15, align 8, !tbaa !9
  %144 = load double, ptr %17, align 8, !tbaa !9
  %145 = fsub double %143, %144
  %146 = fmul double %142, %145
  %147 = load double, ptr %16, align 8, !tbaa !9
  %148 = load double, ptr %16, align 8, !tbaa !9
  %149 = fmul double %147, %148
  %150 = fdiv double %146, %149
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._MatNd, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !28
  %154 = load i32, ptr %14, align 4, !tbaa !11
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds double, ptr %153, i64 %155
  store double %150, ptr %156, align 8, !tbaa !9
  %157 = load ptr, ptr %13, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct._RcsJoint, ptr %157, i32 0, i32 5
  %159 = load double, ptr %158, align 8, !tbaa !30
  %160 = load double, ptr %15, align 8, !tbaa !9
  %161 = load double, ptr %17, align 8, !tbaa !9
  %162 = fsub double %160, %161
  %163 = load double, ptr %16, align 8, !tbaa !9
  %164 = fdiv double %162, %163
  %165 = call double @pow(double noundef %164, double noundef 2.000000e+00) #5
  %166 = load double, ptr %9, align 8, !tbaa !9
  %167 = call double @llvm.fmuladd.f64(double %159, double %165, double %166)
  store double %167, ptr %9, align 8, !tbaa !9
  br label %202

168:                                              ; preds = %135
  %169 = load double, ptr %15, align 8, !tbaa !9
  %170 = load double, ptr %18, align 8, !tbaa !9
  %171 = fcmp ogt double %169, %170
  br i1 %171, label %172, label %201

172:                                              ; preds = %168
  %173 = load ptr, ptr %13, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._RcsJoint, ptr %173, i32 0, i32 5
  %175 = load double, ptr %174, align 8, !tbaa !30
  %176 = load double, ptr %15, align 8, !tbaa !9
  %177 = load double, ptr %18, align 8, !tbaa !9
  %178 = fsub double %176, %177
  %179 = fmul double %175, %178
  %180 = load double, ptr %16, align 8, !tbaa !9
  %181 = load double, ptr %16, align 8, !tbaa !9
  %182 = fmul double %180, %181
  %183 = fdiv double %179, %182
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._MatNd, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8, !tbaa !28
  %187 = load i32, ptr %14, align 4, !tbaa !11
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds double, ptr %186, i64 %188
  store double %183, ptr %189, align 8, !tbaa !9
  %190 = load ptr, ptr %13, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct._RcsJoint, ptr %190, i32 0, i32 5
  %192 = load double, ptr %191, align 8, !tbaa !30
  %193 = load double, ptr %15, align 8, !tbaa !9
  %194 = load double, ptr %18, align 8, !tbaa !9
  %195 = fsub double %193, %194
  %196 = load double, ptr %16, align 8, !tbaa !9
  %197 = fdiv double %195, %196
  %198 = call double @pow(double noundef %197, double noundef 2.000000e+00) #5
  %199 = load double, ptr %9, align 8, !tbaa !9
  %200 = call double @llvm.fmuladd.f64(double %192, double %198, double %199)
  store double %200, ptr %9, align 8, !tbaa !9
  br label %201

201:                                              ; preds = %172, %168
  br label %202

202:                                              ; preds = %201, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %203

203:                                              ; preds = %202, %88, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %204

204:                                              ; preds = %203, %56
  %205 = load ptr, ptr %13, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct._RcsJoint, ptr %205, i32 0, i32 23
  %207 = load ptr, ptr %206, align 8, !tbaa !31
  store ptr %207, ptr %13, align 8, !tbaa !5
  br label %44, !llvm.loop !32

208:                                              ; preds = %47
  br label %209

209:                                              ; preds = %208
  %210 = load ptr, ptr %11, align 8, !tbaa !5
  %211 = call ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef %210)
  store ptr %211, ptr %11, align 8, !tbaa !5
  br label %36, !llvm.loop !34

212:                                              ; preds = %39
  %213 = load double, ptr %9, align 8, !tbaa !9
  %214 = fmul double 5.000000e-01, %213
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret double %214
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 1848}
!14 = !{!"_RcsGraph", !6, i64 0, !7, i64 8, !12, i64 1848, !12, i64 1852, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888}
!15 = !{!14, !12, i64 1852}
!16 = !{!14, !6, i64 0}
!17 = !{!18, !6, i64 168}
!18 = !{!"_RcsBody", !10, i64 0, !19, i64 8, !12, i64 12, !7, i64 16, !7, i64 40, !10, 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}
!19 = !{!"_Bool", !7, i64 0}
!20 = !{!21, !12, i64 80}
!21 = !{!"_RcsJoint", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !19, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !6, i64 88, !22, i64 96, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !12, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264}
!22 = !{!"", !7, i64 0, !7, i64 24}
!23 = !{!21, !12, i64 76}
!24 = !{!14, !6, i64 1856}
!25 = !{!21, !10, i64 32}
!26 = !{!21, !10, i64 24}
!27 = !{!21, !10, i64 8}
!28 = !{!29, !6, i64 0}
!29 = !{!"_MatNd", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !19, i64 20}
!30 = !{!21, !10, i64 40}
!31 = !{!21, !6, i64 256}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}


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

declare void @MatNd_reshapeAndSetZero(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef) local_unnamed_addr #0

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

declare double @MatNd_get(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local double @RcsGraph_jointLimitGradientPlateau(ptr nocapture noundef readonly %0, ptr noundef %1, double noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = icmp eq i32 %3, 0
  %.in.v = select i1 %5, i64 1848, i64 1852
  %.in = getelementptr inbounds i8, ptr %0, i64 %.in.v
  %6 = load i32, ptr %.in, align 4, !tbaa !5
  tail call void @MatNd_reshapeAndSetZero(ptr noundef %1, i32 noundef 1, i32 noundef %6) #3
  %7 = load ptr, ptr %0, align 8, !tbaa !9
  %.not82 = icmp eq ptr %7, null
  br i1 %.not82, label %._crit_edge87, label %.lr.ph86

.lr.ph86:                                         ; preds = %4
  %8 = icmp eq i32 %3, 1
  %9 = getelementptr inbounds i8, ptr %0, i64 1856
  br label %11

._crit_edge87.loopexit:                           ; preds = %._crit_edge
  %10 = fmul double %.1.lcssa, 5.000000e-01
  br label %._crit_edge87

._crit_edge87:                                    ; preds = %._crit_edge87.loopexit, %4
  %.067.lcssa = phi double [ 0.000000e+00, %4 ], [ %10, %._crit_edge87.loopexit ]
  ret double %.067.lcssa

11:                                               ; preds = %.lr.ph86, %._crit_edge
  %.06784 = phi double [ 0.000000e+00, %.lr.ph86 ], [ %.1.lcssa, %._crit_edge ]
  %.06883 = phi ptr [ %7, %.lr.ph86 ], [ %13, %._crit_edge ]
  %12 = getelementptr inbounds i8, ptr %.06883, i64 168
  %.06978 = load ptr, ptr %12, align 8, !tbaa !12
  %.not7579 = icmp eq ptr %.06978, null
  br i1 %.not7579, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %65, %11
  %.1.lcssa = phi double [ %.06784, %11 ], [ %.4, %65 ]
  %13 = tail call ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef nonnull %.06883) #3
  %.not = icmp eq ptr %13, null
  br i1 %.not, label %._crit_edge87.loopexit, label %11, !llvm.loop !13

.lr.ph:                                           ; preds = %11, %65
  %.06981 = phi ptr [ %.069, %65 ], [ %.06978, %11 ]
  %.180 = phi double [ %.4, %65 ], [ %.06784, %11 ]
  %14 = getelementptr inbounds i8, ptr %.06981, i64 80
  %15 = load i32, ptr %14, align 8, !tbaa !15
  %16 = icmp eq i32 %15, -1
  %or.cond = and i1 %8, %16
  br i1 %or.cond, label %65, label %17

17:                                               ; preds = %.lr.ph
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.06981, i64 76
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !20
  %..pre = select i1 %8, i32 %15, i32 %.pre
  %18 = load ptr, ptr %9, align 8, !tbaa !21
  %19 = tail call double @MatNd_get(ptr noundef %18, i32 noundef %.pre, i32 noundef 0) #3
  %20 = getelementptr inbounds i8, ptr %.06981, i64 32
  %21 = load double, ptr %20, align 8, !tbaa !22
  %22 = getelementptr inbounds i8, ptr %.06981, i64 24
  %23 = load double, ptr %22, align 8, !tbaa !23
  %24 = fsub double %21, %23
  %25 = fmul double %24, %2
  %26 = fcmp ogt double %25, 0.000000e+00
  br i1 %26, label %27, label %65

27:                                               ; preds = %17
  %28 = load i32, ptr %14, align 8, !tbaa !15
  %.not76 = icmp eq i32 %28, -1
  br i1 %.not76, label %65, label %29

29:                                               ; preds = %27
  %30 = fadd double %23, %25
  %31 = getelementptr inbounds i8, ptr %.06981, i64 8
  %32 = load double, ptr %31, align 8, !tbaa !24
  %33 = fcmp olt double %32, %30
  br i1 %33, label %34, label %39

34:                                               ; preds = %29
  %35 = load ptr, ptr %1, align 8, !tbaa !25
  %36 = sext i32 %..pre to i64
  %37 = getelementptr inbounds double, ptr %35, i64 %36
  store double 0.000000e+00, ptr %37, align 8, !tbaa !27
  %38 = load double, ptr %31, align 8, !tbaa !24
  %.pre90 = load double, ptr %20, align 8, !tbaa !22
  br label %39

39:                                               ; preds = %34, %29
  %40 = phi double [ %38, %34 ], [ %32, %29 ]
  %41 = phi double [ %.pre90, %34 ], [ %21, %29 ]
  %.066 = phi double [ %38, %34 ], [ %30, %29 ]
  %42 = fsub double %41, %25
  %43 = fcmp ogt double %40, %42
  br i1 %43, label %44, label %49

44:                                               ; preds = %39
  %45 = load ptr, ptr %1, align 8, !tbaa !25
  %46 = sext i32 %..pre to i64
  %47 = getelementptr inbounds double, ptr %45, i64 %46
  store double 0.000000e+00, ptr %47, align 8, !tbaa !27
  %48 = load double, ptr %31, align 8, !tbaa !24
  br label %49

49:                                               ; preds = %44, %39
  %.0 = phi double [ %48, %44 ], [ %42, %39 ]
  %50 = fcmp olt double %19, %.066
  br i1 %50, label %.sink.split, label %51

51:                                               ; preds = %49
  %52 = fcmp ogt double %19, %.0
  br i1 %52, label %.sink.split, label %65

.sink.split:                                      ; preds = %51, %49
  %.0.sink = phi double [ %.066, %49 ], [ %.0, %51 ]
  %53 = getelementptr inbounds i8, ptr %.06981, i64 40
  %54 = load double, ptr %53, align 8, !tbaa !28
  %55 = fsub double %19, %.0.sink
  %56 = fmul double %55, %54
  %57 = fmul double %25, %25
  %58 = fdiv double %56, %57
  %59 = load ptr, ptr %1, align 8, !tbaa !25
  %60 = sext i32 %..pre to i64
  %61 = getelementptr inbounds double, ptr %59, i64 %60
  store double %58, ptr %61, align 8, !tbaa !27
  %62 = load double, ptr %53, align 8, !tbaa !28
  %63 = fdiv double %55, %25
  %square = fmul double %63, %63
  %64 = tail call double @llvm.fmuladd.f64(double %62, double %square, double %.180)
  br label %65

65:                                               ; preds = %.sink.split, %17, %27, %51, %.lr.ph
  %.4 = phi double [ %.180, %.lr.ph ], [ %.180, %27 ], [ %.180, %17 ], [ %.180, %51 ], [ %64, %.sink.split ]
  %66 = getelementptr inbounds i8, ptr %.06981, i64 256
  %.069 = load ptr, ptr %66, align 8, !tbaa !12
  %.not75 = icmp eq ptr %.069, null
  br i1 %.not75, label %._crit_edge, label %.lr.ph, !llvm.loop !29
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_RcsGraph", !11, i64 0, !7, i64 8, !6, i64 1848, !6, i64 1852, !11, i64 1856, !11, i64 1864, !11, i64 1872, !11, i64 1880, !11, i64 1888}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 80}
!16 = !{!"_RcsJoint", !11, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !17, i64 32, !17, i64 40, !17, i64 48, !17, i64 56, !18, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !11, i64 88, !19, i64 96, !17, i64 192, !17, i64 200, !17, i64 208, !17, i64 216, !6, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264}
!17 = !{!"double", !7, i64 0}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{!"", !7, i64 0, !7, i64 24}
!20 = !{!16, !6, i64 76}
!21 = !{!10, !11, i64 1856}
!22 = !{!16, !17, i64 32}
!23 = !{!16, !17, i64 24}
!24 = !{!16, !17, i64 8}
!25 = !{!26, !11, i64 0}
!26 = !{!"_MatNd", !11, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !18, i64 20}
!27 = !{!17, !17, i64 0}
!28 = !{!16, !17, i64 40}
!29 = distinct !{!29, !14}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass