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

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

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

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

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

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

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

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

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

declare void @MatNd_destroy(ptr noundef) #2

declare void @MatNd_transposeSelf(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local void @RcsGraph_staticEffortGradient(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #1 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._RcsGraph, ptr %27, i32 0, i32 3
  %29 = load i32, ptr %28, align 4, !tbaa !9
  store i32 %29, ptr %13, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %30 = load i32, ptr %13, align 4, !tbaa !12
  %31 = load i32, ptr %13, align 4, !tbaa !12
  %32 = mul nsw i32 %30, %31
  store i32 %32, ptr %14, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr null, ptr %15, align 8, !tbaa !5
  %33 = load i32, ptr %13, align 4, !tbaa !12
  %34 = mul nsw i32 3, %33
  %35 = icmp sgt i32 %34, 1296
  br i1 %35, label %36, label %39

36:                                               ; preds = %6
  %37 = load i32, ptr %13, align 4, !tbaa !12
  %38 = call ptr @MatNd_create(i32 noundef 3, i32 noundef %37)
  store ptr %38, ptr %15, align 8, !tbaa !5
  br label %74

39:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %40 = load i32, ptr %13, align 4, !tbaa !12
  %41 = mul nsw i32 3, %40
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  br label %47

44:                                               ; preds = %39
  %45 = load i32, ptr %13, align 4, !tbaa !12
  %46 = mul nsw i32 3, %45
  br label %47

47:                                               ; preds = %44, %43
  %48 = phi i32 [ 1, %43 ], [ %46, %44 ]
  store i32 %48, ptr %16, align 4, !tbaa !12
  %49 = load i32, ptr %16, align 4, !tbaa !12
  %50 = zext i32 %49 to i64
  %51 = mul i64 %50, 8
  %52 = add i64 24, %51
  %53 = alloca i8, i64 %52, align 16
  store ptr %53, ptr %15, align 8, !tbaa !5
  %54 = load ptr, ptr %15, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._MatNd, ptr %54, i64 1
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._MatNd, ptr %56, i32 0, i32 0
  store ptr %55, ptr %57, align 8, !tbaa !13
  %58 = load ptr, ptr %15, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._MatNd, ptr %58, i32 0, i32 1
  store i32 3, ptr %59, align 8, !tbaa !16
  %60 = load i32, ptr %13, align 4, !tbaa !12
  %61 = load ptr, ptr %15, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._MatNd, ptr %61, i32 0, i32 2
  store i32 %60, ptr %62, align 4, !tbaa !17
  %63 = load i32, ptr %16, align 4, !tbaa !12
  %64 = load ptr, ptr %15, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._MatNd, ptr %64, i32 0, i32 3
  store i32 %63, ptr %65, align 8, !tbaa !18
  %66 = load ptr, ptr %15, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._MatNd, ptr %66, i32 0, i32 4
  store i8 1, ptr %67, align 4, !tbaa !19
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._MatNd, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !13
  %71 = load i32, ptr %16, align 4, !tbaa !12
  %72 = zext i32 %71 to i64
  %73 = mul i64 %72, 8
  call void @llvm.memset.p0.i64(ptr align 8 %70, i8 0, i64 %73, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %74

74:                                               ; preds = %47, %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr null, ptr %17, align 8, !tbaa !5
  %75 = load i32, ptr %13, align 4, !tbaa !12
  %76 = mul nsw i32 %75, 1
  %77 = icmp sgt i32 %76, 1296
  br i1 %77, label %78, label %81

78:                                               ; preds = %74
  %79 = load i32, ptr %13, align 4, !tbaa !12
  %80 = call ptr @MatNd_create(i32 noundef %79, i32 noundef 1)
  store ptr %80, ptr %17, align 8, !tbaa !5
  br label %116

81:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %82 = load i32, ptr %13, align 4, !tbaa !12
  %83 = mul nsw i32 %82, 1
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %81
  br label %89

86:                                               ; preds = %81
  %87 = load i32, ptr %13, align 4, !tbaa !12
  %88 = mul nsw i32 %87, 1
  br label %89

89:                                               ; preds = %86, %85
  %90 = phi i32 [ 1, %85 ], [ %88, %86 ]
  store i32 %90, ptr %18, align 4, !tbaa !12
  %91 = load i32, ptr %18, align 4, !tbaa !12
  %92 = zext i32 %91 to i64
  %93 = mul i64 %92, 8
  %94 = add i64 24, %93
  %95 = alloca i8, i64 %94, align 16
  store ptr %95, ptr %17, align 8, !tbaa !5
  %96 = load ptr, ptr %17, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._MatNd, ptr %96, i64 1
  %98 = load ptr, ptr %17, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._MatNd, ptr %98, i32 0, i32 0
  store ptr %97, ptr %99, align 8, !tbaa !13
  %100 = load i32, ptr %13, align 4, !tbaa !12
  %101 = load ptr, ptr %17, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._MatNd, ptr %101, i32 0, i32 1
  store i32 %100, ptr %102, align 8, !tbaa !16
  %103 = load ptr, ptr %17, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._MatNd, ptr %103, i32 0, i32 2
  store i32 1, ptr %104, align 4, !tbaa !17
  %105 = load i32, ptr %18, align 4, !tbaa !12
  %106 = load ptr, ptr %17, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._MatNd, ptr %106, i32 0, i32 3
  store i32 %105, ptr %107, align 8, !tbaa !18
  %108 = load ptr, ptr %17, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._MatNd, ptr %108, i32 0, i32 4
  store i8 1, ptr %109, align 4, !tbaa !19
  %110 = load ptr, ptr %17, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._MatNd, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !13
  %113 = load i32, ptr %18, align 4, !tbaa !12
  %114 = zext i32 %113 to i64
  %115 = mul i64 %114, 8
  call void @llvm.memset.p0.i64(ptr align 8 %112, i8 0, i64 %115, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %116

116:                                              ; preds = %89, %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store ptr null, ptr %19, align 8, !tbaa !5
  %117 = load i32, ptr %13, align 4, !tbaa !12
  %118 = mul nsw i32 3, %117
  %119 = load i32, ptr %13, align 4, !tbaa !12
  %120 = mul nsw i32 %118, %119
  %121 = icmp sgt i32 %120, 1296
  br i1 %121, label %122, label %127

122:                                              ; preds = %116
  %123 = load i32, ptr %13, align 4, !tbaa !12
  %124 = mul nsw i32 3, %123
  %125 = load i32, ptr %13, align 4, !tbaa !12
  %126 = call ptr @MatNd_create(i32 noundef %124, i32 noundef %125)
  store ptr %126, ptr %19, align 8, !tbaa !5
  br label %168

127:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %128 = load i32, ptr %13, align 4, !tbaa !12
  %129 = mul nsw i32 3, %128
  %130 = load i32, ptr %13, align 4, !tbaa !12
  %131 = mul nsw i32 %129, %130
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %133, label %134

133:                                              ; preds = %127
  br label %139

134:                                              ; preds = %127
  %135 = load i32, ptr %13, align 4, !tbaa !12
  %136 = mul nsw i32 3, %135
  %137 = load i32, ptr %13, align 4, !tbaa !12
  %138 = mul nsw i32 %136, %137
  br label %139

139:                                              ; preds = %134, %133
  %140 = phi i32 [ 1, %133 ], [ %138, %134 ]
  store i32 %140, ptr %20, align 4, !tbaa !12
  %141 = load i32, ptr %20, align 4, !tbaa !12
  %142 = zext i32 %141 to i64
  %143 = mul i64 %142, 8
  %144 = add i64 24, %143
  %145 = alloca i8, i64 %144, align 16
  store ptr %145, ptr %19, align 8, !tbaa !5
  %146 = load ptr, ptr %19, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._MatNd, ptr %146, i64 1
  %148 = load ptr, ptr %19, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct._MatNd, ptr %148, i32 0, i32 0
  store ptr %147, ptr %149, align 8, !tbaa !13
  %150 = load i32, ptr %13, align 4, !tbaa !12
  %151 = mul nsw i32 3, %150
  %152 = load ptr, ptr %19, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._MatNd, ptr %152, i32 0, i32 1
  store i32 %151, ptr %153, align 8, !tbaa !16
  %154 = load i32, ptr %13, align 4, !tbaa !12
  %155 = load ptr, ptr %19, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._MatNd, ptr %155, i32 0, i32 2
  store i32 %154, ptr %156, align 4, !tbaa !17
  %157 = load i32, ptr %20, align 4, !tbaa !12
  %158 = load ptr, ptr %19, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._MatNd, ptr %158, i32 0, i32 3
  store i32 %157, ptr %159, align 8, !tbaa !18
  %160 = load ptr, ptr %19, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._MatNd, ptr %160, i32 0, i32 4
  store i8 1, ptr %161, align 4, !tbaa !19
  %162 = load ptr, ptr %19, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct._MatNd, ptr %162, i32 0, i32 0
  %164 = load ptr, ptr %163, align 8, !tbaa !13
  %165 = load i32, ptr %20, align 4, !tbaa !12
  %166 = zext i32 %165 to i64
  %167 = mul i64 %166, 8
  call void @llvm.memset.p0.i64(ptr align 8 %164, i8 0, i64 %167, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %168

168:                                              ; preds = %139, %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  store ptr null, ptr %21, align 8, !tbaa !5
  %169 = load i32, ptr %13, align 4, !tbaa !12
  %170 = load i32, ptr %13, align 4, !tbaa !12
  %171 = mul nsw i32 %169, %170
  %172 = icmp sgt i32 %171, 1296
  br i1 %172, label %173, label %177

173:                                              ; preds = %168
  %174 = load i32, ptr %13, align 4, !tbaa !12
  %175 = load i32, ptr %13, align 4, !tbaa !12
  %176 = call ptr @MatNd_create(i32 noundef %174, i32 noundef %175)
  store ptr %176, ptr %21, align 8, !tbaa !5
  br label %215

177:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %178 = load i32, ptr %13, align 4, !tbaa !12
  %179 = load i32, ptr %13, align 4, !tbaa !12
  %180 = mul nsw i32 %178, %179
  %181 = icmp eq i32 %180, 0
  br i1 %181, label %182, label %183

182:                                              ; preds = %177
  br label %187

183:                                              ; preds = %177
  %184 = load i32, ptr %13, align 4, !tbaa !12
  %185 = load i32, ptr %13, align 4, !tbaa !12
  %186 = mul nsw i32 %184, %185
  br label %187

187:                                              ; preds = %183, %182
  %188 = phi i32 [ 1, %182 ], [ %186, %183 ]
  store i32 %188, ptr %22, align 4, !tbaa !12
  %189 = load i32, ptr %22, align 4, !tbaa !12
  %190 = zext i32 %189 to i64
  %191 = mul i64 %190, 8
  %192 = add i64 24, %191
  %193 = alloca i8, i64 %192, align 16
  store ptr %193, ptr %21, align 8, !tbaa !5
  %194 = load ptr, ptr %21, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct._MatNd, ptr %194, i64 1
  %196 = load ptr, ptr %21, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct._MatNd, ptr %196, i32 0, i32 0
  store ptr %195, ptr %197, align 8, !tbaa !13
  %198 = load i32, ptr %13, align 4, !tbaa !12
  %199 = load ptr, ptr %21, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct._MatNd, ptr %199, i32 0, i32 1
  store i32 %198, ptr %200, align 8, !tbaa !16
  %201 = load i32, ptr %13, align 4, !tbaa !12
  %202 = load ptr, ptr %21, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct._MatNd, ptr %202, i32 0, i32 2
  store i32 %201, ptr %203, align 4, !tbaa !17
  %204 = load i32, ptr %22, align 4, !tbaa !12
  %205 = load ptr, ptr %21, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct._MatNd, ptr %205, i32 0, i32 3
  store i32 %204, ptr %206, align 8, !tbaa !18
  %207 = load ptr, ptr %21, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct._MatNd, ptr %207, i32 0, i32 4
  store i8 1, ptr %208, align 4, !tbaa !19
  %209 = load ptr, ptr %21, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct._MatNd, ptr %209, i32 0, i32 0
  %211 = load ptr, ptr %210, align 8, !tbaa !13
  %212 = load i32, ptr %22, align 4, !tbaa !12
  %213 = zext i32 %212 to i64
  %214 = mul i64 %213, 8
  call void @llvm.memset.p0.i64(ptr align 8 %211, i8 0, i64 %214, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %215

215:                                              ; preds = %187, %173
  %216 = load ptr, ptr %7, align 8, !tbaa !5
  %217 = load ptr, ptr %8, align 8, !tbaa !5
  %218 = load ptr, ptr %11, align 8, !tbaa !5
  %219 = load ptr, ptr %15, align 8, !tbaa !5
  call void @RcsGraph_bodyPointJacobian(ptr noundef %216, ptr noundef %217, ptr noundef %218, ptr noundef null, ptr noundef %219)
  %220 = load ptr, ptr %15, align 8, !tbaa !5
  call void @MatNd_transposeSelf(ptr noundef %220)
  %221 = load ptr, ptr %17, align 8, !tbaa !5
  %222 = load ptr, ptr %15, align 8, !tbaa !5
  %223 = load ptr, ptr %9, align 8, !tbaa !5
  call void @MatNd_mul(ptr noundef %221, ptr noundef %222, ptr noundef %223)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %224 = load i32, ptr %14, align 4, !tbaa !12
  store i32 %224, ptr %24, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %225 = load i32, ptr %14, align 4, !tbaa !12
  %226 = mul nsw i32 2, %225
  store i32 %226, ptr %25, align 4, !tbaa !12
  %227 = load ptr, ptr %7, align 8, !tbaa !5
  %228 = load ptr, ptr %8, align 8, !tbaa !5
  %229 = load ptr, ptr %11, align 8, !tbaa !5
  %230 = load ptr, ptr %19, align 8, !tbaa !5
  call void @RcsGraph_bodyPointHessian(ptr noundef %227, ptr noundef %228, ptr noundef %229, ptr noundef null, ptr noundef %230)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !12
  br label %231

231:                                              ; preds = %303, %215
  %232 = load i32, ptr %26, align 4, !tbaa !12
  %233 = load i32, ptr %14, align 4, !tbaa !12
  %234 = icmp slt i32 %232, %233
  br i1 %234, label %236, label %235

235:                                              ; preds = %231
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %306

236:                                              ; preds = %231
  %237 = load ptr, ptr %9, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct._MatNd, ptr %237, i32 0, i32 0
  %239 = load ptr, ptr %238, align 8, !tbaa !13
  %240 = getelementptr inbounds double, ptr %239, i64 0
  %241 = load double, ptr %240, align 8, !tbaa !20
  %242 = load ptr, ptr %19, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct._MatNd, ptr %242, i32 0, i32 0
  %244 = load ptr, ptr %243, align 8, !tbaa !13
  %245 = load i32, ptr %23, align 4, !tbaa !12
  %246 = load i32, ptr %26, align 4, !tbaa !12
  %247 = add nsw i32 %245, %246
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds double, ptr %244, i64 %248
  %250 = load double, ptr %249, align 8, !tbaa !20
  %251 = load ptr, ptr %21, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct._MatNd, ptr %251, i32 0, i32 0
  %253 = load ptr, ptr %252, align 8, !tbaa !13
  %254 = load i32, ptr %26, align 4, !tbaa !12
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds double, ptr %253, i64 %255
  %257 = load double, ptr %256, align 8, !tbaa !20
  %258 = call double @llvm.fmuladd.f64(double %241, double %250, double %257)
  store double %258, ptr %256, align 8, !tbaa !20
  %259 = load ptr, ptr %9, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct._MatNd, ptr %259, i32 0, i32 0
  %261 = load ptr, ptr %260, align 8, !tbaa !13
  %262 = getelementptr inbounds double, ptr %261, i64 1
  %263 = load double, ptr %262, align 8, !tbaa !20
  %264 = load ptr, ptr %19, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct._MatNd, ptr %264, i32 0, i32 0
  %266 = load ptr, ptr %265, align 8, !tbaa !13
  %267 = load i32, ptr %24, align 4, !tbaa !12
  %268 = load i32, ptr %26, align 4, !tbaa !12
  %269 = add nsw i32 %267, %268
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds double, ptr %266, i64 %270
  %272 = load double, ptr %271, align 8, !tbaa !20
  %273 = load ptr, ptr %21, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct._MatNd, ptr %273, i32 0, i32 0
  %275 = load ptr, ptr %274, align 8, !tbaa !13
  %276 = load i32, ptr %26, align 4, !tbaa !12
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds double, ptr %275, i64 %277
  %279 = load double, ptr %278, align 8, !tbaa !20
  %280 = call double @llvm.fmuladd.f64(double %263, double %272, double %279)
  store double %280, ptr %278, align 8, !tbaa !20
  %281 = load ptr, ptr %9, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct._MatNd, ptr %281, i32 0, i32 0
  %283 = load ptr, ptr %282, align 8, !tbaa !13
  %284 = getelementptr inbounds double, ptr %283, i64 2
  %285 = load double, ptr %284, align 8, !tbaa !20
  %286 = load ptr, ptr %19, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct._MatNd, ptr %286, i32 0, i32 0
  %288 = load ptr, ptr %287, align 8, !tbaa !13
  %289 = load i32, ptr %25, align 4, !tbaa !12
  %290 = load i32, ptr %26, align 4, !tbaa !12
  %291 = add nsw i32 %289, %290
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds double, ptr %288, i64 %292
  %294 = load double, ptr %293, align 8, !tbaa !20
  %295 = load ptr, ptr %21, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct._MatNd, ptr %295, i32 0, i32 0
  %297 = load ptr, ptr %296, align 8, !tbaa !13
  %298 = load i32, ptr %26, align 4, !tbaa !12
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds double, ptr %297, i64 %299
  %301 = load double, ptr %300, align 8, !tbaa !20
  %302 = call double @llvm.fmuladd.f64(double %285, double %294, double %301)
  store double %302, ptr %300, align 8, !tbaa !20
  br label %303

303:                                              ; preds = %236
  %304 = load i32, ptr %26, align 4, !tbaa !12
  %305 = add nsw i32 %304, 1
  store i32 %305, ptr %26, align 4, !tbaa !12
  br label %231, !llvm.loop !22

306:                                              ; preds = %235
  %307 = load ptr, ptr %10, align 8, !tbaa !5
  %308 = icmp ne ptr %307, null
  br i1 %308, label %309, label %312

309:                                              ; preds = %306
  %310 = load ptr, ptr %21, align 8, !tbaa !5
  %311 = load ptr, ptr %10, align 8, !tbaa !5
  call void @MatNd_preMulDiagSelf(ptr noundef %310, ptr noundef %311)
  br label %312

312:                                              ; preds = %309, %306
  %313 = load ptr, ptr %12, align 8, !tbaa !5
  %314 = load ptr, ptr %21, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct._MatNd, ptr %314, i32 0, i32 1
  %316 = load i32, ptr %315, align 8, !tbaa !16
  %317 = load ptr, ptr %17, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct._MatNd, ptr %317, i32 0, i32 2
  %319 = load i32, ptr %318, align 4, !tbaa !17
  call void @MatNd_reshape(ptr noundef %313, i32 noundef %316, i32 noundef %319)
  %320 = load ptr, ptr %12, align 8, !tbaa !5
  %321 = load ptr, ptr %21, align 8, !tbaa !5
  %322 = load ptr, ptr %17, align 8, !tbaa !5
  call void @MatNd_mul(ptr noundef %320, ptr noundef %321, ptr noundef %322)
  %323 = load ptr, ptr %12, align 8, !tbaa !5
  call void @MatNd_transposeSelf(ptr noundef %323)
  %324 = load ptr, ptr %15, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %324)
  %325 = load ptr, ptr %17, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %325)
  %326 = load ptr, ptr %19, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %326)
  %327 = load ptr, ptr %21, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %327)
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  ret void
}

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 1852}
!10 = !{!"_RcsGraph", !6, i64 0, !7, i64 8, !11, i64 1848, !11, i64 1852, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_MatNd", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !15, i64 20}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!14, !11, i64 8}
!17 = !{!14, !11, i64 12}
!18 = !{!14, !11, i64 16}
!19 = !{!14, !15, i64 20}
!20 = !{!21, !21, i64 0}
!21 = !{!"double", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"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"

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

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

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

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

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

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

declare void @MatNd_destroy(ptr noundef) local_unnamed_addr #1

declare void @MatNd_transposeSelf(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @RcsGraph_staticEffortGradient(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #0 {
  %7 = getelementptr inbounds i8, ptr %0, i64 1852
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = mul i32 %8, %8
  %10 = mul nsw i32 %8, 3
  %11 = icmp sgt i32 %8, 432
  br i1 %11, label %23, label %.thread

.thread:                                          ; preds = %6
  %12 = icmp eq i32 %8, 0
  %13 = select i1 %12, i32 1, i32 %10
  %14 = zext i32 %13 to i64
  %15 = shl nuw nsw i64 %14, 3
  %16 = add nuw nsw i64 %15, 24
  %17 = alloca i8, i64 %16, align 16
  %18 = getelementptr inbounds i8, ptr %17, i64 24
  store ptr %18, ptr %17, align 16, !tbaa !11
  %19 = getelementptr inbounds i8, ptr %17, i64 8
  store i32 3, ptr %19, align 8, !tbaa !14
  %20 = getelementptr inbounds i8, ptr %17, i64 12
  store i32 %8, ptr %20, align 4, !tbaa !15
  %21 = getelementptr inbounds i8, ptr %17, i64 16
  store i32 %13, ptr %21, align 16, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %17, i64 20
  store i8 1, ptr %22, align 4, !tbaa !17
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %18, i8 0, i64 %15, i1 false)
  br label %28

23:                                               ; preds = %6
  %24 = tail call ptr @MatNd_create(i32 noundef 3, i32 noundef %8) #5
  %25 = icmp ugt i32 %8, 1296
  br i1 %25, label %26, label %28

26:                                               ; preds = %23
  %27 = tail call ptr @MatNd_create(i32 noundef %8, i32 noundef 1) #5
  br label %39

28:                                               ; preds = %.thread, %23
  %.0121133 = phi ptr [ %17, %.thread ], [ %24, %23 ]
  %29 = call i32 @llvm.umax.i32(i32 %8, i32 1)
  %30 = zext i32 %29 to i64
  %31 = shl nuw nsw i64 %30, 3
  %32 = add nuw nsw i64 %31, 24
  %33 = alloca i8, i64 %32, align 16
  %34 = getelementptr inbounds i8, ptr %33, i64 24
  store ptr %34, ptr %33, align 16, !tbaa !11
  %35 = getelementptr inbounds i8, ptr %33, i64 8
  store i32 %8, ptr %35, align 8, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %33, i64 12
  store i32 1, ptr %36, align 4, !tbaa !15
  %37 = getelementptr inbounds i8, ptr %33, i64 16
  store i32 %29, ptr %37, align 16, !tbaa !16
  %38 = getelementptr inbounds i8, ptr %33, i64 20
  store i8 1, ptr %38, align 4, !tbaa !17
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %34, i8 0, i64 %31, i1 false)
  br label %39

39:                                               ; preds = %28, %26
  %.0121132 = phi ptr [ %24, %26 ], [ %.0121133, %28 ]
  %.0122 = phi ptr [ %27, %26 ], [ %33, %28 ]
  %40 = mul nsw i32 %10, %8
  %41 = icmp sgt i32 %40, 1296
  br i1 %41, label %42, label %44

42:                                               ; preds = %39
  %43 = call ptr @MatNd_create(i32 noundef %10, i32 noundef %8) #5
  br label %55

44:                                               ; preds = %39
  %45 = call i32 @llvm.umax.i32(i32 %40, i32 1)
  %46 = zext i32 %45 to i64
  %47 = shl nuw nsw i64 %46, 3
  %48 = add nuw nsw i64 %47, 24
  %49 = alloca i8, i64 %48, align 16
  %50 = getelementptr inbounds i8, ptr %49, i64 24
  store ptr %50, ptr %49, align 16, !tbaa !11
  %51 = getelementptr inbounds i8, ptr %49, i64 8
  store i32 %10, ptr %51, align 8, !tbaa !14
  %52 = getelementptr inbounds i8, ptr %49, i64 12
  store i32 %8, ptr %52, align 4, !tbaa !15
  %53 = getelementptr inbounds i8, ptr %49, i64 16
  store i32 %45, ptr %53, align 16, !tbaa !16
  %54 = getelementptr inbounds i8, ptr %49, i64 20
  store i8 1, ptr %54, align 4, !tbaa !17
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %50, i8 0, i64 %47, i1 false)
  br label %55

55:                                               ; preds = %44, %42
  %.0123 = phi ptr [ %43, %42 ], [ %49, %44 ]
  %56 = icmp ugt i32 %9, 1296
  br i1 %56, label %57, label %59

57:                                               ; preds = %55
  %58 = call ptr @MatNd_create(i32 noundef %8, i32 noundef %8) #5
  br label %71

59:                                               ; preds = %55
  %60 = icmp eq i32 %8, 0
  %61 = select i1 %60, i32 1, i32 %9
  %62 = shl nuw nsw i32 %61, 3
  %63 = zext nneg i32 %62 to i64
  %64 = add nuw nsw i64 %63, 24
  %65 = alloca i8, i64 %64, align 16
  %66 = getelementptr inbounds i8, ptr %65, i64 24
  store ptr %66, ptr %65, align 16, !tbaa !11
  %67 = getelementptr inbounds i8, ptr %65, i64 8
  store i32 %8, ptr %67, align 8, !tbaa !14
  %68 = getelementptr inbounds i8, ptr %65, i64 12
  store i32 %8, ptr %68, align 4, !tbaa !15
  %69 = getelementptr inbounds i8, ptr %65, i64 16
  store i32 %61, ptr %69, align 16, !tbaa !16
  %70 = getelementptr inbounds i8, ptr %65, i64 20
  store i8 1, ptr %70, align 4, !tbaa !17
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %66, i8 0, i64 %63, i1 false)
  br label %71

71:                                               ; preds = %59, %57
  %.0124 = phi ptr [ %58, %57 ], [ %65, %59 ]
  call void @RcsGraph_bodyPointJacobian(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %4, ptr noundef null, ptr noundef %.0121132)
  call void @MatNd_transposeSelf(ptr noundef %.0121132) #5
  call void @MatNd_mul(ptr noundef %.0122, ptr noundef %.0121132, ptr noundef %2) #5
  call void @RcsGraph_bodyPointHessian(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %4, ptr noundef null, ptr noundef %.0123)
  %.not135 = icmp eq i32 %8, 0
  br i1 %.not135, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %71
  %72 = shl nuw nsw i32 %9, 1
  %73 = load ptr, ptr %2, align 8, !tbaa !11
  %74 = load ptr, ptr %.0123, align 8, !tbaa !11
  %75 = load ptr, ptr %.0124, align 8, !tbaa !11
  %76 = getelementptr inbounds i8, ptr %73, i64 8
  %77 = getelementptr inbounds i8, ptr %73, i64 16
  %78 = zext i32 %9 to i64
  %79 = zext nneg i32 %72 to i64
  %umax = call i32 @llvm.umax.i32(i32 %9, i32 1)
  %wide.trip.count = zext i32 %umax to i64
  %invariant.gep = getelementptr inbounds double, ptr %74, i64 %78
  %invariant.gep137 = getelementptr inbounds double, ptr %74, i64 %79
  %min.iters.check = icmp ult i32 %9, 10
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.memcheck:                                  ; preds = %.lr.ph
  %80 = shl nuw nsw i64 %wide.trip.count, 3
  %scevgep = getelementptr i8, ptr %75, i64 %80
  %scevgep139 = getelementptr i8, ptr %73, i64 24
  %81 = add nuw nsw i64 %wide.trip.count, %79
  %82 = shl nuw nsw i64 %81, 3
  %scevgep140 = getelementptr i8, ptr %74, i64 %82
  %83 = add nuw nsw i64 %wide.trip.count, %78
  %84 = shl nuw nsw i64 %83, 3
  %scevgep141 = getelementptr i8, ptr %74, i64 %84
  %scevgep142 = getelementptr i8, ptr %74, i64 %80
  %85 = insertelement <4 x ptr> poison, ptr %75, i64 0
  %86 = shufflevector <4 x ptr> %85, <4 x ptr> poison, <4 x i32> zeroinitializer
  %87 = insertelement <4 x ptr> poison, ptr %scevgep139, i64 0
  %88 = insertelement <4 x ptr> %87, ptr %scevgep140, i64 1
  %89 = insertelement <4 x ptr> %88, ptr %scevgep141, i64 2
  %90 = insertelement <4 x ptr> %89, ptr %scevgep142, i64 3
  %91 = icmp ult <4 x ptr> %86, %90
  %92 = insertelement <4 x ptr> poison, ptr %73, i64 0
  %93 = insertelement <4 x ptr> %92, ptr %invariant.gep137, i64 1
  %94 = insertelement <4 x ptr> %93, ptr %invariant.gep, i64 2
  %95 = insertelement <4 x ptr> %94, ptr %74, i64 3
  %96 = insertelement <4 x ptr> poison, ptr %scevgep, i64 0
  %97 = shufflevector <4 x ptr> %96, <4 x ptr> poison, <4 x i32> zeroinitializer
  %98 = icmp ult <4 x ptr> %95, %97
  %99 = and <4 x i1> %91, %98
  %100 = bitcast <4 x i1> %99 to i4
  %.not161 = icmp eq i4 %100, 0
  br i1 %.not161, label %vector.ph, label %scalar.ph.preheader

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 4294967294
  %101 = load double, ptr %73, align 8, !tbaa !18, !alias.scope !20
  %broadcast.splatinsert = insertelement <2 x double> poison, double %101, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  %102 = load double, ptr %76, align 8, !tbaa !18, !alias.scope !20
  %broadcast.splatinsert156 = insertelement <2 x double> poison, double %102, i64 0
  %broadcast.splat157 = shufflevector <2 x double> %broadcast.splatinsert156, <2 x double> poison, <2 x i32> zeroinitializer
  %103 = load double, ptr %77, align 8, !tbaa !18, !alias.scope !20
  %broadcast.splatinsert159 = insertelement <2 x double> poison, double %103, i64 0
  %broadcast.splat160 = shufflevector <2 x double> %broadcast.splatinsert159, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %104 = getelementptr inbounds double, ptr %74, i64 %index
  %wide.load = load <2 x double>, ptr %104, align 8, !tbaa !18, !alias.scope !23
  %105 = getelementptr inbounds double, ptr %75, i64 %index
  %wide.load154 = load <2 x double>, ptr %105, align 8, !tbaa !18, !alias.scope !25, !noalias !27
  %106 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load, <2 x double> %wide.load154)
  store <2 x double> %106, ptr %105, align 8, !tbaa !18, !alias.scope !25, !noalias !27
  %107 = getelementptr inbounds double, ptr %invariant.gep, i64 %index
  %wide.load155 = load <2 x double>, ptr %107, align 8, !tbaa !18, !alias.scope !30
  %108 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat157, <2 x double> %wide.load155, <2 x double> %106)
  store <2 x double> %108, ptr %105, align 8, !tbaa !18, !alias.scope !25, !noalias !27
  %109 = getelementptr inbounds double, ptr %invariant.gep137, i64 %index
  %wide.load158 = load <2 x double>, ptr %109, align 8, !tbaa !18, !alias.scope !31
  %110 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat160, <2 x double> %wide.load158, <2 x double> %108)
  store <2 x double> %110, ptr %105, align 8, !tbaa !18, !alias.scope !25, !noalias !27
  %index.next = add nuw i64 %index, 2
  %111 = icmp eq i64 %index.next, %n.vec
  br i1 %111, label %middle.block, label %vector.body, !llvm.loop !32

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %71
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %125, label %124

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %112 = load double, ptr %73, align 8, !tbaa !18
  %113 = getelementptr inbounds double, ptr %74, i64 %indvars.iv
  %114 = load double, ptr %113, align 8, !tbaa !18
  %115 = getelementptr inbounds double, ptr %75, i64 %indvars.iv
  %116 = load double, ptr %115, align 8, !tbaa !18
  %117 = call double @llvm.fmuladd.f64(double %112, double %114, double %116)
  store double %117, ptr %115, align 8, !tbaa !18
  %118 = load double, ptr %76, align 8, !tbaa !18
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv
  %119 = load double, ptr %gep, align 8, !tbaa !18
  %120 = call double @llvm.fmuladd.f64(double %118, double %119, double %117)
  store double %120, ptr %115, align 8, !tbaa !18
  %121 = load double, ptr %77, align 8, !tbaa !18
  %gep138 = getelementptr inbounds double, ptr %invariant.gep137, i64 %indvars.iv
  %122 = load double, ptr %gep138, align 8, !tbaa !18
  %123 = call double @llvm.fmuladd.f64(double %121, double %122, double %120)
  store double %123, ptr %115, align 8, !tbaa !18
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !36

124:                                              ; preds = %._crit_edge
  call void @MatNd_preMulDiagSelf(ptr noundef %.0124, ptr noundef nonnull %3) #5
  br label %125

125:                                              ; preds = %124, %._crit_edge
  %126 = getelementptr inbounds i8, ptr %.0124, i64 8
  %127 = load i32, ptr %126, align 8, !tbaa !14
  %128 = getelementptr inbounds i8, ptr %.0122, i64 12
  %129 = load i32, ptr %128, align 4, !tbaa !15
  call void @MatNd_reshape(ptr noundef %5, i32 noundef %127, i32 noundef %129) #5
  call void @MatNd_mul(ptr noundef %5, ptr noundef %.0124, ptr noundef %.0122) #5
  call void @MatNd_transposeSelf(ptr noundef %5) #5
  call void @MatNd_destroy(ptr noundef %.0121132) #5
  call void @MatNd_destroy(ptr noundef %.0122) #5
  call void @MatNd_destroy(ptr noundef %.0123) #5
  call void @MatNd_destroy(ptr noundef %.0124) #5
  ret void
}

declare void @MatNd_preMulDiagSelf(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 1852}
!6 = !{!"_RcsGraph", !7, i64 0, !8, i64 8, !10, i64 1848, !10, i64 1852, !7, i64 1856, !7, i64 1864, !7, i64 1872, !7, i64 1880, !7, i64 1888}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"_MatNd", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 20}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !10, i64 12}
!16 = !{!12, !10, i64 16}
!17 = !{!12, !13, i64 20}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !8, i64 0}
!20 = !{!21}
!21 = distinct !{!21, !22}
!22 = distinct !{!22, !"LVerDomain"}
!23 = !{!24}
!24 = distinct !{!24, !22}
!25 = !{!26}
!26 = distinct !{!26, !22}
!27 = !{!21, !28, !29, !24}
!28 = distinct !{!28, !22}
!29 = distinct !{!29, !22}
!30 = !{!29}
!31 = !{!28}
!32 = distinct !{!32, !33, !34, !35}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!"llvm.loop.isvectorized", i32 1}
!35 = !{!"llvm.loop.unroll.runtime.disable"}
!36 = distinct !{!36, !33, !34}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass