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

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

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [26 x i8], align 1
@__func__.MatNd_insertRows = external hidden unnamed_addr constant [17 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.117 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.118 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [87 x i8], align 1

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

declare void @print_trace() #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @MatNd_clone(ptr noundef) #4

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

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_destroy(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local ptr @MatNd_realloc(ptr noundef, i32 noundef, i32 noundef) #4

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

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

; Function Attrs: nounwind uwtable
define dso_local void @MatNd_insertRows(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) #4 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._MatNd, ptr %15, i32 0, i32 2
  %17 = load i32, ptr %16, align 4, !tbaa !11
  store i32 %17, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._MatNd, ptr %18, i32 0, i32 1
  %20 = load i32, ptr %19, align 8, !tbaa !14
  store i32 %20, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  br label %21

21:                                               ; preds = %5
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._MatNd, ptr %22, i32 0, i32 2
  %24 = load i32, ptr %23, align 4, !tbaa !11
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._MatNd, ptr %25, i32 0, i32 2
  %27 = load i32, ptr %26, align 4, !tbaa !11
  %28 = icmp eq i32 %24, %27
  br i1 %28, label %42, label %29

29:                                               ; preds = %21
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.MatNd_insertRows, i32 noundef 1472, ptr noundef @.str.115) #6
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._MatNd, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 4, !tbaa !11
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._MatNd, ptr %36, i32 0, i32 2
  %38 = load i32, ptr %37, align 4, !tbaa !11
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.116, i32 noundef %35, i32 noundef %38) #6
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str.4) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

42:                                               ; preds = %21
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = add i32 %46, %47
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._MatNd, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 8, !tbaa !14
  %52 = icmp ule i32 %48, %51
  br i1 %52, label %67, label %53

53:                                               ; preds = %45
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.MatNd_insertRows, i32 noundef 1476, ptr noundef @.str.117) #6
  %56 = load ptr, ptr @stderr, align 8, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = add i32 %58, %59
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._MatNd, ptr %61, i32 0, i32 1
  %63 = load i32, ptr %62, align 8, !tbaa !14
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.118, i32 noundef %57, i32 noundef %60, i32 noundef %63) #6
  %65 = load ptr, ptr @stderr, align 8, !tbaa !5
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.4) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

67:                                               ; preds = %45
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._MatNd, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 8, !tbaa !14
  %74 = load i32, ptr %10, align 4, !tbaa !9
  %75 = add i32 %73, %74
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._MatNd, ptr %76, i32 0, i32 2
  %78 = load i32, ptr %77, align 4, !tbaa !11
  %79 = call ptr @MatNd_realloc(ptr noundef %70, i32 noundef %75, i32 noundef %78)
  store ptr %79, ptr %6, align 8, !tbaa !5
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._MatNd, ptr %80, i32 0, i32 3
  %82 = load i32, ptr %81, align 8, !tbaa !15
  %83 = icmp ugt i32 %82, 1296
  br i1 %83, label %84, label %87

84:                                               ; preds = %69
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = call ptr @MatNd_clone(ptr noundef %85)
  store ptr %86, ptr %13, align 8, !tbaa !5
  br label %127

87:                                               ; preds = %69
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._MatNd, ptr %88, i32 0, i32 3
  %90 = load i32, ptr %89, align 8, !tbaa !15
  %91 = zext i32 %90 to i64
  %92 = mul i64 %91, 8
  %93 = add i64 24, %92
  %94 = alloca i8, i64 %93, align 16
  store ptr %94, ptr %13, align 8, !tbaa !5
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._MatNd, ptr %95, i64 1
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._MatNd, ptr %97, i32 0, i32 0
  store ptr %96, ptr %98, align 8, !tbaa !16
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._MatNd, ptr %99, i32 0, i32 1
  %101 = load i32, ptr %100, align 8, !tbaa !14
  %102 = load ptr, ptr %13, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._MatNd, ptr %102, i32 0, i32 1
  store i32 %101, ptr %103, align 8, !tbaa !14
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._MatNd, ptr %104, i32 0, i32 2
  %106 = load i32, ptr %105, align 4, !tbaa !11
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._MatNd, ptr %107, i32 0, i32 2
  store i32 %106, ptr %108, align 4, !tbaa !11
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct._MatNd, ptr %109, i32 0, i32 3
  %111 = load i32, ptr %110, align 8, !tbaa !15
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._MatNd, ptr %112, i32 0, i32 3
  store i32 %111, ptr %113, align 8, !tbaa !15
  %114 = load ptr, ptr %13, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._MatNd, ptr %114, i32 0, i32 4
  store i8 1, ptr %115, align 4, !tbaa !17
  %116 = load ptr, ptr %13, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._MatNd, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !16
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._MatNd, ptr %119, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !16
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._MatNd, ptr %122, i32 0, i32 3
  %124 = load i32, ptr %123, align 8, !tbaa !15
  %125 = zext i32 %124 to i64
  %126 = mul i64 %125, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %118, ptr align 8 %121, i64 %126, i1 false)
  br label %127

127:                                              ; preds = %87, %84
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = icmp ne ptr %129, null
  br i1 %130, label %134, label %131

131:                                              ; preds = %128
  %132 = load ptr, ptr @stderr, align 8, !tbaa !5
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %132, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_insertRows, i32 noundef 1480, ptr noundef @.str.119) #6
  call void @print_trace()
  call void @abort() #7
  unreachable

134:                                              ; preds = %128
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %7, align 4, !tbaa !9
  %138 = icmp eq i32 %137, -1
  br i1 %138, label %139, label %172

139:                                              ; preds = %136
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._MatNd, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !16
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._MatNd, ptr %143, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !16
  %146 = load i32, ptr %9, align 4, !tbaa !9
  %147 = load i32, ptr %11, align 4, !tbaa !9
  %148 = mul nsw i32 %146, %147
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds double, ptr %145, i64 %149
  %151 = load i32, ptr %10, align 4, !tbaa !9
  %152 = load i32, ptr %11, align 4, !tbaa !9
  %153 = mul i32 %151, %152
  %154 = zext i32 %153 to i64
  %155 = mul i64 %154, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %142, ptr align 8 %150, i64 %155, i1 false)
  %156 = load ptr, ptr %13, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct._MatNd, ptr %156, i32 0, i32 0
  %158 = load ptr, ptr %157, align 8, !tbaa !16
  %159 = load i32, ptr %10, align 4, !tbaa !9
  %160 = load i32, ptr %11, align 4, !tbaa !9
  %161 = mul i32 %159, %160
  %162 = zext i32 %161 to i64
  %163 = getelementptr inbounds double, ptr %158, i64 %162
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct._MatNd, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8, !tbaa !16
  %167 = load i32, ptr %12, align 4, !tbaa !9
  %168 = load i32, ptr %11, align 4, !tbaa !9
  %169 = mul nsw i32 %167, %168
  %170 = sext i32 %169 to i64
  %171 = mul i64 %170, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %163, ptr align 8 %166, i64 %171, i1 false)
  br label %274

172:                                              ; preds = %136
  %173 = load i32, ptr %7, align 4, !tbaa !9
  %174 = load i32, ptr %12, align 4, !tbaa !9
  %175 = sub nsw i32 %174, 1
  %176 = icmp eq i32 %173, %175
  br i1 %176, label %177, label %199

177:                                              ; preds = %172
  %178 = load ptr, ptr %13, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct._MatNd, ptr %178, i32 0, i32 0
  %180 = load ptr, ptr %179, align 8, !tbaa !16
  %181 = load i32, ptr %12, align 4, !tbaa !9
  %182 = load i32, ptr %11, align 4, !tbaa !9
  %183 = mul nsw i32 %181, %182
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds double, ptr %180, i64 %184
  %186 = load ptr, ptr %8, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct._MatNd, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !16
  %189 = load i32, ptr %9, align 4, !tbaa !9
  %190 = load i32, ptr %11, align 4, !tbaa !9
  %191 = mul nsw i32 %189, %190
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds double, ptr %188, i64 %192
  %194 = load i32, ptr %10, align 4, !tbaa !9
  %195 = load i32, ptr %11, align 4, !tbaa !9
  %196 = mul i32 %194, %195
  %197 = zext i32 %196 to i64
  %198 = mul i64 %197, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %185, ptr align 8 %193, i64 %198, i1 false)
  br label %273

199:                                              ; preds = %172
  %200 = load i32, ptr %7, align 4, !tbaa !9
  %201 = load i32, ptr %12, align 4, !tbaa !9
  %202 = icmp sge i32 %200, %201
  br i1 %202, label %206, label %203

203:                                              ; preds = %199
  %204 = load i32, ptr %7, align 4, !tbaa !9
  %205 = icmp slt i32 %204, -1
  br i1 %205, label %206, label %220

206:                                              ; preds = %203, %199
  br label %207

207:                                              ; preds = %206
  %208 = load ptr, ptr @stderr, align 8, !tbaa !5
  %209 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %208, ptr noundef @.str.91, ptr noundef @.str.1, ptr noundef @__func__.MatNd_insertRows, i32 noundef 1500) #6
  %210 = load ptr, ptr @stderr, align 8, !tbaa !5
  %211 = load i32, ptr %7, align 4, !tbaa !9
  %212 = load i32, ptr %12, align 4, !tbaa !9
  %213 = load i32, ptr %12, align 4, !tbaa !9
  %214 = sub nsw i32 %213, 1
  %215 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %210, ptr noundef @.str.120, i32 noundef %211, i32 noundef %212, i32 noundef %214) #6
  %216 = load ptr, ptr @stderr, align 8, !tbaa !5
  %217 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %216, ptr noundef @.str.4) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

218:                                              ; No predecessors!
  br label %219

219:                                              ; preds = %218
  br label %272

220:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %221 = load i32, ptr %7, align 4, !tbaa !9
  %222 = add nsw i32 %221, 1
  %223 = load i32, ptr %11, align 4, !tbaa !9
  %224 = mul nsw i32 %222, %223
  store i32 %224, ptr %14, align 4, !tbaa !9
  %225 = load ptr, ptr %13, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct._MatNd, ptr %225, i32 0, i32 0
  %227 = load ptr, ptr %226, align 8, !tbaa !16
  %228 = load i32, ptr %14, align 4, !tbaa !9
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds double, ptr %227, i64 %229
  %231 = load ptr, ptr %8, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct._MatNd, ptr %231, i32 0, i32 0
  %233 = load ptr, ptr %232, align 8, !tbaa !16
  %234 = load i32, ptr %9, align 4, !tbaa !9
  %235 = load i32, ptr %11, align 4, !tbaa !9
  %236 = mul nsw i32 %234, %235
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds double, ptr %233, i64 %237
  %239 = load i32, ptr %10, align 4, !tbaa !9
  %240 = load i32, ptr %11, align 4, !tbaa !9
  %241 = mul i32 %239, %240
  %242 = zext i32 %241 to i64
  %243 = mul i64 %242, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %230, ptr align 8 %238, i64 %243, i1 false)
  %244 = load i32, ptr %10, align 4, !tbaa !9
  %245 = load i32, ptr %11, align 4, !tbaa !9
  %246 = mul i32 %244, %245
  %247 = load i32, ptr %14, align 4, !tbaa !9
  %248 = add i32 %247, %246
  store i32 %248, ptr %14, align 4, !tbaa !9
  %249 = load ptr, ptr %13, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct._MatNd, ptr %249, i32 0, i32 0
  %251 = load ptr, ptr %250, align 8, !tbaa !16
  %252 = load i32, ptr %14, align 4, !tbaa !9
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds double, ptr %251, i64 %253
  %255 = load ptr, ptr %6, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct._MatNd, ptr %255, i32 0, i32 0
  %257 = load ptr, ptr %256, align 8, !tbaa !16
  %258 = load i32, ptr %7, align 4, !tbaa !9
  %259 = add nsw i32 %258, 1
  %260 = load i32, ptr %11, align 4, !tbaa !9
  %261 = mul nsw i32 %259, %260
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds double, ptr %257, i64 %262
  %264 = load i32, ptr %12, align 4, !tbaa !9
  %265 = load i32, ptr %7, align 4, !tbaa !9
  %266 = sub nsw i32 %264, %265
  %267 = sub nsw i32 %266, 1
  %268 = load i32, ptr %11, align 4, !tbaa !9
  %269 = mul nsw i32 %267, %268
  %270 = sext i32 %269 to i64
  %271 = mul i64 %270, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %254, ptr align 8 %263, i64 %271, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %272

272:                                              ; preds = %220, %219
  br label %273

273:                                              ; preds = %272, %177
  br label %274

274:                                              ; preds = %273, %139
  %275 = load ptr, ptr %6, align 8, !tbaa !5
  %276 = load ptr, ptr %13, align 8, !tbaa !5
  call void @MatNd_copy(ptr noundef %275, ptr noundef %276)
  %277 = load ptr, ptr %13, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %277)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  ret void
}

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 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 12}
!12 = !{!"_MatNd", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 20}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !10, i64 16}
!16 = !{!12, !6, i64 0}
!17 = !{!12, !13, i64 20}


; 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 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [26 x i8], align 1
@__func__.MatNd_insertRows = external hidden unnamed_addr constant [17 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.117 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.118 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [87 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: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @MatNd_clone(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_destroy(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @MatNd_realloc(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
define dso_local void @MatNd_insertRows(ptr noundef %0, i32 noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #3 {
  %6 = getelementptr inbounds i8, ptr %0, i64 12
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %2, i64 12
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = icmp eq i32 %7, %11
  br i1 %12, label %22, label %13

13:                                               ; preds = %5
  %14 = load ptr, ptr @stderr, align 8, !tbaa !13
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_insertRows, i32 noundef 1472, ptr noundef nonnull @.str.115) #5
  %16 = load ptr, ptr @stderr, align 8, !tbaa !13
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %18 = load i32, ptr %10, align 4, !tbaa !5
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.116, i32 noundef %17, i32 noundef %18) #5
  %20 = load ptr, ptr @stderr, align 8, !tbaa !13
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.4) #5
  tail call void @print_trace() #6
  tail call void @exit(i32 noundef 1) #7
  unreachable

22:                                               ; preds = %5
  %23 = add i32 %4, %3
  %24 = getelementptr inbounds i8, ptr %2, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !12
  %.not = icmp ugt i32 %23, %25
  br i1 %.not, label %26, label %34

26:                                               ; preds = %22
  %27 = load ptr, ptr @stderr, align 8, !tbaa !13
  %28 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_insertRows, i32 noundef 1476, ptr noundef nonnull @.str.117) #5
  %29 = load ptr, ptr @stderr, align 8, !tbaa !13
  %30 = load i32, ptr %24, align 8, !tbaa !12
  %31 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.118, i32 noundef %3, i32 noundef %23, i32 noundef %30) #5
  %32 = load ptr, ptr @stderr, align 8, !tbaa !13
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str.4) #5
  tail call void @print_trace() #6
  tail call void @exit(i32 noundef 1) #7
  unreachable

34:                                               ; preds = %22
  %35 = add i32 %9, %4
  %36 = tail call ptr @MatNd_realloc(ptr noundef nonnull %0, i32 noundef %35, i32 noundef %7)
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %38 = load i32, ptr %37, align 8, !tbaa !14
  %39 = icmp ugt i32 %38, 1296
  br i1 %39, label %52, label %.thread

.thread:                                          ; preds = %34
  %40 = shl nuw nsw i32 %38, 3
  %narrow = add nuw nsw i32 %40, 24
  %41 = zext nneg i32 %narrow to i64
  %42 = alloca i8, i64 %41, align 16
  %43 = getelementptr inbounds i8, ptr %42, i64 24
  store ptr %43, ptr %42, align 16, !tbaa !15
  %44 = getelementptr inbounds i8, ptr %36, i64 8
  %45 = getelementptr inbounds i8, ptr %42, i64 8
  %46 = load <2 x i32>, ptr %44, align 8, !tbaa !16
  store <2 x i32> %46, ptr %45, align 8, !tbaa !16
  %47 = getelementptr inbounds i8, ptr %42, i64 16
  store i32 %38, ptr %47, align 16, !tbaa !14
  %48 = getelementptr inbounds i8, ptr %42, i64 20
  store i8 1, ptr %48, align 4, !tbaa !17
  %49 = load ptr, ptr %36, align 8, !tbaa !15
  %50 = shl nuw nsw i32 %38, 3
  %51 = zext nneg i32 %50 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %43, ptr align 8 %49, i64 %51, i1 false)
  br label %57

52:                                               ; preds = %34
  %53 = tail call ptr @MatNd_clone(ptr noundef nonnull %36)
  %.not91 = icmp eq ptr %53, null
  br i1 %.not91, label %54, label %57

54:                                               ; preds = %52
  %55 = load ptr, ptr @stderr, align 8, !tbaa !13
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_insertRows, i32 noundef 1480, ptr noundef nonnull @.str.119) #5
  tail call void @print_trace() #6
  tail call void @abort() #7
  unreachable

57:                                               ; preds = %.thread, %52
  %.094 = phi ptr [ %42, %.thread ], [ %53, %52 ]
  %58 = icmp eq i32 %1, -1
  br i1 %58, label %59, label %74

59:                                               ; preds = %57
  %60 = load ptr, ptr %.094, align 8, !tbaa !15
  %61 = load ptr, ptr %2, align 8, !tbaa !15
  %62 = mul nsw i32 %7, %3
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds double, ptr %61, i64 %63
  %65 = mul i32 %7, %4
  %66 = zext i32 %65 to i64
  %67 = shl nuw nsw i64 %66, 3
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %60, ptr align 8 %64, i64 %67, i1 false)
  %68 = load ptr, ptr %.094, align 8, !tbaa !15
  %69 = getelementptr inbounds double, ptr %68, i64 %66
  %70 = load ptr, ptr %36, align 8, !tbaa !15
  %71 = mul nsw i32 %9, %7
  %72 = sext i32 %71 to i64
  %73 = shl nsw i64 %72, 3
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %69, ptr align 8 %70, i64 %73, i1 false)
  br label %123

74:                                               ; preds = %57
  %75 = add nsw i32 %9, -1
  %76 = icmp eq i32 %75, %1
  br i1 %76, label %77, label %89

77:                                               ; preds = %74
  %78 = load ptr, ptr %.094, align 8, !tbaa !15
  %79 = mul nsw i32 %9, %7
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds double, ptr %78, i64 %80
  %82 = load ptr, ptr %2, align 8, !tbaa !15
  %83 = mul nsw i32 %7, %3
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds double, ptr %82, i64 %84
  %86 = mul i32 %7, %4
  %87 = zext i32 %86 to i64
  %88 = shl nuw nsw i64 %87, 3
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %81, ptr align 8 %85, i64 %88, i1 false)
  br label %123

89:                                               ; preds = %74
  %90 = icmp sle i32 %9, %1
  %91 = icmp slt i32 %1, -1
  %or.cond = or i1 %91, %90
  br i1 %or.cond, label %92, label %99

92:                                               ; preds = %89
  %93 = load ptr, ptr @stderr, align 8, !tbaa !13
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %93, ptr noundef nonnull @.str.91, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_insertRows, i32 noundef 1500) #5
  %95 = load ptr, ptr @stderr, align 8, !tbaa !13
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef nonnull @.str.120, i32 noundef %1, i32 noundef %9, i32 noundef %75) #5
  %97 = load ptr, ptr @stderr, align 8, !tbaa !13
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef nonnull @.str.4) #5
  call void @print_trace() #6
  call void @exit(i32 noundef 1) #7
  unreachable

99:                                               ; preds = %89
  %100 = add nuw nsw i32 %1, 1
  %101 = mul nsw i32 %7, %100
  %102 = load ptr, ptr %.094, align 8, !tbaa !15
  %103 = sext i32 %101 to i64
  %104 = getelementptr inbounds double, ptr %102, i64 %103
  %105 = load ptr, ptr %2, align 8, !tbaa !15
  %106 = mul nsw i32 %7, %3
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds double, ptr %105, i64 %107
  %109 = mul i32 %7, %4
  %110 = zext i32 %109 to i64
  %111 = shl nuw nsw i64 %110, 3
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %104, ptr align 8 %108, i64 %111, i1 false)
  %112 = add i32 %101, %109
  %113 = load ptr, ptr %.094, align 8, !tbaa !15
  %114 = sext i32 %112 to i64
  %115 = getelementptr inbounds double, ptr %113, i64 %114
  %116 = load ptr, ptr %36, align 8, !tbaa !15
  %117 = getelementptr inbounds double, ptr %116, i64 %103
  %118 = xor i32 %1, -1
  %119 = add i32 %9, %118
  %120 = mul nsw i32 %119, %7
  %121 = sext i32 %120 to i64
  %122 = shl nsw i64 %121, 3
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %115, ptr align 8 %117, i64 %122, i1 false)
  br label %123

123:                                              ; preds = %77, %99, %59
  call void @MatNd_copy(ptr noundef nonnull %36, ptr noundef nonnull %.094)
  call void @MatNd_destroy(ptr noundef nonnull %.094)
  ret void
}

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 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { cold nounwind }
attributes #6 = { nounwind }
attributes #7 = { 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, !10, i64 12}
!6 = !{!"_MatNd", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 20}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!6, !10, i64 8}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !10, i64 16}
!15 = !{!6, !7, i64 0}
!16 = !{!10, !10, i64 0}
!17 = !{!6, !11, i64 20}


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