; 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._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 }

@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [43 x i8], align 1
@__func__.Rcs_directDynamics = external hidden unnamed_addr constant [19 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [33 x i8], align 1
@RCS_GLOBAL_RLOG_CB = external global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [66 x i8], align 1
@RcsLogLevel = external global i32, align 4
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #0

declare void @print_trace() #1

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

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

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

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

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

declare void @MatNd_setZero(ptr noundef) #1

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

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

declare void @MatNd_destroy(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local double @Rcs_directDynamics(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #3 {
  %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 ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca ptr, align 8
  %21 = alloca double, 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
  br label %22

22:                                               ; preds = %4
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %28, label %25

25:                                               ; preds = %22
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.6, ptr noundef @.str.1, ptr noundef @__func__.Rcs_directDynamics, i32 noundef 678, ptr noundef @.str.7) #7
  call void @print_trace()
  call void @abort() #8
  unreachable

28:                                               ; preds = %22
  br label %29

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._RcsGraph, ptr %30, i32 0, i32 3
  %32 = load i32, ptr %31, align 4, !tbaa !9
  store i32 %32, ptr %9, align 4, !tbaa !12
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %66

35:                                               ; preds = %29
  br label %36

36:                                               ; preds = %35
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._MatNd, ptr %37, i32 0, i32 1
  %39 = load i32, ptr %38, align 8, !tbaa !13
  %40 = load i32, ptr %9, align 4, !tbaa !12
  %41 = icmp eq i32 %39, %40
  br i1 %41, label %42, label %47

42:                                               ; preds = %36
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._MatNd, ptr %43, i32 0, i32 2
  %45 = load i32, ptr %44, align 4, !tbaa !16
  %46 = icmp eq i32 %45, 1
  br i1 %46, label %50, label %47

47:                                               ; preds = %42, %36
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str.6, ptr noundef @.str.1, ptr noundef @__func__.Rcs_directDynamics, i32 noundef 683, ptr noundef @.str.8) #7
  call void @print_trace()
  call void @abort() #8
  unreachable

50:                                               ; preds = %42
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = call zeroext i1 @MatNd_isFinite(ptr noundef %53)
  br i1 %54, label %65, label %55

55:                                               ; preds = %52
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.9, ptr noundef %56, i32 noundef 5)
  br label %57

57:                                               ; preds = %55
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.10, ptr noundef @.str.1, ptr noundef @__func__.Rcs_directDynamics, i32 noundef 688) #7
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef @.str.11) #7
  %62 = call i32 @getchar()
  br label %63

63:                                               ; preds = %57
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64, %52
  br label %66

66:                                               ; preds = %65, %29
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %100

69:                                               ; preds = %66
  br label %70

70:                                               ; preds = %69
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._MatNd, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 8, !tbaa !13
  %74 = load i32, ptr %9, align 4, !tbaa !12
  %75 = icmp eq i32 %73, %74
  br i1 %75, label %76, label %81

76:                                               ; preds = %70
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._MatNd, ptr %77, i32 0, i32 2
  %79 = load i32, ptr %78, align 4, !tbaa !16
  %80 = icmp eq i32 %79, 1
  br i1 %80, label %84, label %81

81:                                               ; preds = %76, %70
  %82 = load ptr, ptr @stderr, align 8, !tbaa !5
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.6, ptr noundef @.str.1, ptr noundef @__func__.Rcs_directDynamics, i32 noundef 694, ptr noundef @.str.12) #7
  call void @print_trace()
  call void @abort() #8
  unreachable

84:                                               ; preds = %76
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = call zeroext i1 @MatNd_isFinite(ptr noundef %87)
  br i1 %88, label %99, label %89

89:                                               ; preds = %86
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.13, ptr noundef %90, i32 noundef 5)
  br label %91

91:                                               ; preds = %89
  %92 = load ptr, ptr @stderr, align 8, !tbaa !5
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef @.str.10, ptr noundef @.str.1, ptr noundef @__func__.Rcs_directDynamics, i32 noundef 699) #7
  %94 = load ptr, ptr @stderr, align 8, !tbaa !5
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef @.str.14) #7
  %96 = call i32 @getchar()
  br label %97

97:                                               ; preds = %91
  br label %98

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98, %86
  br label %100

100:                                              ; preds = %99, %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store ptr null, ptr %10, align 8, !tbaa !5
  %101 = load i32, ptr %9, align 4, !tbaa !12
  %102 = load i32, ptr %9, align 4, !tbaa !12
  %103 = mul nsw i32 %101, %102
  %104 = icmp sgt i32 %103, 1296
  br i1 %104, label %105, label %109

105:                                              ; preds = %100
  %106 = load i32, ptr %9, align 4, !tbaa !12
  %107 = load i32, ptr %9, align 4, !tbaa !12
  %108 = call ptr @MatNd_create(i32 noundef %106, i32 noundef %107)
  store ptr %108, ptr %10, align 8, !tbaa !5
  br label %147

109:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %110 = load i32, ptr %9, align 4, !tbaa !12
  %111 = load i32, ptr %9, align 4, !tbaa !12
  %112 = mul nsw i32 %110, %111
  %113 = icmp eq i32 %112, 0
  br i1 %113, label %114, label %115

114:                                              ; preds = %109
  br label %119

115:                                              ; preds = %109
  %116 = load i32, ptr %9, align 4, !tbaa !12
  %117 = load i32, ptr %9, align 4, !tbaa !12
  %118 = mul nsw i32 %116, %117
  br label %119

119:                                              ; preds = %115, %114
  %120 = phi i32 [ 1, %114 ], [ %118, %115 ]
  store i32 %120, ptr %11, align 4, !tbaa !12
  %121 = load i32, ptr %11, align 4, !tbaa !12
  %122 = zext i32 %121 to i64
  %123 = mul i64 %122, 8
  %124 = add i64 24, %123
  %125 = alloca i8, i64 %124, align 16
  store ptr %125, ptr %10, align 8, !tbaa !5
  %126 = load ptr, ptr %10, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._MatNd, ptr %126, i64 1
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._MatNd, ptr %128, i32 0, i32 0
  store ptr %127, ptr %129, align 8, !tbaa !17
  %130 = load i32, ptr %9, align 4, !tbaa !12
  %131 = load ptr, ptr %10, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._MatNd, ptr %131, i32 0, i32 1
  store i32 %130, ptr %132, align 8, !tbaa !13
  %133 = load i32, ptr %9, align 4, !tbaa !12
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._MatNd, ptr %134, i32 0, i32 2
  store i32 %133, ptr %135, align 4, !tbaa !16
  %136 = load i32, ptr %11, align 4, !tbaa !12
  %137 = load ptr, ptr %10, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._MatNd, ptr %137, i32 0, i32 3
  store i32 %136, ptr %138, align 8, !tbaa !18
  %139 = load ptr, ptr %10, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._MatNd, ptr %139, i32 0, i32 4
  store i8 1, ptr %140, align 4, !tbaa !19
  %141 = load ptr, ptr %10, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct._MatNd, ptr %141, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !17
  %144 = load i32, ptr %11, align 4, !tbaa !12
  %145 = zext i32 %144 to i64
  %146 = mul i64 %145, 8
  call void @llvm.memset.p0.i64(ptr align 8 %143, i8 0, i64 %146, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %147

147:                                              ; preds = %119, %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store ptr null, ptr %12, align 8, !tbaa !5
  %148 = load i32, ptr %9, align 4, !tbaa !12
  %149 = mul nsw i32 %148, 1
  %150 = icmp sgt i32 %149, 1296
  br i1 %150, label %151, label %154

151:                                              ; preds = %147
  %152 = load i32, ptr %9, align 4, !tbaa !12
  %153 = call ptr @MatNd_create(i32 noundef %152, i32 noundef 1)
  store ptr %153, ptr %12, align 8, !tbaa !5
  br label %189

154:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %155 = load i32, ptr %9, align 4, !tbaa !12
  %156 = mul nsw i32 %155, 1
  %157 = icmp eq i32 %156, 0
  br i1 %157, label %158, label %159

158:                                              ; preds = %154
  br label %162

159:                                              ; preds = %154
  %160 = load i32, ptr %9, align 4, !tbaa !12
  %161 = mul nsw i32 %160, 1
  br label %162

162:                                              ; preds = %159, %158
  %163 = phi i32 [ 1, %158 ], [ %161, %159 ]
  store i32 %163, ptr %13, align 4, !tbaa !12
  %164 = load i32, ptr %13, align 4, !tbaa !12
  %165 = zext i32 %164 to i64
  %166 = mul i64 %165, 8
  %167 = add i64 24, %166
  %168 = alloca i8, i64 %167, align 16
  store ptr %168, ptr %12, align 8, !tbaa !5
  %169 = load ptr, ptr %12, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct._MatNd, ptr %169, i64 1
  %171 = load ptr, ptr %12, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._MatNd, ptr %171, i32 0, i32 0
  store ptr %170, ptr %172, align 8, !tbaa !17
  %173 = load i32, ptr %9, align 4, !tbaa !12
  %174 = load ptr, ptr %12, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct._MatNd, ptr %174, i32 0, i32 1
  store i32 %173, ptr %175, align 8, !tbaa !13
  %176 = load ptr, ptr %12, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct._MatNd, ptr %176, i32 0, i32 2
  store i32 1, ptr %177, align 4, !tbaa !16
  %178 = load i32, ptr %13, align 4, !tbaa !12
  %179 = load ptr, ptr %12, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct._MatNd, ptr %179, i32 0, i32 3
  store i32 %178, ptr %180, align 8, !tbaa !18
  %181 = load ptr, ptr %12, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct._MatNd, ptr %181, i32 0, i32 4
  store i8 1, ptr %182, align 4, !tbaa !19
  %183 = load ptr, ptr %12, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct._MatNd, ptr %183, i32 0, i32 0
  %185 = load ptr, ptr %184, align 8, !tbaa !17
  %186 = load i32, ptr %13, align 4, !tbaa !12
  %187 = zext i32 %186 to i64
  %188 = mul i64 %187, 8
  call void @llvm.memset.p0.i64(ptr align 8 %185, i8 0, i64 %188, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %189

189:                                              ; preds = %162, %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store ptr null, ptr %14, align 8, !tbaa !5
  %190 = load i32, ptr %9, align 4, !tbaa !12
  %191 = mul nsw i32 %190, 1
  %192 = icmp sgt i32 %191, 1296
  br i1 %192, label %193, label %196

193:                                              ; preds = %189
  %194 = load i32, ptr %9, align 4, !tbaa !12
  %195 = call ptr @MatNd_create(i32 noundef %194, i32 noundef 1)
  store ptr %195, ptr %14, align 8, !tbaa !5
  br label %231

196:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %197 = load i32, ptr %9, align 4, !tbaa !12
  %198 = mul nsw i32 %197, 1
  %199 = icmp eq i32 %198, 0
  br i1 %199, label %200, label %201

200:                                              ; preds = %196
  br label %204

201:                                              ; preds = %196
  %202 = load i32, ptr %9, align 4, !tbaa !12
  %203 = mul nsw i32 %202, 1
  br label %204

204:                                              ; preds = %201, %200
  %205 = phi i32 [ 1, %200 ], [ %203, %201 ]
  store i32 %205, ptr %15, align 4, !tbaa !12
  %206 = load i32, ptr %15, align 4, !tbaa !12
  %207 = zext i32 %206 to i64
  %208 = mul i64 %207, 8
  %209 = add i64 24, %208
  %210 = alloca i8, i64 %209, align 16
  store ptr %210, ptr %14, align 8, !tbaa !5
  %211 = load ptr, ptr %14, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct._MatNd, ptr %211, i64 1
  %213 = load ptr, ptr %14, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct._MatNd, ptr %213, i32 0, i32 0
  store ptr %212, ptr %214, align 8, !tbaa !17
  %215 = load i32, ptr %9, align 4, !tbaa !12
  %216 = load ptr, ptr %14, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct._MatNd, ptr %216, i32 0, i32 1
  store i32 %215, ptr %217, align 8, !tbaa !13
  %218 = load ptr, ptr %14, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct._MatNd, ptr %218, i32 0, i32 2
  store i32 1, ptr %219, align 4, !tbaa !16
  %220 = load i32, ptr %15, align 4, !tbaa !12
  %221 = load ptr, ptr %14, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct._MatNd, ptr %221, i32 0, i32 3
  store i32 %220, ptr %222, align 8, !tbaa !18
  %223 = load ptr, ptr %14, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct._MatNd, ptr %223, i32 0, i32 4
  store i8 1, ptr %224, align 4, !tbaa !19
  %225 = load ptr, ptr %14, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct._MatNd, ptr %225, i32 0, i32 0
  %227 = load ptr, ptr %226, align 8, !tbaa !17
  %228 = load i32, ptr %15, align 4, !tbaa !12
  %229 = zext i32 %228 to i64
  %230 = mul i64 %229, 8
  call void @llvm.memset.p0.i64(ptr align 8 %227, i8 0, i64 %230, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %231

231:                                              ; preds = %204, %193
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store ptr null, ptr %16, align 8, !tbaa !5
  %232 = load i32, ptr %9, align 4, !tbaa !12
  %233 = mul nsw i32 %232, 1
  %234 = icmp sgt i32 %233, 1296
  br i1 %234, label %235, label %238

235:                                              ; preds = %231
  %236 = load i32, ptr %9, align 4, !tbaa !12
  %237 = call ptr @MatNd_create(i32 noundef %236, i32 noundef 1)
  store ptr %237, ptr %16, align 8, !tbaa !5
  br label %273

238:                                              ; preds = %231
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %239 = load i32, ptr %9, align 4, !tbaa !12
  %240 = mul nsw i32 %239, 1
  %241 = icmp eq i32 %240, 0
  br i1 %241, label %242, label %243

242:                                              ; preds = %238
  br label %246

243:                                              ; preds = %238
  %244 = load i32, ptr %9, align 4, !tbaa !12
  %245 = mul nsw i32 %244, 1
  br label %246

246:                                              ; preds = %243, %242
  %247 = phi i32 [ 1, %242 ], [ %245, %243 ]
  store i32 %247, ptr %17, align 4, !tbaa !12
  %248 = load i32, ptr %17, align 4, !tbaa !12
  %249 = zext i32 %248 to i64
  %250 = mul i64 %249, 8
  %251 = add i64 24, %250
  %252 = alloca i8, i64 %251, align 16
  store ptr %252, ptr %16, align 8, !tbaa !5
  %253 = load ptr, ptr %16, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct._MatNd, ptr %253, i64 1
  %255 = load ptr, ptr %16, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct._MatNd, ptr %255, i32 0, i32 0
  store ptr %254, ptr %256, align 8, !tbaa !17
  %257 = load i32, ptr %9, align 4, !tbaa !12
  %258 = load ptr, ptr %16, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct._MatNd, ptr %258, i32 0, i32 1
  store i32 %257, ptr %259, align 8, !tbaa !13
  %260 = load ptr, ptr %16, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct._MatNd, ptr %260, i32 0, i32 2
  store i32 1, ptr %261, align 4, !tbaa !16
  %262 = load i32, ptr %17, align 4, !tbaa !12
  %263 = load ptr, ptr %16, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct._MatNd, ptr %263, i32 0, i32 3
  store i32 %262, ptr %264, align 8, !tbaa !18
  %265 = load ptr, ptr %16, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct._MatNd, ptr %265, i32 0, i32 4
  store i8 1, ptr %266, align 4, !tbaa !19
  %267 = load ptr, ptr %16, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct._MatNd, ptr %267, i32 0, i32 0
  %269 = load ptr, ptr %268, align 8, !tbaa !17
  %270 = load i32, ptr %17, align 4, !tbaa !12
  %271 = zext i32 %270 to i64
  %272 = mul i64 %271, 8
  call void @llvm.memset.p0.i64(ptr align 8 %269, i8 0, i64 %272, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %273

273:                                              ; preds = %246, %235
  %274 = load ptr, ptr %8, align 8, !tbaa !5
  %275 = load i32, ptr %9, align 4, !tbaa !12
  call void @MatNd_reshapeAndSetZero(ptr noundef %274, i32 noundef %275, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %276 = load ptr, ptr %5, align 8, !tbaa !5
  %277 = load ptr, ptr %10, align 8, !tbaa !5
  %278 = load ptr, ptr %14, align 8, !tbaa !5
  %279 = load ptr, ptr %12, align 8, !tbaa !5
  %280 = call double @RcsGraph_computeKineticTerms(ptr noundef %276, ptr noundef %277, ptr noundef %278, ptr noundef %279)
  store double %280, ptr %18, align 8, !tbaa !20
  %281 = load ptr, ptr %16, align 8, !tbaa !5
  %282 = load ptr, ptr %12, align 8, !tbaa !5
  call void @MatNd_addSelf(ptr noundef %281, ptr noundef %282)
  %283 = load ptr, ptr %6, align 8, !tbaa !5
  %284 = icmp ne ptr %283, null
  br i1 %284, label %285, label %288

285:                                              ; preds = %273
  %286 = load ptr, ptr %16, align 8, !tbaa !5
  %287 = load ptr, ptr %6, align 8, !tbaa !5
  call void @MatNd_addSelf(ptr noundef %286, ptr noundef %287)
  br label %288

288:                                              ; preds = %285, %273
  %289 = load ptr, ptr %7, align 8, !tbaa !5
  %290 = icmp ne ptr %289, null
  br i1 %290, label %291, label %294

291:                                              ; preds = %288
  %292 = load ptr, ptr %16, align 8, !tbaa !5
  %293 = load ptr, ptr %7, align 8, !tbaa !5
  call void @MatNd_subSelf(ptr noundef %292, ptr noundef %293)
  br label %294

294:                                              ; preds = %291, %288
  %295 = load ptr, ptr %16, align 8, !tbaa !5
  %296 = load ptr, ptr %14, align 8, !tbaa !5
  call void @MatNd_addSelf(ptr noundef %295, ptr noundef %296)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %297 = load ptr, ptr %8, align 8, !tbaa !5
  %298 = load ptr, ptr %10, align 8, !tbaa !5
  %299 = load ptr, ptr %16, align 8, !tbaa !5
  %300 = call double @MatNd_choleskySolve(ptr noundef %297, ptr noundef %298, ptr noundef %299)
  store double %300, ptr %19, align 8, !tbaa !20
  %301 = load double, ptr %19, align 8, !tbaa !20
  %302 = fcmp oeq double %301, 0.000000e+00
  br i1 %302, label %303, label %328

303:                                              ; preds = %294
  br label %304

304:                                              ; preds = %303
  %305 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %306 = icmp ne ptr %305, null
  br i1 %306, label %307, label %309

307:                                              ; preds = %304
  %308 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %308(i32 noundef 1, ptr noundef @.str.1, ptr noundef @__func__.Rcs_directDynamics, i32 noundef 739, ptr noundef @.str.15)
  br label %309

309:                                              ; preds = %307, %304
  %310 = load i32, ptr @RcsLogLevel, align 4, !tbaa !12
  %311 = icmp sle i32 1, %310
  br i1 %311, label %312, label %319

312:                                              ; preds = %309
  %313 = load ptr, ptr @stderr, align 8, !tbaa !5
  %314 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %313, ptr noundef @.str.16, ptr noundef @.str.1, ptr noundef @__func__.Rcs_directDynamics, i32 noundef 739) #7
  %315 = load ptr, ptr @stderr, align 8, !tbaa !5
  %316 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %315, ptr noundef @.str.15) #7
  %317 = load ptr, ptr @stderr, align 8, !tbaa !5
  %318 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %317, ptr noundef @.str.3) #7
  br label %319

319:                                              ; preds = %312, %309
  br label %320

320:                                              ; preds = %319
  br label %321

321:                                              ; preds = %320
  %322 = load i32, ptr @RcsLogLevel, align 4, !tbaa !12
  %323 = icmp sle i32 4, %322
  br i1 %323, label %324, label %327

324:                                              ; preds = %321
  %325 = load ptr, ptr %10, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.17, ptr noundef %325, i32 noundef 12)
  %326 = load ptr, ptr %16, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.18, ptr noundef %326, i32 noundef 3)
  br label %327

327:                                              ; preds = %324, %321
  br label %328

328:                                              ; preds = %327, %294
  %329 = load double, ptr %19, align 8, !tbaa !20
  %330 = fcmp oeq double %329, 0.000000e+00
  br i1 %330, label %331, label %355

331:                                              ; preds = %328
  %332 = load i32, ptr @RcsLogLevel, align 4, !tbaa !12
  %333 = icmp sle i32 3, %332
  br i1 %333, label %334, label %336

334:                                              ; preds = %331
  %335 = load ptr, ptr %10, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.17, ptr noundef %335, i32 noundef 4)
  br label %336

336:                                              ; preds = %334, %331
  br label %337

337:                                              ; preds = %336
  %338 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %339 = icmp ne ptr %338, null
  br i1 %339, label %340, label %342

340:                                              ; preds = %337
  %341 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %341(i32 noundef 2, ptr noundef @.str.1, ptr noundef @__func__.Rcs_directDynamics, i32 noundef 756, ptr noundef @.str.19)
  br label %342

342:                                              ; preds = %340, %337
  %343 = load i32, ptr @RcsLogLevel, align 4, !tbaa !12
  %344 = icmp sle i32 2, %343
  br i1 %344, label %345, label %352

345:                                              ; preds = %342
  %346 = load ptr, ptr @stderr, align 8, !tbaa !5
  %347 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %346, ptr noundef @.str.16, ptr noundef @.str.1, ptr noundef @__func__.Rcs_directDynamics, i32 noundef 756) #7
  %348 = load ptr, ptr @stderr, align 8, !tbaa !5
  %349 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %348, ptr noundef @.str.19) #7
  %350 = load ptr, ptr @stderr, align 8, !tbaa !5
  %351 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %350, ptr noundef @.str.3) #7
  br label %352

352:                                              ; preds = %345, %342
  br label %353

353:                                              ; preds = %352
  br label %354

354:                                              ; preds = %353
  br label %355

355:                                              ; preds = %354, %328
  %356 = load ptr, ptr %8, align 8, !tbaa !5
  %357 = call zeroext i1 @MatNd_isINF(ptr noundef %356)
  br i1 %357, label %358, label %421

358:                                              ; preds = %355
  %359 = load i32, ptr @RcsLogLevel, align 4, !tbaa !12
  %360 = icmp sle i32 3, %359
  br i1 %360, label %361, label %410

361:                                              ; preds = %358
  %362 = load ptr, ptr %5, align 8, !tbaa !5
  %363 = getelementptr inbounds %struct._RcsGraph, ptr %362, i32 0, i32 4
  %364 = load ptr, ptr %363, align 8, !tbaa !22
  call void @MatNd_printCommentDigits(ptr noundef @.str.20, ptr noundef %364, i32 noundef 4)
  %365 = load ptr, ptr %5, align 8, !tbaa !5
  %366 = getelementptr inbounds %struct._RcsGraph, ptr %365, i32 0, i32 5
  %367 = load ptr, ptr %366, align 8, !tbaa !23
  call void @MatNd_printCommentDigits(ptr noundef @.str.21, ptr noundef %367, i32 noundef 4)
  %368 = load ptr, ptr %8, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.22, ptr noundef %368, i32 noundef 4)
  %369 = load ptr, ptr %14, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.23, ptr noundef %369, i32 noundef 4)
  %370 = load ptr, ptr %12, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.24, ptr noundef %370, i32 noundef 4)
  %371 = load ptr, ptr %7, align 8, !tbaa !5
  %372 = icmp ne ptr %371, null
  br i1 %372, label %373, label %375

373:                                              ; preds = %361
  %374 = load ptr, ptr %7, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.13, ptr noundef %374, i32 noundef 4)
  br label %375

375:                                              ; preds = %373, %361
  %376 = load ptr, ptr %6, align 8, !tbaa !5
  %377 = icmp ne ptr %376, null
  br i1 %377, label %378, label %380

378:                                              ; preds = %375
  %379 = load ptr, ptr %6, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.9, ptr noundef %379, i32 noundef 4)
  br label %380

380:                                              ; preds = %378, %375
  %381 = load ptr, ptr %16, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.25, ptr noundef %381, i32 noundef 4)
  %382 = load ptr, ptr %10, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.26, ptr noundef %382, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %383 = load ptr, ptr %10, align 8, !tbaa !5
  %384 = getelementptr inbounds %struct._MatNd, ptr %383, i32 0, i32 1
  %385 = load i32, ptr %384, align 8, !tbaa !13
  %386 = load ptr, ptr %10, align 8, !tbaa !5
  %387 = getelementptr inbounds %struct._MatNd, ptr %386, i32 0, i32 2
  %388 = load i32, ptr %387, align 4, !tbaa !16
  %389 = call ptr @MatNd_create(i32 noundef %385, i32 noundef %388)
  store ptr %389, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %390 = load ptr, ptr %20, align 8, !tbaa !5
  %391 = load ptr, ptr %10, align 8, !tbaa !5
  %392 = call double @MatNd_choleskyInverse(ptr noundef %390, ptr noundef %391)
  store double %392, ptr %21, align 8, !tbaa !20
  %393 = load ptr, ptr %20, align 8, !tbaa !5
  call void @MatNd_printCommentDigits(ptr noundef @.str.27, ptr noundef %393, i32 noundef 2)
  %394 = load ptr, ptr %20, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %394)
  %395 = load double, ptr %21, align 8, !tbaa !20
  %396 = fcmp oeq double %395, 0.000000e+00
  br i1 %396, label %397, label %409

397:                                              ; preds = %380
  br label %398

398:                                              ; preds = %397
  %399 = load ptr, ptr @stderr, align 8, !tbaa !5
  %400 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %399, ptr noundef @.str.28, ptr noundef @__func__.Rcs_directDynamics, i32 noundef 789) #7
  %401 = load ptr, ptr @stderr, align 8, !tbaa !5
  %402 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %401, ptr noundef @.str.29) #7
  %403 = load ptr, ptr @stderr, align 8, !tbaa !5
  %404 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %403, ptr noundef @.str.3) #7
  %405 = load ptr, ptr @stderr, align 8, !tbaa !5
  %406 = call i32 @fflush(ptr noundef %405)
  br label %407

407:                                              ; preds = %398
  br label %408

408:                                              ; preds = %407
  br label %409

409:                                              ; preds = %408, %380
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %410

410:                                              ; preds = %409, %358
  %411 = load ptr, ptr %8, align 8, !tbaa !5
  call void @MatNd_setZero(ptr noundef %411)
  br label %412

412:                                              ; preds = %410
  %413 = load ptr, ptr @stderr, align 8, !tbaa !5
  %414 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %413, ptr noundef @.str.10, ptr noundef @.str.1, ptr noundef @__func__.Rcs_directDynamics, i32 noundef 794) #7
  %415 = load ptr, ptr @stderr, align 8, !tbaa !5
  %416 = load double, ptr %19, align 8, !tbaa !20
  %417 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %415, ptr noundef @.str.30, double noundef %416) #7
  %418 = call i32 @getchar()
  br label %419

419:                                              ; preds = %412
  br label %420

420:                                              ; preds = %419
  br label %421

421:                                              ; preds = %420, %355
  %422 = load ptr, ptr %10, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %422)
  %423 = load ptr, ptr %12, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %423)
  %424 = load ptr, ptr %14, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %424)
  %425 = load ptr, ptr %16, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %425)
  %426 = load double, ptr %18, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  ret double %426
}

; Function Attrs: noreturn nounwind
declare void @abort() #5

declare zeroext i1 @MatNd_isFinite(ptr noundef) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare i32 @getchar() #6

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

declare double @MatNd_choleskySolve(ptr noundef, ptr noundef, ptr noundef) #1

declare zeroext i1 @MatNd_isINF(ptr noundef) #1

declare double @MatNd_choleskyInverse(ptr noundef, ptr noundef) #1

declare i32 @fflush(ptr noundef) #1

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [43 x i8], align 1
@__func__.Rcs_directDynamics = external hidden unnamed_addr constant [19 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [33 x i8], align 1
@RCS_GLOBAL_RLOG_CB = external local_unnamed_addr global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [66 x i8], align 1
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1

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

declare void @print_trace() local_unnamed_addr #1

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

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) #3

declare void @MatNd_setZero(ptr noundef) local_unnamed_addr #1

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

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

declare void @MatNd_destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local double @Rcs_directDynamics(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %5, label %8

5:                                                ; preds = %4
  %6 = load ptr, ptr @stderr, align 8, !tbaa !5
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Rcs_directDynamics, i32 noundef 678, ptr noundef nonnull @.str.7) #7
  tail call void @print_trace() #8
  tail call void @abort() #9
  unreachable

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %0, i64 1852
  %10 = load i32, ptr %9, align 4, !tbaa !9
  %.not142 = icmp eq ptr %1, null
  br i1 %.not142, label %30, label %11

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  %13 = load i32, ptr %12, align 8, !tbaa !12
  %14 = icmp eq i32 %13, %10
  br i1 %14, label %15, label %19

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %1, i64 12
  %17 = load i32, ptr %16, align 4, !tbaa !15
  %18 = icmp eq i32 %17, 1
  br i1 %18, label %22, label %19

19:                                               ; preds = %15, %11
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Rcs_directDynamics, i32 noundef 683, ptr noundef nonnull @.str.8) #7
  tail call void @print_trace() #8
  tail call void @abort() #9
  unreachable

22:                                               ; preds = %15
  %23 = tail call zeroext i1 @MatNd_isFinite(ptr noundef nonnull %1) #8
  br i1 %23, label %30, label %24

24:                                               ; preds = %22
  tail call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.9, ptr noundef nonnull %1, i32 noundef 5) #8
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Rcs_directDynamics, i32 noundef 688) #7
  %27 = load ptr, ptr @stderr, align 8, !tbaa !5
  %28 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.11) #7
  %29 = tail call i32 @getchar()
  br label %30

30:                                               ; preds = %22, %24, %8
  %.not143 = icmp eq ptr %2, null
  br i1 %.not143, label %50, label %31

31:                                               ; preds = %30
  %32 = getelementptr inbounds i8, ptr %2, i64 8
  %33 = load i32, ptr %32, align 8, !tbaa !12
  %34 = icmp eq i32 %33, %10
  br i1 %34, label %35, label %39

35:                                               ; preds = %31
  %36 = getelementptr inbounds i8, ptr %2, i64 12
  %37 = load i32, ptr %36, align 4, !tbaa !15
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %42, label %39

39:                                               ; preds = %35, %31
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Rcs_directDynamics, i32 noundef 694, ptr noundef nonnull @.str.12) #7
  tail call void @print_trace() #8
  tail call void @abort() #9
  unreachable

42:                                               ; preds = %35
  %43 = tail call zeroext i1 @MatNd_isFinite(ptr noundef nonnull %2) #8
  br i1 %43, label %50, label %44

44:                                               ; preds = %42
  tail call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.13, ptr noundef nonnull %2, i32 noundef 5) #8
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Rcs_directDynamics, i32 noundef 699) #7
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.14) #7
  %49 = tail call i32 @getchar()
  br label %50

50:                                               ; preds = %42, %44, %30
  %51 = mul nsw i32 %10, %10
  %52 = icmp ugt i32 %51, 1296
  br i1 %52, label %53, label %55

53:                                               ; preds = %50
  %54 = tail call ptr @MatNd_create(i32 noundef %10, i32 noundef %10) #8
  br label %67

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

67:                                               ; preds = %55, %53
  %.0 = phi ptr [ %54, %53 ], [ %61, %55 ]
  %68 = icmp sgt i32 %10, 1296
  br i1 %68, label %69, label %73

69:                                               ; preds = %67
  %70 = call ptr @MatNd_create(i32 noundef %10, i32 noundef 1) #8
  %71 = call ptr @MatNd_create(i32 noundef %10, i32 noundef 1) #8
  %72 = call ptr @MatNd_create(i32 noundef %10, i32 noundef 1) #8
  br label %96

73:                                               ; preds = %67
  %74 = call i32 @llvm.umax.i32(i32 %10, i32 1)
  %75 = zext i32 %74 to i64
  %76 = shl nuw nsw i64 %75, 3
  %77 = add nuw nsw i64 %76, 24
  %78 = alloca i8, i64 %77, align 16
  %79 = getelementptr inbounds i8, ptr %78, i64 24
  store ptr %79, ptr %78, align 16, !tbaa !16
  %80 = getelementptr inbounds i8, ptr %78, i64 8
  store i32 %10, ptr %80, align 8, !tbaa !12
  %81 = getelementptr inbounds i8, ptr %78, i64 12
  store i32 1, ptr %81, align 4, !tbaa !15
  %82 = getelementptr inbounds i8, ptr %78, i64 16
  store i32 %74, ptr %82, align 16, !tbaa !17
  %83 = getelementptr inbounds i8, ptr %78, i64 20
  store i8 1, ptr %83, align 4, !tbaa !18
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %79, i8 0, i64 %76, i1 false)
  %84 = alloca i8, i64 %77, align 16
  %85 = getelementptr inbounds i8, ptr %84, i64 24
  store ptr %85, ptr %84, align 16, !tbaa !16
  %86 = getelementptr inbounds i8, ptr %84, i64 8
  store i32 %10, ptr %86, align 8, !tbaa !12
  %87 = getelementptr inbounds i8, ptr %84, i64 12
  store i32 1, ptr %87, align 4, !tbaa !15
  %88 = getelementptr inbounds i8, ptr %84, i64 16
  store i32 %74, ptr %88, align 16, !tbaa !17
  %89 = getelementptr inbounds i8, ptr %84, i64 20
  store i8 1, ptr %89, align 4, !tbaa !18
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %85, i8 0, i64 %76, i1 false)
  %90 = alloca i8, i64 %77, align 16
  %91 = getelementptr inbounds i8, ptr %90, i64 24
  store ptr %91, ptr %90, align 16, !tbaa !16
  %92 = getelementptr inbounds i8, ptr %90, i64 8
  store i32 %10, ptr %92, align 8, !tbaa !12
  %93 = getelementptr inbounds i8, ptr %90, i64 12
  store i32 1, ptr %93, align 4, !tbaa !15
  %94 = getelementptr inbounds i8, ptr %90, i64 16
  store i32 %74, ptr %94, align 16, !tbaa !17
  %95 = getelementptr inbounds i8, ptr %90, i64 20
  store i8 1, ptr %95, align 4, !tbaa !18
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %91, i8 0, i64 %76, i1 false)
  br label %96

96:                                               ; preds = %73, %69
  %.0129155 = phi ptr [ %71, %69 ], [ %84, %73 ]
  %.0128147153 = phi ptr [ %70, %69 ], [ %78, %73 ]
  %.0130 = phi ptr [ %72, %69 ], [ %90, %73 ]
  call void @MatNd_reshapeAndSetZero(ptr noundef %3, i32 noundef %10, i32 noundef 1) #8
  %97 = call double @RcsGraph_computeKineticTerms(ptr noundef nonnull %0, ptr noundef %.0, ptr noundef %.0129155, ptr noundef %.0128147153)
  call void @MatNd_addSelf(ptr noundef %.0130, ptr noundef %.0128147153) #8
  br i1 %.not142, label %99, label %98

98:                                               ; preds = %96
  call void @MatNd_addSelf(ptr noundef %.0130, ptr noundef nonnull %1) #8
  br label %99

99:                                               ; preds = %98, %96
  br i1 %.not143, label %101, label %100

100:                                              ; preds = %99
  call void @MatNd_subSelf(ptr noundef %.0130, ptr noundef nonnull %2) #8
  br label %101

101:                                              ; preds = %100, %99
  call void @MatNd_addSelf(ptr noundef %.0130, ptr noundef %.0129155) #8
  %102 = call double @MatNd_choleskySolve(ptr noundef %3, ptr noundef %.0, ptr noundef %.0130) #8
  %103 = fcmp oeq double %102, 0.000000e+00
  br i1 %103, label %104, label %.critedge

104:                                              ; preds = %101
  %105 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not144 = icmp eq ptr %105, null
  br i1 %.not144, label %107, label %106

106:                                              ; preds = %104
  call void (i32, ptr, ptr, i32, ptr, ...) %105(i32 noundef 1, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Rcs_directDynamics, i32 noundef 739, ptr noundef nonnull @.str.15) #8
  br label %107

107:                                              ; preds = %106, %104
  %108 = load i32, ptr @RcsLogLevel, align 4, !tbaa !19
  %109 = icmp sgt i32 %108, 0
  br i1 %109, label %110, label %.thread160

110:                                              ; preds = %107
  %111 = load ptr, ptr @stderr, align 8, !tbaa !5
  %112 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Rcs_directDynamics, i32 noundef 739) #7
  %113 = load ptr, ptr @stderr, align 8, !tbaa !5
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef nonnull @.str.15) #7
  %115 = load ptr, ptr @stderr, align 8, !tbaa !5
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef nonnull @.str.3) #7
  %.pr = load i32, ptr @RcsLogLevel, align 4, !tbaa !19
  %117 = icmp sgt i32 %.pr, 3
  br i1 %117, label %118, label %119

118:                                              ; preds = %110
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.17, ptr noundef %.0, i32 noundef 12) #8
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.18, ptr noundef %.0130, i32 noundef 3) #8
  %.pr159 = load i32, ptr @RcsLogLevel, align 4, !tbaa !19
  br label %119

119:                                              ; preds = %118, %110
  %120 = phi i32 [ %.pr159, %118 ], [ %.pr, %110 ]
  %121 = icmp sgt i32 %120, 2
  br i1 %121, label %122, label %.thread160

122:                                              ; preds = %119
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.17, ptr noundef %.0, i32 noundef 4) #8
  br label %.thread160

.thread160:                                       ; preds = %107, %119, %122
  %123 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not145 = icmp eq ptr %123, null
  br i1 %.not145, label %125, label %124

124:                                              ; preds = %.thread160
  call void (i32, ptr, ptr, i32, ptr, ...) %123(i32 noundef 2, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Rcs_directDynamics, i32 noundef 756, ptr noundef nonnull @.str.19) #8
  br label %125

125:                                              ; preds = %124, %.thread160
  %126 = load i32, ptr @RcsLogLevel, align 4, !tbaa !19
  %127 = icmp sgt i32 %126, 1
  br i1 %127, label %128, label %.critedge

128:                                              ; preds = %125
  %129 = load ptr, ptr @stderr, align 8, !tbaa !5
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Rcs_directDynamics, i32 noundef 756) #7
  %131 = load ptr, ptr @stderr, align 8, !tbaa !5
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef nonnull @.str.19) #7
  %133 = load ptr, ptr @stderr, align 8, !tbaa !5
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef nonnull @.str.3) #7
  br label %.critedge

.critedge:                                        ; preds = %101, %125, %128
  %135 = call zeroext i1 @MatNd_isINF(ptr noundef %3) #8
  br i1 %135, label %136, label %170

136:                                              ; preds = %.critedge
  %137 = load i32, ptr @RcsLogLevel, align 4, !tbaa !19
  %138 = icmp sgt i32 %137, 2
  br i1 %138, label %139, label %164

139:                                              ; preds = %136
  %140 = getelementptr inbounds i8, ptr %0, i64 1856
  %141 = load ptr, ptr %140, align 8, !tbaa !20
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.20, ptr noundef %141, i32 noundef 4) #8
  %142 = getelementptr inbounds i8, ptr %0, i64 1864
  %143 = load ptr, ptr %142, align 8, !tbaa !21
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.21, ptr noundef %143, i32 noundef 4) #8
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.22, ptr noundef %3, i32 noundef 4) #8
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.23, ptr noundef %.0129155, i32 noundef 4) #8
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.24, ptr noundef %.0128147153, i32 noundef 4) #8
  br i1 %.not143, label %145, label %144

144:                                              ; preds = %139
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.13, ptr noundef nonnull %2, i32 noundef 4) #8
  br label %145

145:                                              ; preds = %144, %139
  br i1 %.not142, label %147, label %146

146:                                              ; preds = %145
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.9, ptr noundef nonnull %1, i32 noundef 4) #8
  br label %147

147:                                              ; preds = %146, %145
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.25, ptr noundef %.0130, i32 noundef 4) #8
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.26, ptr noundef %.0, i32 noundef 2) #8
  %148 = getelementptr inbounds i8, ptr %.0, i64 8
  %149 = load i32, ptr %148, align 8, !tbaa !12
  %150 = getelementptr inbounds i8, ptr %.0, i64 12
  %151 = load i32, ptr %150, align 4, !tbaa !15
  %152 = call ptr @MatNd_create(i32 noundef %149, i32 noundef %151) #8
  %153 = call double @MatNd_choleskyInverse(ptr noundef %152, ptr noundef %.0) #8
  call void @MatNd_printCommentDigits(ptr noundef nonnull @.str.27, ptr noundef %152, i32 noundef 2) #8
  call void @MatNd_destroy(ptr noundef %152) #8
  %154 = fcmp oeq double %153, 0.000000e+00
  br i1 %154, label %155, label %164

155:                                              ; preds = %147
  %156 = load ptr, ptr @stderr, align 8, !tbaa !5
  %157 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef nonnull @.str.28, ptr noundef nonnull @__func__.Rcs_directDynamics, i32 noundef 789) #7
  %158 = load ptr, ptr @stderr, align 8, !tbaa !5
  %159 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %158, ptr noundef nonnull @.str.29) #7
  %160 = load ptr, ptr @stderr, align 8, !tbaa !5
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %160, ptr noundef nonnull @.str.3) #7
  %162 = load ptr, ptr @stderr, align 8, !tbaa !5
  %163 = call i32 @fflush(ptr noundef %162)
  br label %164

164:                                              ; preds = %147, %155, %136
  call void @MatNd_setZero(ptr noundef %3) #8
  %165 = load ptr, ptr @stderr, align 8, !tbaa !5
  %166 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %165, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Rcs_directDynamics, i32 noundef 794) #7
  %167 = load ptr, ptr @stderr, align 8, !tbaa !5
  %168 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %167, ptr noundef nonnull @.str.30, double noundef %102) #7
  %169 = call i32 @getchar()
  br label %170

170:                                              ; preds = %164, %.critedge
  call void @MatNd_destroy(ptr noundef %.0) #8
  call void @MatNd_destroy(ptr noundef %.0128147153) #8
  call void @MatNd_destroy(ptr noundef %.0129155) #8
  call void @MatNd_destroy(ptr noundef %.0130) #8
  ret double %97
}

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #4

declare zeroext i1 @MatNd_isFinite(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint nofree nounwind uwtable
declare noundef i32 @getchar() local_unnamed_addr #5

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

declare double @MatNd_choleskySolve(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i1 @MatNd_isINF(ptr noundef) local_unnamed_addr #1

declare double @MatNd_choleskyInverse(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #0

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

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass