; LLVM IR from YanzhenHuang/c-nn :: xlinalg (xmat_solve)

; 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.Matrix = type { i64, i64, ptr }

@stderr = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [87 x i8], align 1

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

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

declare void @mat_write(ptr noundef, i64 noundef, i64 noundef, double noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @xmat_submat(ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #2

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

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

declare double @mat_read(ptr noundef, i64 noundef, i64 noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @xmat_solve(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca i64, align 8
  %10 = alloca double, align 8
  %11 = alloca i64, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca i64, align 8
  %15 = alloca double, align 8
  %16 = alloca i64, align 8
  %17 = alloca double, align 8
  %18 = alloca i64, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca i64, align 8
  %22 = alloca double, align 8
  %23 = alloca i64, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.Matrix, ptr %27, i32 0, i32 1
  %29 = load i64, ptr %28, align 8, !tbaa !9
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.Matrix, ptr %30, i32 0, i32 0
  %32 = load i64, ptr %31, align 8, !tbaa !12
  %33 = icmp ne i64 %29, %32
  br i1 %33, label %34, label %49

34:                                               ; preds = %2
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.Matrix, ptr %36, i32 0, i32 0
  %38 = load i64, ptr %37, align 8, !tbaa !12
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.Matrix, ptr %39, i32 0, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.Matrix, ptr %42, i32 0, i32 0
  %44 = load i64, ptr %43, align 8, !tbaa !12
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.Matrix, ptr %45, i32 0, i32 1
  %47 = load i64, ptr %46, align 8, !tbaa !9
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.8, i64 noundef %38, i64 noundef %41, i64 noundef %44, i64 noundef %47) #6
  call void @exit(i32 noundef 1) #7
  unreachable

49:                                               ; preds = %2
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.Matrix, ptr %50, i32 0, i32 1
  %52 = load i64, ptr %51, align 8, !tbaa !9
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.Matrix, ptr %53, i32 0, i32 0
  %55 = load i64, ptr %54, align 8, !tbaa !12
  %56 = icmp slt i64 %52, %55
  br i1 %56, label %57, label %60

57:                                               ; preds = %49
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.9) #6
  call void @exit(i32 noundef 1) #7
  unreachable

60:                                               ; preds = %49
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.Matrix, ptr %61, i32 0, i32 1
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.Matrix, ptr %64, i32 0, i32 0
  %66 = load i64, ptr %65, align 8, !tbaa !12
  %67 = icmp sgt i64 %63, %66
  br i1 %67, label %68, label %71

68:                                               ; preds = %60
  %69 = load ptr, ptr @stderr, align 8, !tbaa !5
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef @.str.10) #6
  call void @exit(i32 noundef 1) #7
  unreachable

71:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = call ptr @xmat_hstack(ptr noundef %72, ptr noundef %73)
  store ptr %74, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !13
  br label %75

75:                                               ; preds = %146, %71
  %76 = load i64, ptr %6, align 8, !tbaa !13
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.Matrix, ptr %77, i32 0, i32 0
  %79 = load i64, ptr %78, align 8, !tbaa !12
  %80 = icmp slt i64 %76, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %75
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %149

82:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = load i64, ptr %6, align 8, !tbaa !13
  %85 = load i64, ptr %6, align 8, !tbaa !13
  %86 = call double @mat_read(ptr noundef %83, i64 noundef %84, i64 noundef %85)
  store double %86, ptr %8, align 8, !tbaa !14
  %87 = load double, ptr %8, align 8, !tbaa !14
  %88 = fcmp oeq double %87, 0.000000e+00
  br i1 %88, label %89, label %93

89:                                               ; preds = %82
  %90 = load ptr, ptr @stderr, align 8, !tbaa !5
  %91 = load i64, ptr %6, align 8, !tbaa !13
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str.11, i64 noundef %91) #6
  call void @exit(i32 noundef 1) #7
  unreachable

93:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %94 = load i64, ptr %6, align 8, !tbaa !13
  %95 = add nsw i64 %94, 1
  store i64 %95, ptr %9, align 8, !tbaa !13
  br label %96

96:                                               ; preds = %142, %93
  %97 = load i64, ptr %9, align 8, !tbaa !13
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.Matrix, ptr %98, i32 0, i32 0
  %100 = load i64, ptr %99, align 8, !tbaa !12
  %101 = icmp slt i64 %97, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %96
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %145

103:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = load i64, ptr %9, align 8, !tbaa !13
  %106 = load i64, ptr %6, align 8, !tbaa !13
  %107 = call double @mat_read(ptr noundef %104, i64 noundef %105, i64 noundef %106)
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = load i64, ptr %6, align 8, !tbaa !13
  %110 = load i64, ptr %6, align 8, !tbaa !13
  %111 = call double @mat_read(ptr noundef %108, i64 noundef %109, i64 noundef %110)
  %112 = fdiv double %107, %111
  store double %112, ptr %10, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %113 = load i64, ptr %6, align 8, !tbaa !13
  store i64 %113, ptr %11, align 8, !tbaa !13
  br label %114

114:                                              ; preds = %138, %103
  %115 = load i64, ptr %11, align 8, !tbaa !13
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.Matrix, ptr %116, i32 0, i32 1
  %118 = load i64, ptr %117, align 8, !tbaa !9
  %119 = icmp slt i64 %115, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %114
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %141

121:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = load i64, ptr %9, align 8, !tbaa !13
  %124 = load i64, ptr %11, align 8, !tbaa !13
  %125 = call double @mat_read(ptr noundef %122, i64 noundef %123, i64 noundef %124)
  store double %125, ptr %12, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %126 = load double, ptr %12, align 8, !tbaa !14
  %127 = load double, ptr %10, align 8, !tbaa !14
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = load i64, ptr %6, align 8, !tbaa !13
  %130 = load i64, ptr %11, align 8, !tbaa !13
  %131 = call double @mat_read(ptr noundef %128, i64 noundef %129, i64 noundef %130)
  %132 = fneg double %127
  %133 = call double @llvm.fmuladd.f64(double %132, double %131, double %126)
  store double %133, ptr %13, align 8, !tbaa !14
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = load i64, ptr %9, align 8, !tbaa !13
  %136 = load i64, ptr %11, align 8, !tbaa !13
  %137 = load double, ptr %13, align 8, !tbaa !14
  call void @mat_write(ptr noundef %134, i64 noundef %135, i64 noundef %136, double noundef %137)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %138

138:                                              ; preds = %121
  %139 = load i64, ptr %11, align 8, !tbaa !13
  %140 = add nsw i64 %139, 1
  store i64 %140, ptr %11, align 8, !tbaa !13
  br label %114, !llvm.loop !16

141:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %142

142:                                              ; preds = %141
  %143 = load i64, ptr %9, align 8, !tbaa !13
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %9, align 8, !tbaa !13
  br label %96, !llvm.loop !18

145:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %146

146:                                              ; preds = %145
  %147 = load i64, ptr %6, align 8, !tbaa !13
  %148 = add nsw i64 %147, 1
  store i64 %148, ptr %6, align 8, !tbaa !13
  br label %75, !llvm.loop !19

149:                                              ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.Matrix, ptr %150, i32 0, i32 0
  %152 = load i64, ptr %151, align 8, !tbaa !12
  %153 = sub nsw i64 %152, 1
  store i64 %153, ptr %14, align 8, !tbaa !13
  br label %154

154:                                              ; preds = %219, %149
  %155 = load i64, ptr %14, align 8, !tbaa !13
  %156 = icmp sge i64 %155, 0
  br i1 %156, label %158, label %157

157:                                              ; preds = %154
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %222

158:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = load i64, ptr %14, align 8, !tbaa !13
  %161 = load i64, ptr %14, align 8, !tbaa !13
  %162 = call double @mat_read(ptr noundef %159, i64 noundef %160, i64 noundef %161)
  store double %162, ptr %15, align 8, !tbaa !14
  %163 = load double, ptr %15, align 8, !tbaa !14
  %164 = fcmp oeq double %163, 0.000000e+00
  br i1 %164, label %165, label %169

165:                                              ; preds = %158
  %166 = load ptr, ptr @stderr, align 8, !tbaa !5
  %167 = load i64, ptr %14, align 8, !tbaa !13
  %168 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %166, ptr noundef @.str.12, i64 noundef %167) #6
  call void @exit(i32 noundef 1) #7
  unreachable

169:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %170 = load i64, ptr %14, align 8, !tbaa !13
  %171 = sub nsw i64 %170, 1
  store i64 %171, ptr %16, align 8, !tbaa !13
  br label %172

172:                                              ; preds = %215, %169
  %173 = load i64, ptr %16, align 8, !tbaa !13
  %174 = icmp sge i64 %173, 0
  br i1 %174, label %176, label %175

175:                                              ; preds = %172
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %218

176:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = load i64, ptr %16, align 8, !tbaa !13
  %179 = load i64, ptr %14, align 8, !tbaa !13
  %180 = call double @mat_read(ptr noundef %177, i64 noundef %178, i64 noundef %179)
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = load i64, ptr %14, align 8, !tbaa !13
  %183 = load i64, ptr %14, align 8, !tbaa !13
  %184 = call double @mat_read(ptr noundef %181, i64 noundef %182, i64 noundef %183)
  %185 = fdiv double %180, %184
  store double %185, ptr %17, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %186 = load i64, ptr %14, align 8, !tbaa !13
  store i64 %186, ptr %18, align 8, !tbaa !13
  br label %187

187:                                              ; preds = %211, %176
  %188 = load i64, ptr %18, align 8, !tbaa !13
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.Matrix, ptr %189, i32 0, i32 1
  %191 = load i64, ptr %190, align 8, !tbaa !9
  %192 = icmp slt i64 %188, %191
  br i1 %192, label %194, label %193

193:                                              ; preds = %187
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %214

194:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %195 = load ptr, ptr %5, align 8, !tbaa !5
  %196 = load i64, ptr %16, align 8, !tbaa !13
  %197 = load i64, ptr %18, align 8, !tbaa !13
  %198 = call double @mat_read(ptr noundef %195, i64 noundef %196, i64 noundef %197)
  store double %198, ptr %19, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %199 = load double, ptr %19, align 8, !tbaa !14
  %200 = load double, ptr %17, align 8, !tbaa !14
  %201 = load ptr, ptr %5, align 8, !tbaa !5
  %202 = load i64, ptr %14, align 8, !tbaa !13
  %203 = load i64, ptr %18, align 8, !tbaa !13
  %204 = call double @mat_read(ptr noundef %201, i64 noundef %202, i64 noundef %203)
  %205 = fneg double %200
  %206 = call double @llvm.fmuladd.f64(double %205, double %204, double %199)
  store double %206, ptr %20, align 8, !tbaa !14
  %207 = load ptr, ptr %5, align 8, !tbaa !5
  %208 = load i64, ptr %16, align 8, !tbaa !13
  %209 = load i64, ptr %18, align 8, !tbaa !13
  %210 = load double, ptr %20, align 8, !tbaa !14
  call void @mat_write(ptr noundef %207, i64 noundef %208, i64 noundef %209, double noundef %210)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %211

211:                                              ; preds = %194
  %212 = load i64, ptr %18, align 8, !tbaa !13
  %213 = add nsw i64 %212, 1
  store i64 %213, ptr %18, align 8, !tbaa !13
  br label %187, !llvm.loop !20

214:                                              ; preds = %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %215

215:                                              ; preds = %214
  %216 = load i64, ptr %16, align 8, !tbaa !13
  %217 = add nsw i64 %216, -1
  store i64 %217, ptr %16, align 8, !tbaa !13
  br label %172, !llvm.loop !21

218:                                              ; preds = %175
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %219

219:                                              ; preds = %218
  %220 = load i64, ptr %14, align 8, !tbaa !13
  %221 = add nsw i64 %220, -1
  store i64 %221, ptr %14, align 8, !tbaa !13
  br label %154, !llvm.loop !22

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

223:                                              ; preds = %258, %222
  %224 = load i64, ptr %21, align 8, !tbaa !13
  %225 = load ptr, ptr %5, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.Matrix, ptr %225, i32 0, i32 0
  %227 = load i64, ptr %226, align 8, !tbaa !12
  %228 = icmp slt i64 %224, %227
  br i1 %228, label %230, label %229

229:                                              ; preds = %223
  store i32 20, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %261

230:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %231 = load ptr, ptr %5, align 8, !tbaa !5
  %232 = load i64, ptr %21, align 8, !tbaa !13
  %233 = load i64, ptr %21, align 8, !tbaa !13
  %234 = call double @mat_read(ptr noundef %231, i64 noundef %232, i64 noundef %233)
  store double %234, ptr %22, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store i64 0, ptr %23, align 8, !tbaa !13
  br label %235

235:                                              ; preds = %254, %230
  %236 = load i64, ptr %23, align 8, !tbaa !13
  %237 = load ptr, ptr %5, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.Matrix, ptr %237, i32 0, i32 1
  %239 = load i64, ptr %238, align 8, !tbaa !9
  %240 = icmp slt i64 %236, %239
  br i1 %240, label %242, label %241

241:                                              ; preds = %235
  store i32 23, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %257

242:                                              ; preds = %235
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %243 = load ptr, ptr %5, align 8, !tbaa !5
  %244 = load i64, ptr %21, align 8, !tbaa !13
  %245 = load i64, ptr %23, align 8, !tbaa !13
  %246 = call double @mat_read(ptr noundef %243, i64 noundef %244, i64 noundef %245)
  store double %246, ptr %24, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %247 = load double, ptr %24, align 8, !tbaa !14
  %248 = load double, ptr %22, align 8, !tbaa !14
  %249 = fdiv double %247, %248
  store double %249, ptr %25, align 8, !tbaa !14
  %250 = load ptr, ptr %5, align 8, !tbaa !5
  %251 = load i64, ptr %21, align 8, !tbaa !13
  %252 = load i64, ptr %23, align 8, !tbaa !13
  %253 = load double, ptr %25, align 8, !tbaa !14
  call void @mat_write(ptr noundef %250, i64 noundef %251, i64 noundef %252, double noundef %253)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %254

254:                                              ; preds = %242
  %255 = load i64, ptr %23, align 8, !tbaa !13
  %256 = add nsw i64 %255, 1
  store i64 %256, ptr %23, align 8, !tbaa !13
  br label %235, !llvm.loop !23

257:                                              ; preds = %241
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %258

258:                                              ; preds = %257
  %259 = load i64, ptr %21, align 8, !tbaa !13
  %260 = add nsw i64 %259, 1
  store i64 %260, ptr %21, align 8, !tbaa !13
  br label %223, !llvm.loop !24

261:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %262 = load ptr, ptr %5, align 8, !tbaa !5
  %263 = load ptr, ptr %5, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.Matrix, ptr %263, i32 0, i32 0
  %265 = load i64, ptr %264, align 8, !tbaa !12
  %266 = load ptr, ptr %5, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.Matrix, ptr %266, i32 0, i32 1
  %268 = load i64, ptr %267, align 8, !tbaa !9
  %269 = load ptr, ptr %4, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.Matrix, ptr %269, i32 0, i32 1
  %271 = load i64, ptr %270, align 8, !tbaa !9
  %272 = sub nsw i64 %268, %271
  %273 = load ptr, ptr %5, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.Matrix, ptr %273, i32 0, i32 1
  %275 = load i64, ptr %274, align 8, !tbaa !9
  %276 = call ptr @xmat_submat(ptr noundef %262, i64 noundef 0, i64 noundef %265, i64 noundef %272, i64 noundef %275)
  store ptr %276, ptr %26, align 8, !tbaa !5
  %277 = load ptr, ptr %26, align 8, !tbaa !5
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret ptr %277
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !11, i64 8}
!10 = !{!"", !11, i64 0, !11, i64 8, !6, i64 16}
!11 = !{!"long long", !7, i64 0}
!12 = !{!10, !11, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !17}
!24 = distinct !{!24, !17}


; 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.8 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [87 x i8], align 1

declare void @mat_write(ptr noundef, i64 noundef, i64 noundef, double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @xmat_submat(ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

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

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

declare double @mat_read(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @xmat_solve(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %5 = load i64, ptr %1, align 8, !tbaa !11
  %.not = icmp eq i64 %4, %5
  br i1 %.not, label %12, label %6

6:                                                ; preds = %2
  %7 = load ptr, ptr @stderr, align 8, !tbaa !12
  %8 = load i64, ptr %0, align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = load i64, ptr %9, align 8, !tbaa !5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str.8, i64 noundef %8, i64 noundef %4, i64 noundef %5, i64 noundef %10) #5
  tail call void @exit(i32 noundef 1) #6
  unreachable

12:                                               ; preds = %2
  %13 = tail call ptr @xmat_hstack(ptr noundef nonnull %0, ptr noundef nonnull %1)
  %14 = load i64, ptr %13, align 8, !tbaa !11
  %15 = icmp sgt i64 %14, 0
  br i1 %15, label %.lr.ph126, label %.preheader.._crit_edge144_crit_edge

.lr.ph126:                                        ; preds = %12
  %16 = getelementptr inbounds i8, ptr %13, i64 8
  br label %21

.loopexit115:                                     ; preds = %._crit_edge, %27
  %17 = phi i64 [ %29, %27 ], [ %38, %._crit_edge ]
  %18 = icmp slt i64 %28, %17
  br i1 %18, label %21, label %.preheader114, !llvm.loop !13

.preheader114:                                    ; preds = %.loopexit115
  %19 = icmp sgt i64 %17, 0
  br i1 %19, label %.lr.ph137, label %.preheader.._crit_edge144_crit_edge

.lr.ph137:                                        ; preds = %.preheader114
  %20 = getelementptr inbounds i8, ptr %13, i64 8
  br label %50

21:                                               ; preds = %.lr.ph126, %.loopexit115
  %.0124 = phi i64 [ 0, %.lr.ph126 ], [ %28, %.loopexit115 ]
  %22 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0124, i64 noundef %.0124) #7
  %23 = fcmp oeq double %22, 0.000000e+00
  br i1 %23, label %24, label %27

24:                                               ; preds = %21
  %25 = load ptr, ptr @stderr, align 8, !tbaa !12
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.11, i64 noundef %.0124) #5
  tail call void @exit(i32 noundef 1) #6
  unreachable

27:                                               ; preds = %21
  %28 = add nuw nsw i64 %.0124, 1
  %29 = load i64, ptr %13, align 8, !tbaa !11
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %.lr.ph123, label %.loopexit115

.lr.ph123:                                        ; preds = %27, %._crit_edge
  %.0102121 = phi i64 [ %37, %._crit_edge ], [ %28, %27 ]
  %31 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0102121, i64 noundef %.0124) #7
  %32 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0124, i64 noundef %.0124) #7
  %33 = load i64, ptr %16, align 8, !tbaa !5
  %34 = icmp slt i64 %.0124, %33
  br i1 %34, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph123
  %35 = fneg double %31
  %36 = fdiv double %35, %32
  br label %40

._crit_edge:                                      ; preds = %40, %.lr.ph123
  %37 = add nuw nsw i64 %.0102121, 1
  %38 = load i64, ptr %13, align 8, !tbaa !11
  %39 = icmp slt i64 %37, %38
  br i1 %39, label %.lr.ph123, label %.loopexit115, !llvm.loop !15

40:                                               ; preds = %.lr.ph, %40
  %.0104120 = phi i64 [ %.0124, %.lr.ph ], [ %44, %40 ]
  %41 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0102121, i64 noundef %.0104120) #7
  %42 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0124, i64 noundef %.0104120) #7
  %43 = tail call double @llvm.fmuladd.f64(double %36, double %42, double %41)
  tail call void @mat_write(ptr noundef nonnull %13, i64 noundef %.0102121, i64 noundef %.0104120, double noundef %43) #7
  %44 = add nuw nsw i64 %.0104120, 1
  %45 = load i64, ptr %16, align 8, !tbaa !5
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %40, label %._crit_edge, !llvm.loop !16

.loopexit:                                        ; preds = %._crit_edge130
  br i1 %57, label %50, label %.preheader, !llvm.loop !17

.preheader:                                       ; preds = %56, %.loopexit
  %.pre = load i64, ptr %13, align 8, !tbaa !11
  %47 = icmp sgt i64 %.pre, 0
  br i1 %47, label %.lr.ph143, label %.preheader.._crit_edge144_crit_edge

.preheader.._crit_edge144_crit_edge:              ; preds = %12, %.preheader114, %.preheader
  %48 = phi i64 [ %.pre, %.preheader ], [ %17, %.preheader114 ], [ %14, %12 ]
  %.phi.trans.insert = getelementptr inbounds i8, ptr %13, i64 8
  %.pre151 = load i64, ptr %.phi.trans.insert, align 8, !tbaa !5
  br label %._crit_edge144

.lr.ph143:                                        ; preds = %.preheader
  %49 = getelementptr inbounds i8, ptr %13, i64 8
  br label %78

50:                                               ; preds = %.lr.ph137, %.loopexit
  %.0106.in135 = phi i64 [ %17, %.lr.ph137 ], [ %.0106136, %.loopexit ]
  %.0106136 = add nsw i64 %.0106.in135, -1
  %51 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0106136, i64 noundef %.0106136) #7
  %52 = fcmp oeq double %51, 0.000000e+00
  br i1 %52, label %53, label %56

53:                                               ; preds = %50
  %54 = load ptr, ptr @stderr, align 8, !tbaa !12
  %55 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.12, i64 noundef %.0106136) #5
  tail call void @exit(i32 noundef 1) #6
  unreachable

56:                                               ; preds = %50
  %57 = icmp ugt i64 %.0106.in135, 1
  br i1 %57, label %.lr.ph133.preheader, label %.preheader

.lr.ph133.preheader:                              ; preds = %56
  %58 = add nsw i64 %.0106.in135, -2
  br label %.lr.ph133

.lr.ph133:                                        ; preds = %.lr.ph133.preheader, %._crit_edge130
  %.0107131 = phi i64 [ %64, %._crit_edge130 ], [ %58, %.lr.ph133.preheader ]
  %59 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0107131, i64 noundef %.0106136) #7
  %60 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0106136, i64 noundef %.0106136) #7
  %61 = load i64, ptr %20, align 8, !tbaa !5
  %.not146 = icmp sgt i64 %.0106.in135, %61
  br i1 %.not146, label %._crit_edge130, label %.lr.ph129

.lr.ph129:                                        ; preds = %.lr.ph133
  %62 = fneg double %59
  %63 = fdiv double %62, %60
  br label %66

._crit_edge130:                                   ; preds = %66, %.lr.ph133
  %64 = add nsw i64 %.0107131, -1
  %65 = icmp sgt i64 %.0107131, 0
  br i1 %65, label %.lr.ph133, label %.loopexit, !llvm.loop !18

66:                                               ; preds = %.lr.ph129, %66
  %.0108127 = phi i64 [ %.0106136, %.lr.ph129 ], [ %70, %66 ]
  %67 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0107131, i64 noundef %.0108127) #7
  %68 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0106136, i64 noundef %.0108127) #7
  %69 = tail call double @llvm.fmuladd.f64(double %63, double %68, double %67)
  tail call void @mat_write(ptr noundef nonnull %13, i64 noundef %.0107131, i64 noundef %.0108127, double noundef %69) #7
  %70 = add nuw nsw i64 %.0108127, 1
  %71 = load i64, ptr %20, align 8, !tbaa !5
  %72 = icmp slt i64 %70, %71
  br i1 %72, label %66, label %._crit_edge130, !llvm.loop !19

._crit_edge144:                                   ; preds = %._crit_edge141, %.preheader.._crit_edge144_crit_edge
  %73 = phi i64 [ %.pre151, %.preheader.._crit_edge144_crit_edge ], [ %82, %._crit_edge141 ]
  %.lcssa = phi i64 [ %48, %.preheader.._crit_edge144_crit_edge ], [ %84, %._crit_edge141 ]
  %74 = getelementptr inbounds i8, ptr %1, i64 8
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %76 = sub nsw i64 %73, %75
  %77 = tail call ptr @xmat_submat(ptr noundef nonnull %13, i64 noundef 0, i64 noundef %.lcssa, i64 noundef %76, i64 noundef %73)
  ret ptr %77

78:                                               ; preds = %.lr.ph143, %._crit_edge141
  %.0105142 = phi i64 [ 0, %.lr.ph143 ], [ %83, %._crit_edge141 ]
  %79 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0105142, i64 noundef %.0105142) #7
  %80 = load i64, ptr %49, align 8, !tbaa !5
  %81 = icmp sgt i64 %80, 0
  br i1 %81, label %.lr.ph140, label %._crit_edge141

._crit_edge141:                                   ; preds = %.lr.ph140, %78
  %82 = phi i64 [ %80, %78 ], [ %89, %.lr.ph140 ]
  %83 = add nuw nsw i64 %.0105142, 1
  %84 = load i64, ptr %13, align 8, !tbaa !11
  %85 = icmp slt i64 %83, %84
  br i1 %85, label %78, label %._crit_edge144, !llvm.loop !20

.lr.ph140:                                        ; preds = %78, %.lr.ph140
  %.0103138 = phi i64 [ %88, %.lr.ph140 ], [ 0, %78 ]
  %86 = tail call double @mat_read(ptr noundef nonnull %13, i64 noundef %.0105142, i64 noundef %.0103138) #7
  %87 = fdiv double %86, %79
  tail call void @mat_write(ptr noundef nonnull %13, i64 noundef %.0105142, i64 noundef %.0103138, double noundef %87) #7
  %88 = add nuw nsw i64 %.0103138, 1
  %89 = load i64, ptr %49, align 8, !tbaa !5
  %90 = icmp slt i64 %88, %89
  br i1 %90, label %.lr.ph140, label %._crit_edge141, !llvm.loop !21
}

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

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

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


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