; LLVM IR from Chasmiccoder/Algos-for-Amigos :: Computer-Science/1-DSA-Fundamentals (p06_convolution_with_image_and_kernel)

; 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.node = type { i32, ptr }
%struct.Matrix = type { i32, i32, ptr }

@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [38 x i8], align 1

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

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

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

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

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca [3 x i32], align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %20 = call noalias ptr @fopen(ptr noundef @.str.5, ptr noundef @.str.6)
  store ptr %20, ptr %2, align 8, !tbaa !5
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %25

23:                                               ; preds = %0
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  call void @exit(i32 noundef -1) #7
  unreachable

25:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %26 = call noalias ptr @malloc(i64 noundef 16) #8
  store ptr %26, ptr %3, align 8, !tbaa !5
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.node, ptr %27, i32 0, i32 0
  store i32 0, ptr %28, align 8, !tbaa !9
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.node, ptr %29, i32 0, i32 1
  store ptr null, ptr %30, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !13
  br label %31

31:                                               ; preds = %35, %25
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %32, ptr noundef @.str.8, ptr noundef %4)
  %34 = icmp ne i32 %33, -1
  br i1 %34, label %35, label %38

35:                                               ; preds = %31
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = load i32, ptr %4, align 4, !tbaa !13
  call void @insert(ptr noundef %36, i32 noundef %37)
  br label %31, !llvm.loop !14

38:                                               ; preds = %31
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = load i32, ptr %4, align 4, !tbaa !13
  call void @insert(ptr noundef %39, i32 noundef %40)
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = call i32 @fclose(ptr noundef %41)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %43, ptr %5, align 8, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.node, ptr %44, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !12
  store ptr %46, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %47 = call noalias ptr @malloc(i64 noundef 16) #8
  store ptr %47, ptr %7, align 8, !tbaa !5
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.node, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !9
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.Matrix, ptr %51, i32 0, i32 0
  store i32 %50, ptr %52, align 8, !tbaa !16
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.node, ptr %53, i32 0, i32 1
  %55 = load ptr, ptr %54, align 8, !tbaa !12
  store ptr %55, ptr %5, align 8, !tbaa !5
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.node, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 8, !tbaa !9
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.Matrix, ptr %59, i32 0, i32 1
  store i32 %58, ptr %60, align 4, !tbaa !18
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.node, ptr %61, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !12
  store ptr %63, ptr %5, align 8, !tbaa !5
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.node, ptr %64, i32 0, i32 1
  %66 = load ptr, ptr %65, align 8, !tbaa !12
  store ptr %66, ptr %5, align 8, !tbaa !5
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.Matrix, ptr %68, i32 0, i32 0
  %70 = load i32, ptr %69, align 8, !tbaa !16
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.Matrix, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 4, !tbaa !18
  call void @matrixDeclaration(ptr noundef %67, i32 noundef %70, i32 noundef %73)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %74

74:                                               ; preds = %116, %38
  %75 = load i32, ptr %8, align 4, !tbaa !13
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.Matrix, ptr %76, i32 0, i32 0
  %78 = load i32, ptr %77, align 8, !tbaa !16
  %79 = icmp slt i32 %75, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %74
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %119

81:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !13
  br label %82

82:                                               ; preds = %112, %81
  %83 = load i32, ptr %10, align 4, !tbaa !13
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.Matrix, ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !18
  %87 = icmp slt i32 %83, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %82
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %115

89:                                               ; preds = %82
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.node, ptr %90, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !12
  store ptr %92, ptr %5, align 8, !tbaa !5
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.node, ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %94, align 8, !tbaa !12
  store ptr %95, ptr %5, align 8, !tbaa !5
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.node, ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 8, !tbaa !9
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.Matrix, ptr %99, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !19
  %102 = load i32, ptr %8, align 4, !tbaa !13
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds ptr, ptr %101, i64 %103
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = load i32, ptr %10, align 4, !tbaa !13
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %105, i64 %107
  store i32 %98, ptr %108, align 4, !tbaa !13
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.node, ptr %109, i32 0, i32 1
  %111 = load ptr, ptr %110, align 8, !tbaa !12
  store ptr %111, ptr %5, align 8, !tbaa !5
  br label %112

112:                                              ; preds = %89
  %113 = load i32, ptr %10, align 4, !tbaa !13
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %10, align 4, !tbaa !13
  br label %82, !llvm.loop !20

115:                                              ; preds = %88
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %8, align 4, !tbaa !13
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %8, align 4, !tbaa !13
  br label %74, !llvm.loop !21

119:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %120 = call noalias ptr @malloc(i64 noundef 16) #8
  store ptr %120, ptr %11, align 8, !tbaa !5
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.node, ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 8, !tbaa !9
  %124 = load ptr, ptr %11, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.Matrix, ptr %124, i32 0, i32 0
  store i32 %123, ptr %125, align 8, !tbaa !16
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.node, ptr %126, i32 0, i32 1
  %128 = load ptr, ptr %127, align 8, !tbaa !12
  store ptr %128, ptr %5, align 8, !tbaa !5
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.node, ptr %129, i32 0, i32 0
  %131 = load i32, ptr %130, align 8, !tbaa !9
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.Matrix, ptr %132, i32 0, i32 1
  store i32 %131, ptr %133, align 4, !tbaa !18
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.node, ptr %134, i32 0, i32 1
  %136 = load ptr, ptr %135, align 8, !tbaa !12
  store ptr %136, ptr %5, align 8, !tbaa !5
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.node, ptr %137, i32 0, i32 1
  %139 = load ptr, ptr %138, align 8, !tbaa !12
  store ptr %139, ptr %5, align 8, !tbaa !5
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.Matrix, ptr %141, i32 0, i32 0
  %143 = load i32, ptr %142, align 8, !tbaa !16
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.Matrix, ptr %144, i32 0, i32 1
  %146 = load i32, ptr %145, align 4, !tbaa !18
  call void @matrixDeclaration(ptr noundef %140, i32 noundef %143, i32 noundef %146)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !13
  br label %147

147:                                              ; preds = %189, %119
  %148 = load i32, ptr %12, align 4, !tbaa !13
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.Matrix, ptr %149, i32 0, i32 0
  %151 = load i32, ptr %150, align 8, !tbaa !16
  %152 = icmp slt i32 %148, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %147
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %192

154:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !13
  br label %155

155:                                              ; preds = %185, %154
  %156 = load i32, ptr %13, align 4, !tbaa !13
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.Matrix, ptr %157, i32 0, i32 1
  %159 = load i32, ptr %158, align 4, !tbaa !18
  %160 = icmp slt i32 %156, %159
  br i1 %160, label %162, label %161

161:                                              ; preds = %155
  store i32 13, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %188

162:                                              ; preds = %155
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.node, ptr %163, i32 0, i32 1
  %165 = load ptr, ptr %164, align 8, !tbaa !12
  store ptr %165, ptr %5, align 8, !tbaa !5
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.node, ptr %166, i32 0, i32 1
  %168 = load ptr, ptr %167, align 8, !tbaa !12
  store ptr %168, ptr %5, align 8, !tbaa !5
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.node, ptr %169, i32 0, i32 0
  %171 = load i32, ptr %170, align 8, !tbaa !9
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.Matrix, ptr %172, i32 0, i32 2
  %174 = load ptr, ptr %173, align 8, !tbaa !19
  %175 = load i32, ptr %12, align 4, !tbaa !13
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds ptr, ptr %174, i64 %176
  %178 = load ptr, ptr %177, align 8, !tbaa !5
  %179 = load i32, ptr %13, align 4, !tbaa !13
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds i32, ptr %178, i64 %180
  store i32 %171, ptr %181, align 4, !tbaa !13
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.node, ptr %182, i32 0, i32 1
  %184 = load ptr, ptr %183, align 8, !tbaa !12
  store ptr %184, ptr %5, align 8, !tbaa !5
  br label %185

185:                                              ; preds = %162
  %186 = load i32, ptr %13, align 4, !tbaa !13
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %13, align 4, !tbaa !13
  br label %155, !llvm.loop !22

188:                                              ; preds = %161
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %12, align 4, !tbaa !13
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %12, align 4, !tbaa !13
  br label %147, !llvm.loop !23

192:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %193 = call noalias ptr @malloc(i64 noundef 16) #8
  store ptr %193, ptr %14, align 8, !tbaa !5
  %194 = load ptr, ptr %11, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.Matrix, ptr %194, i32 0, i32 0
  %196 = load i32, ptr %195, align 8, !tbaa !16
  %197 = load ptr, ptr %14, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.Matrix, ptr %197, i32 0, i32 0
  store i32 %196, ptr %198, align 8, !tbaa !16
  %199 = load ptr, ptr %11, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.Matrix, ptr %199, i32 0, i32 1
  %201 = load i32, ptr %200, align 4, !tbaa !18
  %202 = load ptr, ptr %14, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.Matrix, ptr %202, i32 0, i32 1
  store i32 %201, ptr %203, align 4, !tbaa !18
  %204 = load ptr, ptr %14, align 8, !tbaa !5
  %205 = load ptr, ptr %14, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.Matrix, ptr %205, i32 0, i32 0
  %207 = load i32, ptr %206, align 8, !tbaa !16
  %208 = load ptr, ptr %14, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.Matrix, ptr %208, i32 0, i32 1
  %210 = load i32, ptr %209, align 4, !tbaa !18
  call void @matrixDeclaration(ptr noundef %204, i32 noundef %207, i32 noundef %210)
  %211 = load ptr, ptr %11, align 8, !tbaa !5
  %212 = load ptr, ptr %7, align 8, !tbaa !5
  %213 = load ptr, ptr %14, align 8, !tbaa !5
  call void @perform_convolution(ptr noundef %211, ptr noundef %212, ptr noundef %213)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %214 = call noalias ptr @fopen(ptr noundef @.str.9, ptr noundef @.str.10)
  store ptr %214, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !13
  br label %215

215:                                              ; preds = %250, %192
  %216 = load i32, ptr %16, align 4, !tbaa !13
  %217 = load ptr, ptr %14, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.Matrix, ptr %217, i32 0, i32 0
  %219 = load i32, ptr %218, align 8, !tbaa !16
  %220 = icmp slt i32 %216, %219
  br i1 %220, label %222, label %221

221:                                              ; preds = %215
  store i32 16, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %253

222:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !13
  br label %223

223:                                              ; preds = %244, %222
  %224 = load i32, ptr %17, align 4, !tbaa !13
  %225 = load ptr, ptr %14, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.Matrix, ptr %225, i32 0, i32 1
  %227 = load i32, ptr %226, align 4, !tbaa !18
  %228 = icmp slt i32 %224, %227
  br i1 %228, label %230, label %229

229:                                              ; preds = %223
  store i32 19, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %247

230:                                              ; preds = %223
  %231 = load ptr, ptr %15, align 8, !tbaa !5
  %232 = load ptr, ptr %14, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.Matrix, ptr %232, i32 0, i32 2
  %234 = load ptr, ptr %233, align 8, !tbaa !19
  %235 = load i32, ptr %16, align 4, !tbaa !13
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds ptr, ptr %234, i64 %236
  %238 = load ptr, ptr %237, align 8, !tbaa !5
  %239 = load i32, ptr %17, align 4, !tbaa !13
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds i32, ptr %238, i64 %240
  %242 = load i32, ptr %241, align 4, !tbaa !13
  %243 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %231, ptr noundef @.str.2, i32 noundef %242) #6
  br label %244

244:                                              ; preds = %230
  %245 = load i32, ptr %17, align 4, !tbaa !13
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %17, align 4, !tbaa !13
  br label %223, !llvm.loop !24

247:                                              ; preds = %229
  %248 = load ptr, ptr %15, align 8, !tbaa !5
  %249 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %248, ptr noundef @.str.3) #6
  br label %250

250:                                              ; preds = %247
  %251 = load i32, ptr %16, align 4, !tbaa !13
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %16, align 4, !tbaa !13
  br label %215, !llvm.loop !25

253:                                              ; preds = %221
  %254 = load ptr, ptr %15, align 8, !tbaa !5
  %255 = call i32 @fclose(ptr noundef %254)
  %256 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %256) #6
  %257 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %257) #6
  %258 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %258) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %259 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %259, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %260 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %260, ptr %19, align 8, !tbaa !5
  br label %261

261:                                              ; preds = %266, %253
  %262 = load ptr, ptr %18, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.node, ptr %262, i32 0, i32 1
  %264 = load ptr, ptr %263, align 8, !tbaa !12
  %265 = icmp ne ptr %264, null
  br i1 %265, label %266, label %272

266:                                              ; preds = %261
  %267 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %267, ptr %19, align 8, !tbaa !5
  %268 = load ptr, ptr %18, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.node, ptr %268, i32 0, i32 1
  %270 = load ptr, ptr %269, align 8, !tbaa !12
  store ptr %270, ptr %18, align 8, !tbaa !5
  %271 = load ptr, ptr %19, align 8, !tbaa !5
  call void @free(ptr noundef %271) #6
  br label %261, !llvm.loop !26

272:                                              ; preds = %261
  %273 = load ptr, ptr %18, align 8, !tbaa !5
  call void @free(ptr noundef %273) #6
  %274 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %275 = load i32, ptr %1, align 4
  ret i32 %275
}

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

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

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) #3

declare i32 @fclose(ptr noundef) #3

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

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

!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 0}
!10 = !{!"node", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!11, !11, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !11, i64 0}
!17 = !{!"Matrix", !11, i64 0, !11, i64 4, !6, i64 8}
!18 = !{!17, !11, i64 4}
!19 = !{!17, !6, i64 8}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}
!24 = distinct !{!24, !15}
!25 = distinct !{!25, !15}
!26 = distinct !{!26, !15}


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

@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [38 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6)
  %3 = icmp eq ptr %2, null
  br i1 %3, label %4, label %6

4:                                                ; preds = %0
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  tail call void @exit(i32 noundef -1) #7
  unreachable

6:                                                ; preds = %0
  %7 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #8
  store i32 0, ptr %7, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr null, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  store i32 0, ptr %1, align 4, !tbaa !12
  %9 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %2, ptr noundef nonnull @.str.8, ptr noundef nonnull %1) #9
  %.not99 = icmp eq i32 %9, -1
  br i1 %.not99, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %6, %.lr.ph
  %10 = load i32, ptr %1, align 4, !tbaa !12
  call void @insert(ptr noundef nonnull %7, i32 noundef %10)
  %11 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %2, ptr noundef nonnull @.str.8, ptr noundef nonnull %1) #9
  %.not = icmp eq i32 %11, -1
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %6
  %12 = load i32, ptr %1, align 4, !tbaa !12
  call void @insert(ptr noundef nonnull %7, i32 noundef %12)
  %13 = call i32 @fclose(ptr noundef nonnull %2)
  %14 = load ptr, ptr %8, align 8, !tbaa !11
  %15 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #8
  %16 = load i32, ptr %14, align 8, !tbaa !5
  store i32 %16, ptr %15, align 8, !tbaa !15
  %17 = getelementptr inbounds i8, ptr %14, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = load i32, ptr %18, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %15, i64 4
  store i32 %19, ptr %20, align 4, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %18, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  call void @matrixDeclaration(ptr noundef nonnull %15, i32 noundef %16, i32 noundef %19)
  %25 = load i32, ptr %15, align 8, !tbaa !15
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.preheader98.lr.ph, label %._crit_edge106

.preheader98.lr.ph:                               ; preds = %._crit_edge
  %27 = getelementptr inbounds i8, ptr %15, i64 8
  %28 = load i32, ptr %20, align 4, !tbaa !17
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.preheader98, label %._crit_edge106

.preheader98:                                     ; preds = %.preheader98.lr.ph, %._crit_edge103
  %30 = phi i32 [ %50, %._crit_edge103 ], [ %25, %.preheader98.lr.ph ]
  %31 = phi i32 [ %51, %._crit_edge103 ], [ %28, %.preheader98.lr.ph ]
  %indvars.iv136 = phi i64 [ %indvars.iv.next137, %._crit_edge103 ], [ 0, %.preheader98.lr.ph ]
  %.089105 = phi ptr [ %.1.lcssa, %._crit_edge103 ], [ %24, %.preheader98.lr.ph ]
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph102, label %._crit_edge103

.lr.ph102:                                        ; preds = %.preheader98
  %33 = load ptr, ptr %27, align 8, !tbaa !18
  %34 = getelementptr inbounds ptr, ptr %33, i64 %indvars.iv136
  %35 = load ptr, ptr %34, align 8, !tbaa !19
  br label %54

._crit_edge106:                                   ; preds = %._crit_edge103, %.preheader98.lr.ph, %._crit_edge
  %.089.lcssa = phi ptr [ %24, %._crit_edge ], [ %24, %.preheader98.lr.ph ], [ %.1.lcssa, %._crit_edge103 ]
  %36 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #8
  %37 = load i32, ptr %.089.lcssa, align 8, !tbaa !5
  store i32 %37, ptr %36, align 8, !tbaa !15
  %38 = getelementptr inbounds i8, ptr %.089.lcssa, i64 8
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = load i32, ptr %39, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %36, i64 4
  store i32 %40, ptr %41, align 4, !tbaa !17
  %42 = getelementptr inbounds i8, ptr %39, i64 8
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  %44 = getelementptr inbounds i8, ptr %43, i64 8
  %45 = load ptr, ptr %44, align 8, !tbaa !11
  call void @matrixDeclaration(ptr noundef nonnull %36, i32 noundef %37, i32 noundef %40)
  %46 = load i32, ptr %36, align 8, !tbaa !15
  %47 = icmp sgt i32 %46, 0
  %.pre152 = load i32, ptr %41, align 4, !tbaa !17
  br i1 %47, label %.preheader97.lr.ph, label %._crit_edge115

.preheader97.lr.ph:                               ; preds = %._crit_edge106
  %48 = getelementptr inbounds i8, ptr %36, i64 8
  %49 = icmp sgt i32 %.pre152, 0
  br i1 %49, label %.preheader97, label %._crit_edge115

._crit_edge103.loopexit:                          ; preds = %54
  %.pre = load i32, ptr %15, align 8, !tbaa !15
  br label %._crit_edge103

._crit_edge103:                                   ; preds = %._crit_edge103.loopexit, %.preheader98
  %50 = phi i32 [ %30, %.preheader98 ], [ %.pre, %._crit_edge103.loopexit ]
  %51 = phi i32 [ %31, %.preheader98 ], [ %63, %._crit_edge103.loopexit ]
  %.1.lcssa = phi ptr [ %.089105, %.preheader98 ], [ %62, %._crit_edge103.loopexit ]
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %52 = sext i32 %50 to i64
  %53 = icmp slt i64 %indvars.iv.next137, %52
  br i1 %53, label %.preheader98, label %._crit_edge106, !llvm.loop !20

54:                                               ; preds = %.lr.ph102, %54
  %indvars.iv = phi i64 [ 0, %.lr.ph102 ], [ %indvars.iv.next, %54 ]
  %.1101 = phi ptr [ %.089105, %.lr.ph102 ], [ %62, %54 ]
  %55 = getelementptr inbounds i8, ptr %.1101, i64 8
  %56 = load ptr, ptr %55, align 8, !tbaa !11
  %57 = getelementptr inbounds i8, ptr %56, i64 8
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  %59 = load i32, ptr %58, align 8, !tbaa !5
  %60 = getelementptr inbounds i32, ptr %35, i64 %indvars.iv
  store i32 %59, ptr %60, align 4, !tbaa !12
  %61 = getelementptr inbounds i8, ptr %58, i64 8
  %62 = load ptr, ptr %61, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %63 = load i32, ptr %20, align 4, !tbaa !17
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %indvars.iv.next, %64
  br i1 %65, label %54, label %._crit_edge103.loopexit, !llvm.loop !22

.preheader97:                                     ; preds = %.preheader97.lr.ph, %._crit_edge111
  %66 = phi i32 [ %79, %._crit_edge111 ], [ %46, %.preheader97.lr.ph ]
  %67 = phi i32 [ %80, %._crit_edge111 ], [ %.pre152, %.preheader97.lr.ph ]
  %indvars.iv142 = phi i64 [ %indvars.iv.next143, %._crit_edge111 ], [ 0, %.preheader97.lr.ph ]
  %.2114 = phi ptr [ %.3.lcssa, %._crit_edge111 ], [ %45, %.preheader97.lr.ph ]
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %.lr.ph110, label %._crit_edge111

.lr.ph110:                                        ; preds = %.preheader97
  %69 = load ptr, ptr %48, align 8, !tbaa !18
  %70 = getelementptr inbounds ptr, ptr %69, i64 %indvars.iv142
  %71 = load ptr, ptr %70, align 8, !tbaa !19
  br label %83

._crit_edge115:                                   ; preds = %._crit_edge111, %.preheader97.lr.ph, %._crit_edge106
  %72 = phi i32 [ %.pre152, %._crit_edge106 ], [ %.pre152, %.preheader97.lr.ph ], [ %80, %._crit_edge111 ]
  %.lcssa = phi i32 [ %46, %._crit_edge106 ], [ %46, %.preheader97.lr.ph ], [ %79, %._crit_edge111 ]
  %73 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #8
  store i32 %.lcssa, ptr %73, align 8, !tbaa !15
  %74 = getelementptr inbounds i8, ptr %73, i64 4
  store i32 %72, ptr %74, align 4, !tbaa !17
  call void @matrixDeclaration(ptr noundef nonnull %73, i32 noundef %.lcssa, i32 noundef %72)
  call void @perform_convolution(ptr noundef nonnull %36, ptr noundef nonnull %15, ptr noundef nonnull %73)
  %75 = call noalias ptr @fopen(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.10)
  %76 = load i32, ptr %73, align 8, !tbaa !15
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %.preheader.lr.ph, label %._crit_edge122

.preheader.lr.ph:                                 ; preds = %._crit_edge115
  %78 = getelementptr inbounds i8, ptr %73, i64 8
  br label %.preheader

._crit_edge111.loopexit:                          ; preds = %83
  %.pre151 = load i32, ptr %36, align 8, !tbaa !15
  br label %._crit_edge111

._crit_edge111:                                   ; preds = %._crit_edge111.loopexit, %.preheader97
  %79 = phi i32 [ %66, %.preheader97 ], [ %.pre151, %._crit_edge111.loopexit ]
  %80 = phi i32 [ %67, %.preheader97 ], [ %92, %._crit_edge111.loopexit ]
  %.3.lcssa = phi ptr [ %.2114, %.preheader97 ], [ %91, %._crit_edge111.loopexit ]
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %81 = sext i32 %79 to i64
  %82 = icmp slt i64 %indvars.iv.next143, %81
  br i1 %82, label %.preheader97, label %._crit_edge115, !llvm.loop !23

83:                                               ; preds = %.lr.ph110, %83
  %indvars.iv139 = phi i64 [ 0, %.lr.ph110 ], [ %indvars.iv.next140, %83 ]
  %.3109 = phi ptr [ %.2114, %.lr.ph110 ], [ %91, %83 ]
  %84 = getelementptr inbounds i8, ptr %.3109, i64 8
  %85 = load ptr, ptr %84, align 8, !tbaa !11
  %86 = getelementptr inbounds i8, ptr %85, i64 8
  %87 = load ptr, ptr %86, align 8, !tbaa !11
  %88 = load i32, ptr %87, align 8, !tbaa !5
  %89 = getelementptr inbounds i32, ptr %71, i64 %indvars.iv139
  store i32 %88, ptr %89, align 4, !tbaa !12
  %90 = getelementptr inbounds i8, ptr %87, i64 8
  %91 = load ptr, ptr %90, align 8, !tbaa !11
  %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
  %92 = load i32, ptr %41, align 4, !tbaa !17
  %93 = sext i32 %92 to i64
  %94 = icmp slt i64 %indvars.iv.next140, %93
  br i1 %94, label %83, label %._crit_edge111.loopexit, !llvm.loop !24

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge120
  %indvars.iv148 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next149, %._crit_edge120 ]
  %95 = load i32, ptr %74, align 4, !tbaa !17
  %96 = icmp sgt i32 %95, 0
  br i1 %96, label %.lr.ph119, label %._crit_edge120

._crit_edge122:                                   ; preds = %._crit_edge120, %._crit_edge115
  %97 = call i32 @fclose(ptr noundef %75)
  call void @free(ptr noundef %36) #9
  call void @free(ptr noundef %15) #9
  call void @free(ptr noundef nonnull %73) #9
  %98 = load ptr, ptr %8, align 8, !tbaa !11
  %.not96123 = icmp eq ptr %98, null
  br i1 %.not96123, label %._crit_edge127, label %.lr.ph126

._crit_edge120:                                   ; preds = %.lr.ph119, %.preheader
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef nonnull @.str.3) #9
  %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1
  %100 = load i32, ptr %73, align 8, !tbaa !15
  %101 = sext i32 %100 to i64
  %102 = icmp slt i64 %indvars.iv.next149, %101
  br i1 %102, label %.preheader, label %._crit_edge122, !llvm.loop !25

.lr.ph119:                                        ; preds = %.preheader, %.lr.ph119
  %indvars.iv145 = phi i64 [ %indvars.iv.next146, %.lr.ph119 ], [ 0, %.preheader ]
  %103 = load ptr, ptr %78, align 8, !tbaa !18
  %104 = getelementptr inbounds ptr, ptr %103, i64 %indvars.iv148
  %105 = load ptr, ptr %104, align 8, !tbaa !19
  %106 = getelementptr inbounds i32, ptr %105, i64 %indvars.iv145
  %107 = load i32, ptr %106, align 4, !tbaa !12
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef nonnull @.str.2, i32 noundef %107) #9
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %109 = load i32, ptr %74, align 4, !tbaa !17
  %110 = sext i32 %109 to i64
  %111 = icmp slt i64 %indvars.iv.next146, %110
  br i1 %111, label %.lr.ph119, label %._crit_edge120, !llvm.loop !26

.lr.ph126:                                        ; preds = %._crit_edge122, %.lr.ph126
  %112 = phi ptr [ %114, %.lr.ph126 ], [ %98, %._crit_edge122 ]
  %.0124 = phi ptr [ %112, %.lr.ph126 ], [ %7, %._crit_edge122 ]
  call void @free(ptr noundef nonnull %.0124) #9
  %113 = getelementptr inbounds i8, ptr %112, i64 8
  %114 = load ptr, ptr %113, align 8, !tbaa !11
  %.not96 = icmp eq ptr %114, null
  br i1 %.not96, label %._crit_edge127, label %.lr.ph126, !llvm.loop !27

._crit_edge127:                                   ; preds = %.lr.ph126, %._crit_edge122
  %.0.lcssa = phi ptr [ %7, %._crit_edge122 ], [ %112, %.lr.ph126 ]
  call void @free(ptr noundef nonnull %.0.lcssa) #9
  %115 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

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

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #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 = { "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { noreturn nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { 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, !7, i64 0}
!6 = !{!"node", !7, i64 0, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !7, i64 0}
!16 = !{!"Matrix", !7, i64 0, !7, i64 4, !10, i64 8}
!17 = !{!16, !7, i64 4}
!18 = !{!16, !10, i64 8}
!19 = !{!10, !10, i64 0}
!20 = distinct !{!20, !14, !21}
!21 = !{!"llvm.loop.unswitch.partial.disable"}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14, !21}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}
!27 = distinct !{!27, !14}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass