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

; 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._MatNd = type { ptr, i32, i32, i32, i8 }
%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]] }

; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #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 @RcsGraph_computeKineticTerms(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca [63 x double], align 16
  %13 = alloca [3 x double], align 16
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %struct._MatNd, align 8
  %18 = alloca %struct._MatNd, align 8
  %19 = alloca %struct._MatNd, align 8
  %20 = alloca %struct._MatNd, align 8
  %21 = alloca %struct._MatNd, align 8
  %22 = alloca %struct._MatNd, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca %struct._MatNd, align 8
  %36 = alloca %struct._MatNd, align 8
  %37 = alloca %struct._MatNd, align 8
  %38 = alloca %struct._MatNd, align 8
  %39 = alloca i32, align 4
  %40 = alloca ptr, align 8
  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 ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._RcsGraph, ptr %41, i32 0, i32 3
  %43 = load i32, ptr %42, align 4, !tbaa !9
  store i32 %43, ptr %9, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store double 0.000000e+00, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store double 0.000000e+00, ptr %11, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 504, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %44, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store ptr null, ptr %16, align 8, !tbaa !5
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._RcsGraph, ptr %45, i32 0, i32 5
  %47 = load ptr, ptr %46, align 8, !tbaa !15
  %48 = getelementptr inbounds %struct._MatNd, ptr %47, i32 0, i32 3
  %49 = load i32, ptr %48, align 8, !tbaa !16
  %50 = icmp ugt i32 %49, 1296
  br i1 %50, label %51, label %56

51:                                               ; preds = %4
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._RcsGraph, ptr %52, i32 0, i32 5
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  %55 = call ptr @MatNd_clone(ptr noundef %54)
  store ptr %55, ptr %16, align 8, !tbaa !5
  br label %108

56:                                               ; preds = %4
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._RcsGraph, ptr %57, i32 0, i32 5
  %59 = load ptr, ptr %58, align 8, !tbaa !15
  %60 = getelementptr inbounds %struct._MatNd, ptr %59, i32 0, i32 3
  %61 = load i32, ptr %60, align 8, !tbaa !16
  %62 = zext i32 %61 to i64
  %63 = mul i64 %62, 8
  %64 = add i64 24, %63
  %65 = alloca i8, i64 %64, align 16
  store ptr %65, ptr %16, align 8, !tbaa !5
  %66 = load ptr, ptr %16, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._MatNd, ptr %66, i64 1
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._MatNd, ptr %68, i32 0, i32 0
  store ptr %67, ptr %69, align 8, !tbaa !19
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._RcsGraph, ptr %70, i32 0, i32 5
  %72 = load ptr, ptr %71, align 8, !tbaa !15
  %73 = getelementptr inbounds %struct._MatNd, ptr %72, i32 0, i32 1
  %74 = load i32, ptr %73, align 8, !tbaa !20
  %75 = load ptr, ptr %16, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._MatNd, ptr %75, i32 0, i32 1
  store i32 %74, ptr %76, align 8, !tbaa !20
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._RcsGraph, ptr %77, i32 0, i32 5
  %79 = load ptr, ptr %78, align 8, !tbaa !15
  %80 = getelementptr inbounds %struct._MatNd, ptr %79, i32 0, i32 2
  %81 = load i32, ptr %80, align 4, !tbaa !21
  %82 = load ptr, ptr %16, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._MatNd, ptr %82, i32 0, i32 2
  store i32 %81, ptr %83, align 4, !tbaa !21
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._RcsGraph, ptr %84, i32 0, i32 5
  %86 = load ptr, ptr %85, align 8, !tbaa !15
  %87 = getelementptr inbounds %struct._MatNd, ptr %86, i32 0, i32 3
  %88 = load i32, ptr %87, align 8, !tbaa !16
  %89 = load ptr, ptr %16, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._MatNd, ptr %89, i32 0, i32 3
  store i32 %88, ptr %90, align 8, !tbaa !16
  %91 = load ptr, ptr %16, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._MatNd, ptr %91, i32 0, i32 4
  store i8 1, ptr %92, align 4, !tbaa !22
  %93 = load ptr, ptr %16, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._MatNd, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !19
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._RcsGraph, ptr %96, i32 0, i32 5
  %98 = load ptr, ptr %97, align 8, !tbaa !15
  %99 = getelementptr inbounds %struct._MatNd, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !19
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._RcsGraph, ptr %101, i32 0, i32 5
  %103 = load ptr, ptr %102, align 8, !tbaa !15
  %104 = getelementptr inbounds %struct._MatNd, ptr %103, i32 0, i32 3
  %105 = load i32, ptr %104, align 8, !tbaa !16
  %106 = zext i32 %105 to i64
  %107 = mul i64 %106, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %95, ptr align 8 %100, i64 %107, i1 false)
  br label %108

108:                                              ; preds = %56, %51
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = load ptr, ptr %16, align 8, !tbaa !5
  call void @RcsGraph_stateVectorToIKSelf(ptr noundef %109, ptr noundef %110)
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %17, i32 noundef 1, i32 noundef 1, ptr noundef %11)
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  %111 = getelementptr inbounds [63 x double], ptr %12, i64 0, i64 0
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %18, i32 noundef 6, i32 noundef 6, ptr noundef %111)
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #6
  %112 = getelementptr inbounds [63 x double], ptr %12, i64 0, i64 36
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %19, i32 noundef 6, i32 noundef 1, ptr noundef %112)
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #6
  %113 = getelementptr inbounds [63 x double], ptr %12, i64 0, i64 48
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %20, i32 noundef 6, i32 noundef 1, ptr noundef %113)
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #6
  %114 = getelementptr inbounds [63 x double], ptr %12, i64 0, i64 54
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %21, i32 noundef 6, i32 noundef 1, ptr noundef %114)
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #6
  %115 = getelementptr inbounds [63 x double], ptr %12, i64 0, i64 60
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %22, i32 noundef 3, i32 noundef 1, ptr noundef %115)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store ptr null, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  store ptr null, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  store ptr null, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  store ptr null, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  store ptr null, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  store ptr null, ptr %28, align 8, !tbaa !5
  %116 = load i32, ptr %9, align 4, !tbaa !12
  %117 = mul nsw i32 %116, 1
  %118 = icmp sgt i32 %117, 1296
  br i1 %118, label %119, label %122

119:                                              ; preds = %108
  %120 = load i32, ptr %9, align 4, !tbaa !12
  %121 = call ptr @MatNd_create(i32 noundef %120, i32 noundef 1)
  store ptr %121, ptr %23, align 8, !tbaa !5
  br label %157

122:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  %123 = load i32, ptr %9, align 4, !tbaa !12
  %124 = mul nsw i32 %123, 1
  %125 = icmp eq i32 %124, 0
  br i1 %125, label %126, label %127

126:                                              ; preds = %122
  br label %130

127:                                              ; preds = %122
  %128 = load i32, ptr %9, align 4, !tbaa !12
  %129 = mul nsw i32 %128, 1
  br label %130

130:                                              ; preds = %127, %126
  %131 = phi i32 [ 1, %126 ], [ %129, %127 ]
  store i32 %131, ptr %29, align 4, !tbaa !12
  %132 = load i32, ptr %29, align 4, !tbaa !12
  %133 = zext i32 %132 to i64
  %134 = mul i64 %133, 8
  %135 = add i64 24, %134
  %136 = alloca i8, i64 %135, align 16
  store ptr %136, ptr %23, align 8, !tbaa !5
  %137 = load ptr, ptr %23, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._MatNd, ptr %137, i64 1
  %139 = load ptr, ptr %23, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._MatNd, ptr %139, i32 0, i32 0
  store ptr %138, ptr %140, align 8, !tbaa !19
  %141 = load i32, ptr %9, align 4, !tbaa !12
  %142 = load ptr, ptr %23, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._MatNd, ptr %142, i32 0, i32 1
  store i32 %141, ptr %143, align 8, !tbaa !20
  %144 = load ptr, ptr %23, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._MatNd, ptr %144, i32 0, i32 2
  store i32 1, ptr %145, align 4, !tbaa !21
  %146 = load i32, ptr %29, align 4, !tbaa !12
  %147 = load ptr, ptr %23, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct._MatNd, ptr %147, i32 0, i32 3
  store i32 %146, ptr %148, align 8, !tbaa !16
  %149 = load ptr, ptr %23, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct._MatNd, ptr %149, i32 0, i32 4
  store i8 1, ptr %150, align 4, !tbaa !22
  %151 = load ptr, ptr %23, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._MatNd, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !19
  %154 = load i32, ptr %29, align 4, !tbaa !12
  %155 = zext i32 %154 to i64
  %156 = mul i64 %155, 8
  call void @llvm.memset.p0.i64(ptr align 8 %153, i8 0, i64 %156, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %157

157:                                              ; preds = %130, %119
  %158 = load i32, ptr %9, align 4, !tbaa !12
  %159 = mul nsw i32 6, %158
  %160 = icmp sgt i32 %159, 1296
  br i1 %160, label %161, label %164

161:                                              ; preds = %157
  %162 = load i32, ptr %9, align 4, !tbaa !12
  %163 = call ptr @MatNd_create(i32 noundef 6, i32 noundef %162)
  store ptr %163, ptr %24, align 8, !tbaa !5
  br label %199

164:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  %165 = load i32, ptr %9, align 4, !tbaa !12
  %166 = mul nsw i32 6, %165
  %167 = icmp eq i32 %166, 0
  br i1 %167, label %168, label %169

168:                                              ; preds = %164
  br label %172

169:                                              ; preds = %164
  %170 = load i32, ptr %9, align 4, !tbaa !12
  %171 = mul nsw i32 6, %170
  br label %172

172:                                              ; preds = %169, %168
  %173 = phi i32 [ 1, %168 ], [ %171, %169 ]
  store i32 %173, ptr %30, align 4, !tbaa !12
  %174 = load i32, ptr %30, align 4, !tbaa !12
  %175 = zext i32 %174 to i64
  %176 = mul i64 %175, 8
  %177 = add i64 24, %176
  %178 = alloca i8, i64 %177, align 16
  store ptr %178, ptr %24, align 8, !tbaa !5
  %179 = load ptr, ptr %24, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct._MatNd, ptr %179, i64 1
  %181 = load ptr, ptr %24, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct._MatNd, ptr %181, i32 0, i32 0
  store ptr %180, ptr %182, align 8, !tbaa !19
  %183 = load ptr, ptr %24, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct._MatNd, ptr %183, i32 0, i32 1
  store i32 6, ptr %184, align 8, !tbaa !20
  %185 = load i32, ptr %9, align 4, !tbaa !12
  %186 = load ptr, ptr %24, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct._MatNd, ptr %186, i32 0, i32 2
  store i32 %185, ptr %187, align 4, !tbaa !21
  %188 = load i32, ptr %30, align 4, !tbaa !12
  %189 = load ptr, ptr %24, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct._MatNd, ptr %189, i32 0, i32 3
  store i32 %188, ptr %190, align 8, !tbaa !16
  %191 = load ptr, ptr %24, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct._MatNd, ptr %191, i32 0, i32 4
  store i8 1, ptr %192, align 4, !tbaa !22
  %193 = load ptr, ptr %24, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct._MatNd, ptr %193, i32 0, i32 0
  %195 = load ptr, ptr %194, align 8, !tbaa !19
  %196 = load i32, ptr %30, align 4, !tbaa !12
  %197 = zext i32 %196 to i64
  %198 = mul i64 %197, 8
  call void @llvm.memset.p0.i64(ptr align 8 %195, i8 0, i64 %198, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  br label %199

199:                                              ; preds = %172, %161
  %200 = load i32, ptr %9, align 4, !tbaa !12
  %201 = mul nsw i32 6, %200
  %202 = icmp sgt i32 %201, 1296
  br i1 %202, label %203, label %206

203:                                              ; preds = %199
  %204 = load i32, ptr %9, align 4, !tbaa !12
  %205 = call ptr @MatNd_create(i32 noundef 6, i32 noundef %204)
  store ptr %205, ptr %25, align 8, !tbaa !5
  br label %241

206:                                              ; preds = %199
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  %207 = load i32, ptr %9, align 4, !tbaa !12
  %208 = mul nsw i32 6, %207
  %209 = icmp eq i32 %208, 0
  br i1 %209, label %210, label %211

210:                                              ; preds = %206
  br label %214

211:                                              ; preds = %206
  %212 = load i32, ptr %9, align 4, !tbaa !12
  %213 = mul nsw i32 6, %212
  br label %214

214:                                              ; preds = %211, %210
  %215 = phi i32 [ 1, %210 ], [ %213, %211 ]
  store i32 %215, ptr %31, align 4, !tbaa !12
  %216 = load i32, ptr %31, align 4, !tbaa !12
  %217 = zext i32 %216 to i64
  %218 = mul i64 %217, 8
  %219 = add i64 24, %218
  %220 = alloca i8, i64 %219, align 16
  store ptr %220, ptr %25, align 8, !tbaa !5
  %221 = load ptr, ptr %25, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct._MatNd, ptr %221, i64 1
  %223 = load ptr, ptr %25, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct._MatNd, ptr %223, i32 0, i32 0
  store ptr %222, ptr %224, align 8, !tbaa !19
  %225 = load ptr, ptr %25, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct._MatNd, ptr %225, i32 0, i32 1
  store i32 6, ptr %226, align 8, !tbaa !20
  %227 = load i32, ptr %9, align 4, !tbaa !12
  %228 = load ptr, ptr %25, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct._MatNd, ptr %228, i32 0, i32 2
  store i32 %227, ptr %229, align 4, !tbaa !21
  %230 = load i32, ptr %31, align 4, !tbaa !12
  %231 = load ptr, ptr %25, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct._MatNd, ptr %231, i32 0, i32 3
  store i32 %230, ptr %232, align 8, !tbaa !16
  %233 = load ptr, ptr %25, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct._MatNd, ptr %233, i32 0, i32 4
  store i8 1, ptr %234, align 4, !tbaa !22
  %235 = load ptr, ptr %25, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct._MatNd, ptr %235, i32 0, i32 0
  %237 = load ptr, ptr %236, align 8, !tbaa !19
  %238 = load i32, ptr %31, align 4, !tbaa !12
  %239 = zext i32 %238 to i64
  %240 = mul i64 %239, 8
  call void @llvm.memset.p0.i64(ptr align 8 %237, i8 0, i64 %240, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  br label %241

241:                                              ; preds = %214, %203
  %242 = load i32, ptr %9, align 4, !tbaa !12
  %243 = mul nsw i32 %242, 3
  %244 = icmp sgt i32 %243, 1296
  br i1 %244, label %245, label %248

245:                                              ; preds = %241
  %246 = load i32, ptr %9, align 4, !tbaa !12
  %247 = call ptr @MatNd_create(i32 noundef %246, i32 noundef 3)
  store ptr %247, ptr %26, align 8, !tbaa !5
  br label %283

248:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #6
  %249 = load i32, ptr %9, align 4, !tbaa !12
  %250 = mul nsw i32 %249, 3
  %251 = icmp eq i32 %250, 0
  br i1 %251, label %252, label %253

252:                                              ; preds = %248
  br label %256

253:                                              ; preds = %248
  %254 = load i32, ptr %9, align 4, !tbaa !12
  %255 = mul nsw i32 %254, 3
  br label %256

256:                                              ; preds = %253, %252
  %257 = phi i32 [ 1, %252 ], [ %255, %253 ]
  store i32 %257, ptr %32, align 4, !tbaa !12
  %258 = load i32, ptr %32, align 4, !tbaa !12
  %259 = zext i32 %258 to i64
  %260 = mul i64 %259, 8
  %261 = add i64 24, %260
  %262 = alloca i8, i64 %261, align 16
  store ptr %262, ptr %26, align 8, !tbaa !5
  %263 = load ptr, ptr %26, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct._MatNd, ptr %263, i64 1
  %265 = load ptr, ptr %26, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct._MatNd, ptr %265, i32 0, i32 0
  store ptr %264, ptr %266, align 8, !tbaa !19
  %267 = load i32, ptr %9, align 4, !tbaa !12
  %268 = load ptr, ptr %26, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct._MatNd, ptr %268, i32 0, i32 1
  store i32 %267, ptr %269, align 8, !tbaa !20
  %270 = load ptr, ptr %26, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct._MatNd, ptr %270, i32 0, i32 2
  store i32 3, ptr %271, align 4, !tbaa !21
  %272 = load i32, ptr %32, align 4, !tbaa !12
  %273 = load ptr, ptr %26, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct._MatNd, ptr %273, i32 0, i32 3
  store i32 %272, ptr %274, align 8, !tbaa !16
  %275 = load ptr, ptr %26, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct._MatNd, ptr %275, i32 0, i32 4
  store i8 1, ptr %276, align 4, !tbaa !22
  %277 = load ptr, ptr %26, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct._MatNd, ptr %277, i32 0, i32 0
  %279 = load ptr, ptr %278, align 8, !tbaa !19
  %280 = load i32, ptr %32, align 4, !tbaa !12
  %281 = zext i32 %280 to i64
  %282 = mul i64 %281, 8
  call void @llvm.memset.p0.i64(ptr align 8 %279, i8 0, i64 %282, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  br label %283

283:                                              ; preds = %256, %245
  %284 = load i32, ptr %9, align 4, !tbaa !12
  %285 = mul nsw i32 %284, 6
  %286 = icmp sgt i32 %285, 1296
  br i1 %286, label %287, label %290

287:                                              ; preds = %283
  %288 = load i32, ptr %9, align 4, !tbaa !12
  %289 = call ptr @MatNd_create(i32 noundef %288, i32 noundef 6)
  store ptr %289, ptr %27, align 8, !tbaa !5
  br label %325

290:                                              ; preds = %283
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #6
  %291 = load i32, ptr %9, align 4, !tbaa !12
  %292 = mul nsw i32 %291, 6
  %293 = icmp eq i32 %292, 0
  br i1 %293, label %294, label %295

294:                                              ; preds = %290
  br label %298

295:                                              ; preds = %290
  %296 = load i32, ptr %9, align 4, !tbaa !12
  %297 = mul nsw i32 %296, 6
  br label %298

298:                                              ; preds = %295, %294
  %299 = phi i32 [ 1, %294 ], [ %297, %295 ]
  store i32 %299, ptr %33, align 4, !tbaa !12
  %300 = load i32, ptr %33, align 4, !tbaa !12
  %301 = zext i32 %300 to i64
  %302 = mul i64 %301, 8
  %303 = add i64 24, %302
  %304 = alloca i8, i64 %303, align 16
  store ptr %304, ptr %27, align 8, !tbaa !5
  %305 = load ptr, ptr %27, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct._MatNd, ptr %305, i64 1
  %307 = load ptr, ptr %27, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct._MatNd, ptr %307, i32 0, i32 0
  store ptr %306, ptr %308, align 8, !tbaa !19
  %309 = load i32, ptr %9, align 4, !tbaa !12
  %310 = load ptr, ptr %27, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct._MatNd, ptr %310, i32 0, i32 1
  store i32 %309, ptr %311, align 8, !tbaa !20
  %312 = load ptr, ptr %27, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct._MatNd, ptr %312, i32 0, i32 2
  store i32 6, ptr %313, align 4, !tbaa !21
  %314 = load i32, ptr %33, align 4, !tbaa !12
  %315 = load ptr, ptr %27, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct._MatNd, ptr %315, i32 0, i32 3
  store i32 %314, ptr %316, align 8, !tbaa !16
  %317 = load ptr, ptr %27, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct._MatNd, ptr %317, i32 0, i32 4
  store i8 1, ptr %318, align 4, !tbaa !22
  %319 = load ptr, ptr %27, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct._MatNd, ptr %319, i32 0, i32 0
  %321 = load ptr, ptr %320, align 8, !tbaa !19
  %322 = load i32, ptr %33, align 4, !tbaa !12
  %323 = zext i32 %322 to i64
  %324 = mul i64 %323, 8
  call void @llvm.memset.p0.i64(ptr align 8 %321, i8 0, i64 %324, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #6
  br label %325

325:                                              ; preds = %298, %287
  %326 = load i32, ptr %9, align 4, !tbaa !12
  %327 = mul nsw i32 %326, 1
  %328 = icmp sgt i32 %327, 1296
  br i1 %328, label %329, label %332

329:                                              ; preds = %325
  %330 = load i32, ptr %9, align 4, !tbaa !12
  %331 = call ptr @MatNd_create(i32 noundef %330, i32 noundef 1)
  store ptr %331, ptr %28, align 8, !tbaa !5
  br label %367

332:                                              ; preds = %325
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #6
  %333 = load i32, ptr %9, align 4, !tbaa !12
  %334 = mul nsw i32 %333, 1
  %335 = icmp eq i32 %334, 0
  br i1 %335, label %336, label %337

336:                                              ; preds = %332
  br label %340

337:                                              ; preds = %332
  %338 = load i32, ptr %9, align 4, !tbaa !12
  %339 = mul nsw i32 %338, 1
  br label %340

340:                                              ; preds = %337, %336
  %341 = phi i32 [ 1, %336 ], [ %339, %337 ]
  store i32 %341, ptr %34, align 4, !tbaa !12
  %342 = load i32, ptr %34, align 4, !tbaa !12
  %343 = zext i32 %342 to i64
  %344 = mul i64 %343, 8
  %345 = add i64 24, %344
  %346 = alloca i8, i64 %345, align 16
  store ptr %346, ptr %28, align 8, !tbaa !5
  %347 = load ptr, ptr %28, align 8, !tbaa !5
  %348 = getelementptr inbounds %struct._MatNd, ptr %347, i64 1
  %349 = load ptr, ptr %28, align 8, !tbaa !5
  %350 = getelementptr inbounds %struct._MatNd, ptr %349, i32 0, i32 0
  store ptr %348, ptr %350, align 8, !tbaa !19
  %351 = load i32, ptr %9, align 4, !tbaa !12
  %352 = load ptr, ptr %28, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct._MatNd, ptr %352, i32 0, i32 1
  store i32 %351, ptr %353, align 8, !tbaa !20
  %354 = load ptr, ptr %28, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct._MatNd, ptr %354, i32 0, i32 2
  store i32 1, ptr %355, align 4, !tbaa !21
  %356 = load i32, ptr %34, align 4, !tbaa !12
  %357 = load ptr, ptr %28, align 8, !tbaa !5
  %358 = getelementptr inbounds %struct._MatNd, ptr %357, i32 0, i32 3
  store i32 %356, ptr %358, align 8, !tbaa !16
  %359 = load ptr, ptr %28, align 8, !tbaa !5
  %360 = getelementptr inbounds %struct._MatNd, ptr %359, i32 0, i32 4
  store i8 1, ptr %360, align 4, !tbaa !22
  %361 = load ptr, ptr %28, align 8, !tbaa !5
  %362 = getelementptr inbounds %struct._MatNd, ptr %361, i32 0, i32 0
  %363 = load ptr, ptr %362, align 8, !tbaa !19
  %364 = load i32, ptr %34, align 4, !tbaa !12
  %365 = zext i32 %364 to i64
  %366 = mul i64 %365, 8
  call void @llvm.memset.p0.i64(ptr align 8 %363, i8 0, i64 %366, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #6
  br label %367

367:                                              ; preds = %340, %329
  call void @llvm.lifetime.start.p0(i64 24, ptr %35) #6
  %368 = load i32, ptr %9, align 4, !tbaa !12
  %369 = load ptr, ptr %24, align 8, !tbaa !5
  %370 = call ptr @MatNd_getRowPtr(ptr noundef %369, i32 noundef 0)
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %35, i32 noundef 3, i32 noundef %368, ptr noundef %370)
  call void @llvm.lifetime.start.p0(i64 24, ptr %36) #6
  %371 = load i32, ptr %9, align 4, !tbaa !12
  %372 = load ptr, ptr %24, align 8, !tbaa !5
  %373 = call ptr @MatNd_getRowPtr(ptr noundef %372, i32 noundef 3)
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %36, i32 noundef 3, i32 noundef %371, ptr noundef %373)
  call void @llvm.lifetime.start.p0(i64 24, ptr %37) #6
  %374 = load i32, ptr %9, align 4, !tbaa !12
  %375 = load ptr, ptr %25, align 8, !tbaa !5
  %376 = call ptr @MatNd_getRowPtr(ptr noundef %375, i32 noundef 0)
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %37, i32 noundef 3, i32 noundef %374, ptr noundef %376)
  call void @llvm.lifetime.start.p0(i64 24, ptr %38) #6
  %377 = load i32, ptr %9, align 4, !tbaa !12
  %378 = load ptr, ptr %25, align 8, !tbaa !5
  %379 = call ptr @MatNd_getRowPtr(ptr noundef %378, i32 noundef 3)
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %38, i32 noundef 3, i32 noundef %377, ptr noundef %379)
  %380 = load ptr, ptr %6, align 8, !tbaa !5
  %381 = icmp eq ptr %380, null
  br i1 %381, label %382, label %430

382:                                              ; preds = %367
  %383 = load i32, ptr %9, align 4, !tbaa !12
  %384 = load i32, ptr %9, align 4, !tbaa !12
  %385 = mul nsw i32 %383, %384
  %386 = icmp sgt i32 %385, 1296
  br i1 %386, label %387, label %391

387:                                              ; preds = %382
  %388 = load i32, ptr %9, align 4, !tbaa !12
  %389 = load i32, ptr %9, align 4, !tbaa !12
  %390 = call ptr @MatNd_create(i32 noundef %388, i32 noundef %389)
  store ptr %390, ptr %15, align 8, !tbaa !5
  br label %429

391:                                              ; preds = %382
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #6
  %392 = load i32, ptr %9, align 4, !tbaa !12
  %393 = load i32, ptr %9, align 4, !tbaa !12
  %394 = mul nsw i32 %392, %393
  %395 = icmp eq i32 %394, 0
  br i1 %395, label %396, label %397

396:                                              ; preds = %391
  br label %401

397:                                              ; preds = %391
  %398 = load i32, ptr %9, align 4, !tbaa !12
  %399 = load i32, ptr %9, align 4, !tbaa !12
  %400 = mul nsw i32 %398, %399
  br label %401

401:                                              ; preds = %397, %396
  %402 = phi i32 [ 1, %396 ], [ %400, %397 ]
  store i32 %402, ptr %39, align 4, !tbaa !12
  %403 = load i32, ptr %39, align 4, !tbaa !12
  %404 = zext i32 %403 to i64
  %405 = mul i64 %404, 8
  %406 = add i64 24, %405
  %407 = alloca i8, i64 %406, align 16
  store ptr %407, ptr %15, align 8, !tbaa !5
  %408 = load ptr, ptr %15, align 8, !tbaa !5
  %409 = getelementptr inbounds %struct._MatNd, ptr %408, i64 1
  %410 = load ptr, ptr %15, align 8, !tbaa !5
  %411 = getelementptr inbounds %struct._MatNd, ptr %410, i32 0, i32 0
  store ptr %409, ptr %411, align 8, !tbaa !19
  %412 = load i32, ptr %9, align 4, !tbaa !12
  %413 = load ptr, ptr %15, align 8, !tbaa !5
  %414 = getelementptr inbounds %struct._MatNd, ptr %413, i32 0, i32 1
  store i32 %412, ptr %414, align 8, !tbaa !20
  %415 = load i32, ptr %9, align 4, !tbaa !12
  %416 = load ptr, ptr %15, align 8, !tbaa !5
  %417 = getelementptr inbounds %struct._MatNd, ptr %416, i32 0, i32 2
  store i32 %415, ptr %417, align 4, !tbaa !21
  %418 = load i32, ptr %39, align 4, !tbaa !12
  %419 = load ptr, ptr %15, align 8, !tbaa !5
  %420 = getelementptr inbounds %struct._MatNd, ptr %419, i32 0, i32 3
  store i32 %418, ptr %420, align 8, !tbaa !16
  %421 = load ptr, ptr %15, align 8, !tbaa !5
  %422 = getelementptr inbounds %struct._MatNd, ptr %421, i32 0, i32 4
  store i8 1, ptr %422, align 4, !tbaa !22
  %423 = load ptr, ptr %15, align 8, !tbaa !5
  %424 = getelementptr inbounds %struct._MatNd, ptr %423, i32 0, i32 0
  %425 = load ptr, ptr %424, align 8, !tbaa !19
  %426 = load i32, ptr %39, align 4, !tbaa !12
  %427 = zext i32 %426 to i64
  %428 = mul i64 %427, 8
  call void @llvm.memset.p0.i64(ptr align 8 %425, i8 0, i64 %428, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #6
  br label %429

429:                                              ; preds = %401, %387
  br label %435

430:                                              ; preds = %367
  %431 = load ptr, ptr %15, align 8, !tbaa !5
  %432 = load i32, ptr %9, align 4, !tbaa !12
  %433 = load i32, ptr %9, align 4, !tbaa !12
  call void @MatNd_reshape(ptr noundef %431, i32 noundef %432, i32 noundef %433)
  %434 = load ptr, ptr %15, align 8, !tbaa !5
  call void @MatNd_setZero(ptr noundef %434)
  br label %435

435:                                              ; preds = %430, %429
  %436 = load ptr, ptr %7, align 8, !tbaa !5
  %437 = icmp ne ptr %436, null
  br i1 %437, label %438, label %442

438:                                              ; preds = %435
  %439 = load ptr, ptr %7, align 8, !tbaa !5
  %440 = load i32, ptr %9, align 4, !tbaa !12
  call void @MatNd_reshape(ptr noundef %439, i32 noundef %440, i32 noundef 1)
  %441 = load ptr, ptr %7, align 8, !tbaa !5
  call void @MatNd_setZero(ptr noundef %441)
  br label %442

442:                                              ; preds = %438, %435
  %443 = load ptr, ptr %8, align 8, !tbaa !5
  %444 = icmp ne ptr %443, null
  br i1 %444, label %445, label %449

445:                                              ; preds = %442
  %446 = load ptr, ptr %8, align 8, !tbaa !5
  %447 = load i32, ptr %9, align 4, !tbaa !12
  call void @MatNd_reshape(ptr noundef %446, i32 noundef %447, i32 noundef 1)
  %448 = load ptr, ptr %8, align 8, !tbaa !5
  call void @MatNd_setZero(ptr noundef %448)
  br label %449

449:                                              ; preds = %445, %442
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #6
  %450 = load ptr, ptr %5, align 8, !tbaa !5
  %451 = getelementptr inbounds %struct._RcsGraph, ptr %450, i32 0, i32 0
  %452 = load ptr, ptr %451, align 8, !tbaa !23
  store ptr %452, ptr %40, align 8, !tbaa !5
  br label %453

453:                                              ; preds = %529, %449
  %454 = load ptr, ptr %40, align 8, !tbaa !5
  %455 = icmp ne ptr %454, null
  br i1 %455, label %457, label %456

456:                                              ; preds = %453
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #6
  br label %532

457:                                              ; preds = %453
  %458 = load ptr, ptr %40, align 8, !tbaa !5
  %459 = getelementptr inbounds %struct._RcsBody, ptr %458, i32 0, i32 0
  %460 = load double, ptr %459, align 8, !tbaa !24
  %461 = fcmp oeq double %460, 0.000000e+00
  br i1 %461, label %462, label %463

462:                                              ; preds = %457
  br label %529

463:                                              ; preds = %457
  %464 = load ptr, ptr %40, align 8, !tbaa !5
  %465 = getelementptr inbounds %struct._RcsBody, ptr %464, i32 0, i32 11
  %466 = load ptr, ptr %465, align 8, !tbaa !26
  %467 = getelementptr inbounds %struct.HTr, ptr %466, i32 0, i32 0
  %468 = getelementptr inbounds [3 x double], ptr %467, i64 0, i64 0
  store ptr %468, ptr %14, align 8, !tbaa !5
  %469 = load ptr, ptr %5, align 8, !tbaa !5
  %470 = load ptr, ptr %40, align 8, !tbaa !5
  %471 = load ptr, ptr %14, align 8, !tbaa !5
  call void @RcsGraph_bodyPointJacobian(ptr noundef %469, ptr noundef %470, ptr noundef %471, ptr noundef null, ptr noundef %35)
  %472 = load ptr, ptr %5, align 8, !tbaa !5
  %473 = load ptr, ptr %40, align 8, !tbaa !5
  call void @RcsGraph_rotationJacobian(ptr noundef %472, ptr noundef %473, ptr noundef null, ptr noundef %36)
  %474 = load ptr, ptr %27, align 8, !tbaa !5
  %475 = load ptr, ptr %24, align 8, !tbaa !5
  call void @MatNd_transpose(ptr noundef %474, ptr noundef %475)
  %476 = load ptr, ptr %40, align 8, !tbaa !5
  call void @RcsBody_massMatrix(ptr noundef %476, ptr noundef %18)
  %477 = load ptr, ptr %15, align 8, !tbaa !5
  %478 = load ptr, ptr %24, align 8, !tbaa !5
  call void @MatNd_sqrMulAndAddAtBA(ptr noundef %477, ptr noundef %478, ptr noundef %18)
  %479 = load ptr, ptr %7, align 8, !tbaa !5
  %480 = icmp ne ptr %479, null
  br i1 %480, label %481, label %502

481:                                              ; preds = %463
  %482 = load ptr, ptr %5, align 8, !tbaa !5
  %483 = load ptr, ptr %40, align 8, !tbaa !5
  %484 = load ptr, ptr %14, align 8, !tbaa !5
  %485 = load ptr, ptr %16, align 8, !tbaa !5
  call void @RcsGraph_bodyPointDotJacobian(ptr noundef %482, ptr noundef %483, ptr noundef %484, ptr noundef null, ptr noundef %485, ptr noundef %37)
  %486 = load ptr, ptr %5, align 8, !tbaa !5
  %487 = load ptr, ptr %40, align 8, !tbaa !5
  %488 = load ptr, ptr %16, align 8, !tbaa !5
  call void @RcsGraph_rotationDotJacobian(ptr noundef %486, ptr noundef %487, ptr noundef %488, ptr noundef %38)
  %489 = load ptr, ptr %40, align 8, !tbaa !5
  %490 = load ptr, ptr %40, align 8, !tbaa !5
  %491 = getelementptr inbounds %struct._RcsBody, ptr %490, i32 0, i32 4
  %492 = getelementptr inbounds [3 x double], ptr %491, i64 0, i64 0
  %493 = load ptr, ptr %40, align 8, !tbaa !5
  %494 = getelementptr inbounds %struct._RcsBody, ptr %493, i32 0, i32 3
  %495 = getelementptr inbounds [3 x double], ptr %494, i64 0, i64 0
  call void @RcsBody_HVector(ptr noundef %489, ptr noundef %492, ptr noundef %495, ptr noundef %19)
  %496 = load ptr, ptr %25, align 8, !tbaa !5
  %497 = load ptr, ptr %16, align 8, !tbaa !5
  call void @MatNd_mul(ptr noundef %20, ptr noundef %496, ptr noundef %497)
  call void @MatNd_mul(ptr noundef %21, ptr noundef %18, ptr noundef %20)
  call void @MatNd_addSelf(ptr noundef %21, ptr noundef %19)
  %498 = load ptr, ptr %23, align 8, !tbaa !5
  %499 = load ptr, ptr %27, align 8, !tbaa !5
  call void @MatNd_mul(ptr noundef %498, ptr noundef %499, ptr noundef %21)
  %500 = load ptr, ptr %7, align 8, !tbaa !5
  %501 = load ptr, ptr %23, align 8, !tbaa !5
  call void @MatNd_subSelf(ptr noundef %500, ptr noundef %501)
  br label %502

502:                                              ; preds = %481, %463
  %503 = load ptr, ptr %8, align 8, !tbaa !5
  %504 = icmp ne ptr %503, null
  br i1 %504, label %505, label %517

505:                                              ; preds = %502
  %506 = load ptr, ptr %26, align 8, !tbaa !5
  call void @MatNd_transpose(ptr noundef %506, ptr noundef %35)
  %507 = getelementptr inbounds %struct._MatNd, ptr %22, i32 0, i32 0
  %508 = load ptr, ptr %507, align 8, !tbaa !19
  %509 = load ptr, ptr %40, align 8, !tbaa !5
  %510 = getelementptr inbounds %struct._RcsBody, ptr %509, i32 0, i32 0
  %511 = load double, ptr %510, align 8, !tbaa !24
  %512 = fmul double -9.810000e+00, %511
  call void @Vec3d_set(ptr noundef %508, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %512)
  %513 = load ptr, ptr %28, align 8, !tbaa !5
  %514 = load ptr, ptr %26, align 8, !tbaa !5
  call void @MatNd_mul(ptr noundef %513, ptr noundef %514, ptr noundef %22)
  %515 = load ptr, ptr %8, align 8, !tbaa !5
  %516 = load ptr, ptr %28, align 8, !tbaa !5
  call void @MatNd_addSelf(ptr noundef %515, ptr noundef %516)
  br label %517

517:                                              ; preds = %505, %502
  %518 = load ptr, ptr %40, align 8, !tbaa !5
  %519 = load ptr, ptr %14, align 8, !tbaa !5
  %520 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  call void @RcsGraph_bodyPoint(ptr noundef %518, ptr noundef %519, ptr noundef %520)
  %521 = load ptr, ptr %40, align 8, !tbaa !5
  %522 = getelementptr inbounds %struct._RcsBody, ptr %521, i32 0, i32 0
  %523 = load double, ptr %522, align 8, !tbaa !24
  %524 = fmul double %523, 9.810000e+00
  %525 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 2
  %526 = load double, ptr %525, align 16, !tbaa !13
  %527 = load double, ptr %10, align 8, !tbaa !13
  %528 = call double @llvm.fmuladd.f64(double %524, double %526, double %527)
  store double %528, ptr %10, align 8, !tbaa !13
  br label %529

529:                                              ; preds = %517, %462
  %530 = load ptr, ptr %40, align 8, !tbaa !5
  %531 = call ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef %530)
  store ptr %531, ptr %40, align 8, !tbaa !5
  br label %453, !llvm.loop !27

532:                                              ; preds = %456
  %533 = load ptr, ptr %16, align 8, !tbaa !5
  %534 = load ptr, ptr %15, align 8, !tbaa !5
  call void @MatNd_sqrMulAtBA(ptr noundef %17, ptr noundef %533, ptr noundef %534)
  %535 = load double, ptr %11, align 8, !tbaa !13
  %536 = fmul double %535, 5.000000e-01
  store double %536, ptr %11, align 8, !tbaa !13
  %537 = load ptr, ptr %24, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %537)
  %538 = load ptr, ptr %25, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %538)
  %539 = load ptr, ptr %26, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %539)
  %540 = load ptr, ptr %27, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %540)
  %541 = load ptr, ptr %28, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %541)
  %542 = load ptr, ptr %23, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %542)
  %543 = load ptr, ptr %16, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %543)
  %544 = load ptr, ptr %6, align 8, !tbaa !5
  %545 = icmp eq ptr %544, null
  br i1 %545, label %546, label %548

546:                                              ; preds = %532
  %547 = load ptr, ptr %15, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %547)
  br label %548

548:                                              ; preds = %546, %532
  %549 = load double, ptr %10, align 8, !tbaa !13
  %550 = load double, ptr %11, align 8, !tbaa !13
  %551 = fadd double %549, %550
  call void @llvm.lifetime.end.p0(i64 24, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 504, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret double %551
}

declare ptr @MatNd_clone(ptr noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare void @RcsGraph_stateVectorToIKSelf(ptr noundef, ptr noundef) #3

declare void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8, i32 noundef, i32 noundef, ptr noundef) #3

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

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

declare ptr @MatNd_getRowPtr(ptr noundef, i32 noundef) #3

declare void @MatNd_reshape(ptr noundef, i32 noundef, i32 noundef) #3

declare void @MatNd_setZero(ptr noundef) #3

declare void @RcsGraph_bodyPointJacobian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare void @RcsGraph_rotationJacobian(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare void @MatNd_transpose(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @RcsBody_massMatrix(ptr noundef, ptr noundef) #2

declare void @MatNd_sqrMulAndAddAtBA(ptr noundef, ptr noundef, ptr noundef) #3

declare void @RcsGraph_bodyPointDotJacobian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare void @RcsGraph_rotationDotJacobian(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @RcsBody_HVector(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @MatNd_mul(ptr noundef, ptr noundef, ptr noundef) #3

declare void @MatNd_addSelf(ptr noundef, ptr noundef) #3

declare void @MatNd_subSelf(ptr noundef, ptr noundef) #3

declare void @Vec3d_set(ptr noundef, double noundef, double noundef, double noundef) #3

declare void @RcsGraph_bodyPoint(ptr noundef, ptr noundef, ptr noundef) #3

declare ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef) #3

declare void @MatNd_sqrMulAtBA(ptr noundef, ptr noundef, ptr noundef) #3

declare void @MatNd_destroy(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 1864}
!16 = !{!17, !11, i64 16}
!17 = !{!"_MatNd", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !18, i64 20}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{!17, !6, i64 0}
!20 = !{!17, !11, i64 8}
!21 = !{!17, !11, i64 12}
!22 = !{!17, !18, i64 20}
!23 = !{!10, !6, i64 0}
!24 = !{!25, !14, i64 0}
!25 = !{!"_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}
!26 = !{!25, !6, i64 112}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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

%struct._MatNd = type { ptr, i32, i32, i32, i8 }

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

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

; Function Attrs: mustprogress 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 @RcsGraph_computeKineticTerms(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = alloca double, align 8
  %6 = alloca [63 x double], align 16
  %7 = alloca [3 x double], align 16
  %8 = alloca %struct._MatNd, align 8
  %9 = alloca %struct._MatNd, align 8
  %10 = alloca %struct._MatNd, align 8
  %11 = alloca %struct._MatNd, align 8
  %12 = alloca %struct._MatNd, align 8
  %13 = alloca %struct._MatNd, align 8
  %14 = alloca %struct._MatNd, align 8
  %15 = alloca %struct._MatNd, align 8
  %16 = alloca %struct._MatNd, align 8
  %17 = alloca %struct._MatNd, align 8
  %18 = getelementptr inbounds i8, ptr %0, i64 1852
  %19 = load i32, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  store double 0.000000e+00, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 504, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  %20 = getelementptr inbounds i8, ptr %0, i64 1864
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %23 = load i32, ptr %22, align 8, !tbaa !14
  %24 = icmp ugt i32 %23, 1296
  br i1 %24, label %25, label %27

25:                                               ; preds = %4
  %26 = tail call ptr @MatNd_clone(ptr noundef nonnull %21) #7
  br label %40

27:                                               ; preds = %4
  %28 = shl nuw nsw i32 %23, 3
  %narrow = add nuw nsw i32 %28, 24
  %29 = zext nneg i32 %narrow to i64
  %30 = alloca i8, i64 %29, align 16
  %31 = getelementptr inbounds i8, ptr %30, i64 24
  store ptr %31, ptr %30, align 16, !tbaa !17
  %32 = getelementptr inbounds i8, ptr %21, i64 8
  %33 = getelementptr inbounds i8, ptr %30, i64 8
  %34 = load <2 x i32>, ptr %32, align 8, !tbaa !18
  store <2 x i32> %34, ptr %33, align 8, !tbaa !18
  %35 = getelementptr inbounds i8, ptr %30, i64 16
  store i32 %23, ptr %35, align 16, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %30, i64 20
  store i8 1, ptr %36, align 4, !tbaa !19
  %37 = load ptr, ptr %21, align 8, !tbaa !17
  %38 = shl nuw nsw i32 %23, 3
  %39 = zext nneg i32 %38 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %31, ptr align 8 %37, i64 %39, i1 false)
  br label %40

40:                                               ; preds = %27, %25
  %.0206 = phi ptr [ %26, %25 ], [ %30, %27 ]
  call void @RcsGraph_stateVectorToIKSelf(ptr noundef nonnull %0, ptr noundef %.0206) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %8, i32 noundef 1, i32 noundef 1, ptr noundef nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %9, i32 noundef 6, i32 noundef 6, ptr noundef nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  %41 = getelementptr inbounds i8, ptr %6, i64 288
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %10, i32 noundef 6, i32 noundef 1, ptr noundef nonnull %41) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #7
  %42 = getelementptr inbounds i8, ptr %6, i64 384
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %11, i32 noundef 6, i32 noundef 1, ptr noundef nonnull %42) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #7
  %43 = getelementptr inbounds i8, ptr %6, i64 432
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %12, i32 noundef 6, i32 noundef 1, ptr noundef nonnull %43) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  %44 = getelementptr inbounds i8, ptr %6, i64 480
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %13, i32 noundef 3, i32 noundef 1, ptr noundef nonnull %44) #7
  %45 = icmp sgt i32 %19, 1296
  br i1 %45, label %.thread251, label %46

46:                                               ; preds = %40
  %47 = call i32 @llvm.umax.i32(i32 %19, i32 1)
  %48 = zext i32 %47 to i64
  %49 = shl nuw nsw i64 %48, 3
  %50 = add nuw nsw i64 %49, 24
  %51 = alloca i8, i64 %50, align 16
  %52 = getelementptr inbounds i8, ptr %51, i64 24
  store ptr %52, ptr %51, align 16, !tbaa !17
  %53 = getelementptr inbounds i8, ptr %51, i64 8
  store i32 %19, ptr %53, align 8, !tbaa !20
  %54 = getelementptr inbounds i8, ptr %51, i64 12
  store i32 1, ptr %54, align 4, !tbaa !21
  %55 = getelementptr inbounds i8, ptr %51, i64 16
  store i32 %47, ptr %55, align 16, !tbaa !14
  %56 = getelementptr inbounds i8, ptr %51, i64 20
  store i8 1, ptr %56, align 4, !tbaa !19
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %52, i8 0, i64 %49, i1 false)
  %57 = mul nsw i32 %19, 6
  %58 = icmp sgt i32 %19, 216
  br i1 %58, label %79, label %.thread241

.thread251:                                       ; preds = %40
  %59 = call ptr @MatNd_create(i32 noundef %19, i32 noundef 1) #7
  %60 = call ptr @MatNd_create(i32 noundef 6, i32 noundef %19) #7
  %61 = call ptr @MatNd_create(i32 noundef 6, i32 noundef %19) #7
  br label %107

.thread241:                                       ; preds = %46
  %62 = icmp eq i32 %19, 0
  %63 = select i1 %62, i32 1, i32 %57
  %64 = zext i32 %63 to i64
  %65 = shl nuw nsw i64 %64, 3
  %66 = add nuw nsw i64 %65, 24
  %67 = alloca i8, i64 %66, align 16
  %68 = getelementptr inbounds i8, ptr %67, i64 24
  store ptr %68, ptr %67, align 16, !tbaa !17
  %69 = getelementptr inbounds i8, ptr %67, i64 8
  store i32 6, ptr %69, align 8, !tbaa !20
  %70 = getelementptr inbounds i8, ptr %67, i64 12
  store i32 %19, ptr %70, align 4, !tbaa !21
  %71 = getelementptr inbounds i8, ptr %67, i64 16
  store i32 %63, ptr %71, align 16, !tbaa !14
  %72 = getelementptr inbounds i8, ptr %67, i64 20
  store i8 1, ptr %72, align 4, !tbaa !19
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %68, i8 0, i64 %65, i1 false)
  %73 = alloca i8, i64 %66, align 16
  %74 = getelementptr inbounds i8, ptr %73, i64 24
  store ptr %74, ptr %73, align 16, !tbaa !17
  %75 = getelementptr inbounds i8, ptr %73, i64 8
  store i32 6, ptr %75, align 8, !tbaa !20
  %76 = getelementptr inbounds i8, ptr %73, i64 12
  store i32 %19, ptr %76, align 4, !tbaa !21
  %77 = getelementptr inbounds i8, ptr %73, i64 16
  store i32 %63, ptr %77, align 16, !tbaa !14
  %78 = getelementptr inbounds i8, ptr %73, i64 20
  store i8 1, ptr %78, align 4, !tbaa !19
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %74, i8 0, i64 %65, i1 false)
  br label %83

79:                                               ; preds = %46
  %80 = call ptr @MatNd_create(i32 noundef 6, i32 noundef %19) #7
  %81 = call ptr @MatNd_create(i32 noundef 6, i32 noundef %19) #7
  %82 = icmp ugt i32 %19, 432
  br i1 %82, label %107, label %83

83:                                               ; preds = %79, %.thread241
  %.0209250 = phi ptr [ %73, %.thread241 ], [ %81, %79 ]
  %.0208236246 = phi ptr [ %67, %.thread241 ], [ %80, %79 ]
  %84 = mul nsw i32 %19, 3
  %85 = icmp eq i32 %19, 0
  %86 = select i1 %85, i32 1, i32 %84
  %87 = zext i32 %86 to i64
  %88 = shl nuw nsw i64 %87, 3
  %89 = add nuw nsw i64 %88, 24
  %90 = alloca i8, i64 %89, align 16
  %91 = getelementptr inbounds i8, ptr %90, i64 24
  store ptr %91, ptr %90, align 16, !tbaa !17
  %92 = getelementptr inbounds i8, ptr %90, i64 8
  store i32 %19, ptr %92, align 8, !tbaa !20
  %93 = getelementptr inbounds i8, ptr %90, i64 12
  store i32 3, ptr %93, align 4, !tbaa !21
  %94 = getelementptr inbounds i8, ptr %90, i64 16
  store i32 %86, ptr %94, align 16, !tbaa !14
  %95 = getelementptr inbounds i8, ptr %90, i64 20
  store i8 1, ptr %95, align 4, !tbaa !19
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %91, i8 0, i64 %88, i1 false)
  br i1 %58, label %.thread283, label %.thread267

.thread283:                                       ; preds = %83
  %96 = call ptr @MatNd_create(i32 noundef %19, i32 noundef 6) #7
  br label %114

.thread267:                                       ; preds = %83
  %97 = select i1 %85, i32 1, i32 %57
  %98 = zext i32 %97 to i64
  %99 = shl nuw nsw i64 %98, 3
  %100 = add nuw nsw i64 %99, 24
  %101 = alloca i8, i64 %100, align 16
  %102 = getelementptr inbounds i8, ptr %101, i64 24
  store ptr %102, ptr %101, align 16, !tbaa !17
  %103 = getelementptr inbounds i8, ptr %101, i64 8
  store i32 %19, ptr %103, align 8, !tbaa !20
  %104 = getelementptr inbounds i8, ptr %101, i64 12
  store i32 6, ptr %104, align 4, !tbaa !21
  %105 = getelementptr inbounds i8, ptr %101, i64 16
  store i32 %97, ptr %105, align 16, !tbaa !14
  %106 = getelementptr inbounds i8, ptr %101, i64 20
  store i8 1, ptr %106, align 4, !tbaa !19
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %102, i8 0, i64 %99, i1 false)
  br label %114

107:                                              ; preds = %79, %.thread251
  %108 = phi ptr [ %61, %.thread251 ], [ %81, %79 ]
  %.0207230240253 = phi ptr [ %59, %.thread251 ], [ %51, %79 ]
  %109 = phi ptr [ %60, %.thread251 ], [ %80, %79 ]
  %110 = call ptr @MatNd_create(i32 noundef %19, i32 noundef 3) #7
  %111 = call ptr @MatNd_create(i32 noundef %19, i32 noundef 6) #7
  br i1 %45, label %112, label %._crit_edge292

._crit_edge292:                                   ; preds = %107
  %.pre293 = zext nneg i32 %19 to i64
  %.pre295 = shl nuw nsw i64 %.pre293, 3
  %.pre297 = add nuw nsw i64 %.pre295, 24
  br label %114

112:                                              ; preds = %107
  %113 = call ptr @MatNd_create(i32 noundef %19, i32 noundef 1) #7
  br label %121

114:                                              ; preds = %._crit_edge292, %.thread283, %.thread267
  %.pre-phi298 = phi i64 [ %.pre297, %._crit_edge292 ], [ %50, %.thread283 ], [ %50, %.thread267 ]
  %.pre-phi296 = phi i64 [ %.pre295, %._crit_edge292 ], [ %49, %.thread283 ], [ %49, %.thread267 ]
  %.pre-phi = phi i32 [ %19, %._crit_edge292 ], [ %47, %.thread283 ], [ %47, %.thread267 ]
  %.0211282 = phi ptr [ %111, %._crit_edge292 ], [ %96, %.thread283 ], [ %101, %.thread267 ]
  %.0209249259280 = phi ptr [ %108, %._crit_edge292 ], [ %.0209250, %.thread283 ], [ %.0209250, %.thread267 ]
  %.0207229234247261278 = phi ptr [ %.0207230240253, %._crit_edge292 ], [ %51, %.thread283 ], [ %51, %.thread267 ]
  %.0208236245263276 = phi ptr [ %109, %._crit_edge292 ], [ %.0208236246, %.thread283 ], [ %.0208236246, %.thread267 ]
  %.0212265274 = phi ptr [ %110, %._crit_edge292 ], [ %90, %.thread283 ], [ %90, %.thread267 ]
  %115 = alloca i8, i64 %.pre-phi298, align 16
  %116 = getelementptr inbounds i8, ptr %115, i64 24
  store ptr %116, ptr %115, align 16, !tbaa !17
  %117 = getelementptr inbounds i8, ptr %115, i64 8
  store i32 %19, ptr %117, align 8, !tbaa !20
  %118 = getelementptr inbounds i8, ptr %115, i64 12
  store i32 1, ptr %118, align 4, !tbaa !21
  %119 = getelementptr inbounds i8, ptr %115, i64 16
  store i32 %.pre-phi, ptr %119, align 16, !tbaa !14
  %120 = getelementptr inbounds i8, ptr %115, i64 20
  store i8 1, ptr %120, align 4, !tbaa !19
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %116, i8 0, i64 %.pre-phi296, i1 false)
  br label %121

121:                                              ; preds = %114, %112
  %.0211281 = phi ptr [ %111, %112 ], [ %.0211282, %114 ]
  %.0209249259279 = phi ptr [ %108, %112 ], [ %.0209249259280, %114 ]
  %.0207229234247261277 = phi ptr [ %.0207230240253, %112 ], [ %.0207229234247261278, %114 ]
  %.0208236245263275 = phi ptr [ %109, %112 ], [ %.0208236245263276, %114 ]
  %.0212265273 = phi ptr [ %110, %112 ], [ %.0212265274, %114 ]
  %.0210 = phi ptr [ %113, %112 ], [ %115, %114 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #7
  %122 = call ptr @MatNd_getRowPtr(ptr noundef %.0208236245263275, i32 noundef 0) #7
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %14, i32 noundef 3, i32 noundef %19, ptr noundef %122) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #7
  %123 = call ptr @MatNd_getRowPtr(ptr noundef %.0208236245263275, i32 noundef 3) #7
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %15, i32 noundef 3, i32 noundef %19, ptr noundef %123) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #7
  %124 = call ptr @MatNd_getRowPtr(ptr noundef %.0209249259279, i32 noundef 0) #7
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %16, i32 noundef 3, i32 noundef %19, ptr noundef %124) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #7
  %125 = call ptr @MatNd_getRowPtr(ptr noundef %.0209249259279, i32 noundef 3) #7
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %17, i32 noundef 3, i32 noundef %19, ptr noundef %125) #7
  %126 = icmp eq ptr %1, null
  br i1 %126, label %127, label %144

127:                                              ; preds = %121
  %128 = mul nsw i32 %19, %19
  %129 = icmp ugt i32 %128, 1296
  br i1 %129, label %130, label %132

130:                                              ; preds = %127
  %131 = call ptr @MatNd_create(i32 noundef %19, i32 noundef %19) #7
  br label %145

132:                                              ; preds = %127
  %133 = icmp eq i32 %19, 0
  %134 = select i1 %133, i32 1, i32 %128
  %135 = shl nuw nsw i32 %134, 3
  %136 = zext nneg i32 %135 to i64
  %137 = add nuw nsw i64 %136, 24
  %138 = alloca i8, i64 %137, align 16
  %139 = getelementptr inbounds i8, ptr %138, i64 24
  store ptr %139, ptr %138, align 16, !tbaa !17
  %140 = getelementptr inbounds i8, ptr %138, i64 8
  store i32 %19, ptr %140, align 8, !tbaa !20
  %141 = getelementptr inbounds i8, ptr %138, i64 12
  store i32 %19, ptr %141, align 4, !tbaa !21
  %142 = getelementptr inbounds i8, ptr %138, i64 16
  store i32 %134, ptr %142, align 16, !tbaa !14
  %143 = getelementptr inbounds i8, ptr %138, i64 20
  store i8 1, ptr %143, align 4, !tbaa !19
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %139, i8 0, i64 %136, i1 false)
  br label %145

144:                                              ; preds = %121
  call void @MatNd_reshape(ptr noundef nonnull %1, i32 noundef %19, i32 noundef %19) #7
  call void @MatNd_setZero(ptr noundef nonnull %1) #7
  br label %145

145:                                              ; preds = %130, %132, %144
  %.0205 = phi ptr [ %131, %130 ], [ %138, %132 ], [ %1, %144 ]
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %147, label %146

146:                                              ; preds = %145
  call void @MatNd_reshape(ptr noundef nonnull %2, i32 noundef %19, i32 noundef 1) #7
  call void @MatNd_setZero(ptr noundef nonnull %2) #7
  br label %147

147:                                              ; preds = %146, %145
  %.not226 = icmp eq ptr %3, null
  br i1 %.not226, label %149, label %148

148:                                              ; preds = %147
  call void @MatNd_reshape(ptr noundef nonnull %3, i32 noundef %19, i32 noundef 1) #7
  call void @MatNd_setZero(ptr noundef nonnull %3) #7
  br label %149

149:                                              ; preds = %148, %147
  %150 = load ptr, ptr %0, align 8, !tbaa !22
  %.not227288 = icmp eq ptr %150, null
  br i1 %.not227288, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %149
  %151 = getelementptr inbounds i8, ptr %7, i64 16
  br label %154

._crit_edge:                                      ; preds = %173, %149
  %.0204.lcssa = phi double [ 0.000000e+00, %149 ], [ %.1, %173 ]
  call void @MatNd_sqrMulAtBA(ptr noundef nonnull %8, ptr noundef %.0206, ptr noundef %.0205) #7
  %152 = load double, ptr %5, align 8, !tbaa !11
  %153 = fmul double %152, 5.000000e-01
  store double %153, ptr %5, align 8, !tbaa !11
  call void @MatNd_destroy(ptr noundef %.0208236245263275) #7
  call void @MatNd_destroy(ptr noundef %.0209249259279) #7
  call void @MatNd_destroy(ptr noundef %.0212265273) #7
  call void @MatNd_destroy(ptr noundef %.0211281) #7
  call void @MatNd_destroy(ptr noundef %.0210) #7
  call void @MatNd_destroy(ptr noundef %.0207229234247261277) #7
  call void @MatNd_destroy(ptr noundef %.0206) #7
  br i1 %126, label %175, label %176

154:                                              ; preds = %.lr.ph, %173
  %.0290 = phi ptr [ %150, %.lr.ph ], [ %174, %173 ]
  %.0204289 = phi double [ 0.000000e+00, %.lr.ph ], [ %.1, %173 ]
  %155 = load double, ptr %.0290, align 8, !tbaa !23
  %156 = fcmp oeq double %155, 0.000000e+00
  br i1 %156, label %173, label %157

157:                                              ; preds = %154
  %158 = getelementptr inbounds i8, ptr %.0290, i64 112
  %159 = load ptr, ptr %158, align 8, !tbaa !25
  call void @RcsGraph_bodyPointJacobian(ptr noundef nonnull %0, ptr noundef nonnull %.0290, ptr noundef %159, ptr noundef null, ptr noundef nonnull %14) #7
  call void @RcsGraph_rotationJacobian(ptr noundef nonnull %0, ptr noundef nonnull %.0290, ptr noundef null, ptr noundef nonnull %15) #7
  call void @MatNd_transpose(ptr noundef %.0211281, ptr noundef %.0208236245263275) #7
  call void @RcsBody_massMatrix(ptr noundef nonnull %.0290, ptr noundef nonnull %9)
  call void @MatNd_sqrMulAndAddAtBA(ptr noundef %.0205, ptr noundef %.0208236245263275, ptr noundef nonnull %9) #7
  br i1 %.not, label %163, label %160

160:                                              ; preds = %157
  call void @RcsGraph_bodyPointDotJacobian(ptr noundef nonnull %0, ptr noundef nonnull %.0290, ptr noundef %159, ptr noundef null, ptr noundef %.0206, ptr noundef nonnull %16) #7
  call void @RcsGraph_rotationDotJacobian(ptr noundef nonnull %0, ptr noundef nonnull %.0290, ptr noundef %.0206, ptr noundef nonnull %17) #7
  %161 = getelementptr inbounds i8, ptr %.0290, i64 40
  %162 = getelementptr inbounds i8, ptr %.0290, i64 16
  call void @RcsBody_HVector(ptr noundef nonnull %.0290, ptr noundef nonnull %161, ptr noundef nonnull %162, ptr noundef nonnull %10)
  call void @MatNd_mul(ptr noundef nonnull %11, ptr noundef %.0209249259279, ptr noundef %.0206) #7
  call void @MatNd_mul(ptr noundef nonnull %12, ptr noundef nonnull %9, ptr noundef nonnull %11) #7
  call void @MatNd_addSelf(ptr noundef nonnull %12, ptr noundef nonnull %10) #7
  call void @MatNd_mul(ptr noundef %.0207229234247261277, ptr noundef %.0211281, ptr noundef nonnull %12) #7
  call void @MatNd_subSelf(ptr noundef nonnull %2, ptr noundef %.0207229234247261277) #7
  br label %163

163:                                              ; preds = %160, %157
  br i1 %.not226, label %168, label %164

164:                                              ; preds = %163
  call void @MatNd_transpose(ptr noundef %.0212265273, ptr noundef nonnull %14) #7
  %165 = load ptr, ptr %13, align 8, !tbaa !17
  %166 = load double, ptr %.0290, align 8, !tbaa !23
  %167 = fmul double %166, -9.810000e+00
  call void @Vec3d_set(ptr noundef %165, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %167) #7
  call void @MatNd_mul(ptr noundef %.0210, ptr noundef %.0212265273, ptr noundef nonnull %13) #7
  call void @MatNd_addSelf(ptr noundef nonnull %3, ptr noundef %.0210) #7
  br label %168

168:                                              ; preds = %164, %163
  call void @RcsGraph_bodyPoint(ptr noundef nonnull %.0290, ptr noundef %159, ptr noundef nonnull %7) #7
  %169 = load double, ptr %.0290, align 8, !tbaa !23
  %170 = fmul double %169, 9.810000e+00
  %171 = load double, ptr %151, align 16, !tbaa !11
  %172 = call double @llvm.fmuladd.f64(double %170, double %171, double %.0204289)
  br label %173

173:                                              ; preds = %154, %168
  %.1 = phi double [ %.0204289, %154 ], [ %172, %168 ]
  %174 = call ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef nonnull %.0290) #7
  %.not227 = icmp eq ptr %174, null
  br i1 %.not227, label %._crit_edge, label %154, !llvm.loop !26

175:                                              ; preds = %._crit_edge
  call void @MatNd_destroy(ptr noundef %.0205) #7
  br label %176

176:                                              ; preds = %175, %._crit_edge
  %177 = load double, ptr %5, align 8, !tbaa !11
  %178 = fadd double %.0204.lcssa, %177
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  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 24, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 504, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  ret double %178
}

declare ptr @MatNd_clone(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare void @RcsGraph_stateVectorToIKSelf(ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

declare ptr @MatNd_getRowPtr(ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @MatNd_reshape(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @MatNd_setZero(ptr noundef) local_unnamed_addr #3

declare void @RcsGraph_bodyPointJacobian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @RcsGraph_rotationJacobian(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @MatNd_transpose(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @RcsBody_massMatrix(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @MatNd_sqrMulAndAddAtBA(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @RcsGraph_bodyPointDotJacobian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @RcsGraph_rotationDotJacobian(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @RcsBody_HVector(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @MatNd_mul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @MatNd_addSelf(ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @MatNd_subSelf(ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @Vec3d_set(ptr noundef, double noundef, double noundef, double noundef) local_unnamed_addr #3

declare void @RcsGraph_bodyPoint(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef) local_unnamed_addr #3

declare void @MatNd_sqrMulAtBA(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @MatNd_destroy(ptr noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!12, !12, i64 0}
!12 = !{!"double", !8, i64 0}
!13 = !{!6, !7, i64 1864}
!14 = !{!15, !10, i64 16}
!15 = !{!"_MatNd", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !16, i64 20}
!16 = !{!"_Bool", !8, i64 0}
!17 = !{!15, !7, i64 0}
!18 = !{!10, !10, i64 0}
!19 = !{!15, !16, i64 20}
!20 = !{!15, !10, i64 8}
!21 = !{!15, !10, i64 12}
!22 = !{!6, !7, i64 0}
!23 = !{!24, !12, i64 0}
!24 = !{!"_RcsBody", !12, i64 0, !16, i64 8, !10, i64 12, !8, i64 16, !8, i64 40, !12, 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}
!25 = !{!24, !7, i64 112}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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