; LLVM IR from ERGO-Code/HiGHS :: src/ipm/basiclu (lu_pivot)

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

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.lu_pivot = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @lu_pivot(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.lu, ptr %24, i32 0, i32 13
  %26 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %26, ptr %4, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.lu, ptr %27, i32 0, i32 50
  %29 = load i32, ptr %28, align 4, !tbaa !14
  store i32 %29, ptr %5, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.lu, ptr %30, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !15
  store i32 %32, ptr %6, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.lu, ptr %33, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !16
  store i32 %35, ptr %7, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.lu, ptr %36, i32 0, i32 63
  %38 = load i32, ptr %37, align 8, !tbaa !17
  store i32 %38, ptr %8, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.lu, ptr %39, i32 0, i32 62
  %41 = load i32, ptr %40, align 4, !tbaa !18
  store i32 %41, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.lu, ptr %42, i32 0, i32 104
  %44 = load ptr, ptr %43, align 8, !tbaa !19
  store ptr %44, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.lu, ptr %45, i32 0, i32 98
  %47 = load ptr, ptr %46, align 8, !tbaa !20
  store ptr %47, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.lu, ptr %48, i32 0, i32 99
  %50 = load ptr, ptr %49, align 8, !tbaa !21
  store ptr %50, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.lu, ptr %51, i32 0, i32 86
  %53 = load ptr, ptr %52, align 8, !tbaa !22
  store ptr %53, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.lu, ptr %54, i32 0, i32 88
  %56 = load ptr, ptr %55, align 8, !tbaa !23
  store ptr %56, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.lu, ptr %57, i32 0, i32 72
  %59 = load ptr, ptr %58, align 8, !tbaa !24
  store ptr %59, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %60 = load ptr, ptr %14, align 8, !tbaa !5
  %61 = load i32, ptr %8, align 4, !tbaa !13
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i32, ptr %60, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !13
  %65 = load ptr, ptr %13, align 8, !tbaa !5
  %66 = load i32, ptr %8, align 4, !tbaa !13
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds i32, ptr %65, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !13
  %70 = sub nsw i32 %64, %69
  store i32 %70, ptr %16, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  %72 = load i32, ptr %4, align 4, !tbaa !13
  %73 = load i32, ptr %9, align 4, !tbaa !13
  %74 = add nsw i32 %72, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i32, ptr %71, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !13
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = load i32, ptr %4, align 4, !tbaa !13
  %80 = load i32, ptr %9, align 4, !tbaa !13
  %81 = add nsw i32 %79, %80
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr %78, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !13
  %85 = sub nsw i32 %77, %84
  store i32 %85, ptr %17, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  store i32 0, ptr %22, align 4, !tbaa !13
  %86 = load i32, ptr %17, align 4, !tbaa !13
  %87 = icmp sge i32 %86, 1
  br i1 %87, label %88, label %89

88:                                               ; preds = %1
  br label %90

89:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 83, ptr noundef @__PRETTY_FUNCTION__.lu_pivot) #4
  unreachable

90:                                               ; preds = %88
  %91 = load i32, ptr %16, align 4, !tbaa !13
  %92 = icmp sge i32 %91, 1
  br i1 %92, label %93, label %94

93:                                               ; preds = %90
  br label %95

94:                                               ; preds = %90
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 84, ptr noundef @__PRETTY_FUNCTION__.lu_pivot) #4
  unreachable

95:                                               ; preds = %93
  %96 = load i32, ptr %6, align 4, !tbaa !13
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = load i32, ptr %5, align 4, !tbaa !13
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %97, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !13
  %102 = sub nsw i32 %96, %101
  store i32 %102, ptr %18, align 4, !tbaa !13
  %103 = load i32, ptr %16, align 4, !tbaa !13
  store i32 %103, ptr %19, align 4, !tbaa !13
  %104 = load i32, ptr %18, align 4, !tbaa !13
  %105 = load i32, ptr %19, align 4, !tbaa !13
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %107, label %113

107:                                              ; preds = %95
  %108 = load i32, ptr %19, align 4, !tbaa !13
  %109 = load i32, ptr %18, align 4, !tbaa !13
  %110 = sub nsw i32 %108, %109
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.lu, ptr %111, i32 0, i32 14
  store i32 %110, ptr %112, align 8, !tbaa !25
  store i32 1, ptr %22, align 4, !tbaa !13
  br label %113

113:                                              ; preds = %107, %95
  %114 = load i32, ptr %7, align 4, !tbaa !13
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = load i32, ptr %5, align 4, !tbaa !13
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %115, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !13
  %120 = sub nsw i32 %114, %119
  store i32 %120, ptr %18, align 4, !tbaa !13
  %121 = load i32, ptr %17, align 4, !tbaa !13
  %122 = sub nsw i32 %121, 1
  store i32 %122, ptr %19, align 4, !tbaa !13
  %123 = load i32, ptr %18, align 4, !tbaa !13
  %124 = load i32, ptr %19, align 4, !tbaa !13
  %125 = icmp slt i32 %123, %124
  br i1 %125, label %126, label %132

126:                                              ; preds = %113
  %127 = load i32, ptr %19, align 4, !tbaa !13
  %128 = load i32, ptr %18, align 4, !tbaa !13
  %129 = sub nsw i32 %127, %128
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.lu, ptr %130, i32 0, i32 15
  store i32 %129, ptr %131, align 4, !tbaa !26
  store i32 1, ptr %22, align 4, !tbaa !13
  br label %132

132:                                              ; preds = %126, %113
  %133 = load i32, ptr %22, align 4, !tbaa !13
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %135, label %137

135:                                              ; preds = %132
  %136 = load i32, ptr %22, align 4, !tbaa !13
  store i32 %136, ptr %2, align 4
  store i32 1, ptr %23, align 4
  br label %233

137:                                              ; preds = %132
  %138 = load i32, ptr %17, align 4, !tbaa !13
  %139 = icmp eq i32 %138, 1
  br i1 %139, label %140, label %143

140:                                              ; preds = %137
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  %142 = call i32 @lu_pivot_singleton_row(ptr noundef %141)
  store i32 %142, ptr %22, align 4, !tbaa !13
  br label %168

143:                                              ; preds = %137
  %144 = load i32, ptr %16, align 4, !tbaa !13
  %145 = icmp eq i32 %144, 1
  br i1 %145, label %146, label %149

146:                                              ; preds = %143
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = call i32 @lu_pivot_singleton_col(ptr noundef %147)
  store i32 %148, ptr %22, align 4, !tbaa !13
  br label %167

149:                                              ; preds = %143
  %150 = load i32, ptr %16, align 4, !tbaa !13
  %151 = icmp eq i32 %150, 2
  br i1 %151, label %152, label %155

152:                                              ; preds = %149
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = call i32 @lu_pivot_doubleton_col(ptr noundef %153)
  store i32 %154, ptr %22, align 4, !tbaa !13
  br label %166

155:                                              ; preds = %149
  %156 = load i32, ptr %16, align 4, !tbaa !13
  %157 = sub nsw i32 %156, 1
  %158 = icmp sle i32 %157, 64
  br i1 %158, label %159, label %162

159:                                              ; preds = %155
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = call i32 @lu_pivot_small(ptr noundef %160)
  store i32 %161, ptr %22, align 4, !tbaa !13
  br label %165

162:                                              ; preds = %155
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = call i32 @lu_pivot_any(ptr noundef %163)
  store i32 %164, ptr %22, align 4, !tbaa !13
  br label %165

165:                                              ; preds = %162, %159
  br label %166

166:                                              ; preds = %165, %152
  br label %167

167:                                              ; preds = %166, %146
  br label %168

168:                                              ; preds = %167, %140
  %169 = load i32, ptr %22, align 4, !tbaa !13
  %170 = icmp eq i32 %169, 0
  br i1 %170, label %171, label %222

171:                                              ; preds = %168
  %172 = load ptr, ptr %12, align 8, !tbaa !5
  %173 = load i32, ptr %5, align 4, !tbaa !13
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i32, ptr %172, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !13
  store i32 %176, ptr %20, align 4, !tbaa !13
  br label %177

177:                                              ; preds = %218, %171
  %178 = load i32, ptr %20, align 4, !tbaa !13
  %179 = load ptr, ptr %12, align 8, !tbaa !5
  %180 = load i32, ptr %5, align 4, !tbaa !13
  %181 = add nsw i32 %180, 1
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i32, ptr %179, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !13
  %185 = icmp slt i32 %178, %184
  br i1 %185, label %186, label %221

186:                                              ; preds = %177
  %187 = load ptr, ptr %15, align 8, !tbaa !5
  %188 = load i32, ptr %20, align 4, !tbaa !13
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %187, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !13
  store i32 %191, ptr %21, align 4, !tbaa !13
  %192 = load i32, ptr %21, align 4, !tbaa !13
  %193 = load i32, ptr %8, align 4, !tbaa !13
  %194 = icmp ne i32 %192, %193
  br i1 %194, label %195, label %196

195:                                              ; preds = %186
  br label %197

196:                                              ; preds = %186
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 133, ptr noundef @__PRETTY_FUNCTION__.lu_pivot) #4
  unreachable

197:                                              ; preds = %195
  %198 = load ptr, ptr %10, align 8, !tbaa !5
  %199 = load i32, ptr %21, align 4, !tbaa !13
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds double, ptr %198, i64 %200
  %202 = load double, ptr %201, align 8, !tbaa !27
  %203 = fcmp oeq double %202, 0.000000e+00
  br i1 %203, label %214, label %204

204:                                              ; preds = %197
  %205 = load ptr, ptr %10, align 8, !tbaa !5
  %206 = load i32, ptr %21, align 4, !tbaa !13
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds double, ptr %205, i64 %207
  %209 = load double, ptr %208, align 8, !tbaa !27
  %210 = load ptr, ptr %3, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.lu, ptr %210, i32 0, i32 4
  %212 = load double, ptr %211, align 8, !tbaa !28
  %213 = fcmp olt double %209, %212
  br i1 %213, label %214, label %217

214:                                              ; preds = %204, %197
  %215 = load ptr, ptr %3, align 8, !tbaa !5
  %216 = load i32, ptr %21, align 4, !tbaa !13
  call void @lu_remove_col(ptr noundef %215, i32 noundef %216)
  br label %217

217:                                              ; preds = %214, %204
  br label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %20, align 4, !tbaa !13
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %20, align 4, !tbaa !13
  br label %177, !llvm.loop !29

221:                                              ; preds = %177
  br label %222

222:                                              ; preds = %221, %168
  %223 = load i32, ptr %16, align 4, !tbaa !13
  %224 = sub nsw i32 %223, 1
  %225 = load i32, ptr %17, align 4, !tbaa !13
  %226 = sub nsw i32 %225, 1
  %227 = mul nsw i32 %224, %226
  %228 = load ptr, ptr %3, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.lu, ptr %228, i32 0, i32 56
  %230 = load i32, ptr %229, align 4, !tbaa !31
  %231 = add nsw i32 %230, %227
  store i32 %231, ptr %229, align 4, !tbaa !31
  %232 = load i32, ptr %22, align 4, !tbaa !13
  store i32 %232, ptr %2, align 4
  store i32 1, ptr %23, align 4
  br label %233

233:                                              ; preds = %222, %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %234 = load i32, ptr %2, align 4
  ret i32 %234
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @lu_pivot_singleton_row(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @lu_pivot_singleton_col(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @lu_pivot_doubleton_col(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @lu_pivot_small(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @lu_pivot_any(ptr noundef) #0

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

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

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 = { 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 }
attributes #4 = { 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 84}
!10 = !{!"lu", !11, i64 0, !11, i64 4, !11, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !11, i64 224, !11, i64 228, !11, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !11, i64 312, !11, i64 316, !11, i64 320, !11, i64 324, !11, i64 328, !11, i64 332, !11, i64 336, !11, i64 340, !12, i64 344, !12, i64 352, !12, i64 360, !12, i64 368, !11, i64 376, !11, i64 380, !11, i64 384, !11, i64 388, !11, i64 392, !11, i64 396, !11, i64 400, !11, i64 404, !11, i64 408, !11, i64 412, !6, i64 416, !6, i64 424, !6, i64 432, !6, i64 440, !6, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !6, i64 640, !6, i64 648, !6, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !11, i64 316}
!15 = !{!10, !11, i64 0}
!16 = !{!10, !11, i64 4}
!17 = !{!10, !11, i64 384}
!18 = !{!10, !11, i64 380}
!19 = !{!10, !6, i64 680}
!20 = !{!10, !6, i64 632}
!21 = !{!10, !6, i64 640}
!22 = !{!10, !6, i64 536}
!23 = !{!10, !6, i64 552}
!24 = !{!10, !6, i64 424}
!25 = !{!10, !11, i64 88}
!26 = !{!10, !11, i64 92}
!27 = !{!12, !12, i64 0}
!28 = !{!10, !12, i64 24}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!10, !11, i64 340}


; 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 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.lu_pivot = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @lu_pivot(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 84
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 316
  %5 = load i32, ptr %4, align 4, !tbaa !12
  %6 = load i32, ptr %0, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %0, i64 384
  %10 = load i32, ptr %9, align 8, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %0, i64 380
  %12 = load i32, ptr %11, align 4, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 680
  %14 = load ptr, ptr %13, align 8, !tbaa !17
  %15 = getelementptr inbounds i8, ptr %0, i64 632
  %16 = load ptr, ptr %15, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %0, i64 640
  %18 = load ptr, ptr %17, align 8, !tbaa !19
  %19 = getelementptr inbounds i8, ptr %0, i64 536
  %20 = load ptr, ptr %19, align 8, !tbaa !20
  %21 = getelementptr inbounds i8, ptr %0, i64 552
  %22 = load ptr, ptr %21, align 8, !tbaa !21
  %23 = getelementptr inbounds i8, ptr %0, i64 424
  %24 = load ptr, ptr %23, align 8, !tbaa !22
  %25 = sext i32 %10 to i64
  %26 = getelementptr inbounds i32, ptr %22, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !23
  %28 = getelementptr inbounds i32, ptr %20, i64 %25
  %29 = load i32, ptr %28, align 4, !tbaa !23
  %30 = sub nsw i32 %27, %29
  %31 = add nsw i32 %12, %3
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr %22, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !23
  %35 = getelementptr inbounds i32, ptr %20, i64 %32
  %36 = load i32, ptr %35, align 4, !tbaa !23
  %37 = sub nsw i32 %34, %36
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %40, label %39

39:                                               ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 83, ptr noundef nonnull @__PRETTY_FUNCTION__.lu_pivot) #2
  unreachable

40:                                               ; preds = %1
  %41 = icmp sgt i32 %30, 0
  br i1 %41, label %43, label %42

42:                                               ; preds = %40
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 84, ptr noundef nonnull @__PRETTY_FUNCTION__.lu_pivot) #2
  unreachable

43:                                               ; preds = %40
  %44 = sext i32 %5 to i64
  %45 = getelementptr inbounds i32, ptr %16, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !23
  %47 = sub nsw i32 %6, %46
  %.not = icmp slt i32 %47, %30
  br i1 %.not, label %48, label %.thread89

48:                                               ; preds = %43
  %49 = sub nsw i32 %30, %47
  %50 = getelementptr inbounds i8, ptr %0, i64 88
  store i32 %49, ptr %50, align 8, !tbaa !24
  %51 = getelementptr inbounds i32, ptr %18, i64 %44
  %52 = load i32, ptr %51, align 4, !tbaa !23
  %53 = sub nsw i32 %8, %52
  %54 = add nsw i32 %37, -1
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %.thread, label %111

.thread89:                                        ; preds = %43
  %56 = getelementptr inbounds i32, ptr %18, i64 %44
  %57 = load i32, ptr %56, align 4, !tbaa !23
  %58 = sub nsw i32 %8, %57
  %59 = add nsw i32 %37, -1
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %.thread, label %.thread90

.thread:                                          ; preds = %.thread89, %48
  %61 = phi i32 [ %59, %.thread89 ], [ %54, %48 ]
  %62 = phi i32 [ %58, %.thread89 ], [ %53, %48 ]
  %63 = sub nsw i32 %61, %62
  %64 = getelementptr inbounds i8, ptr %0, i64 92
  store i32 %63, ptr %64, align 4, !tbaa !25
  br label %111

.thread90:                                        ; preds = %.thread89
  %65 = icmp eq i32 %37, 1
  br i1 %65, label %66, label %68

66:                                               ; preds = %.thread90
  %67 = tail call i32 @lu_pivot_singleton_row(ptr noundef nonnull %0)
  br label %79

68:                                               ; preds = %.thread90
  switch i32 %30, label %73 [
    i32 1, label %69
    i32 2, label %71
  ]

69:                                               ; preds = %68
  %70 = tail call i32 @lu_pivot_singleton_col(ptr noundef nonnull %0)
  br label %79

71:                                               ; preds = %68
  %72 = tail call i32 @lu_pivot_doubleton_col(ptr noundef nonnull %0)
  br label %79

73:                                               ; preds = %68
  %74 = icmp ult i32 %30, 66
  br i1 %74, label %75, label %77

75:                                               ; preds = %73
  %76 = tail call i32 @lu_pivot_small(ptr noundef nonnull %0)
  br label %79

77:                                               ; preds = %73
  %78 = tail call i32 @lu_pivot_any(ptr noundef nonnull %0)
  br label %79

79:                                               ; preds = %69, %75, %77, %71, %66
  %.2 = phi i32 [ %67, %66 ], [ %70, %69 ], [ %72, %71 ], [ %76, %75 ], [ %78, %77 ]
  %80 = icmp eq i32 %.2, 0
  br i1 %80, label %81, label %.loopexit

81:                                               ; preds = %79
  %82 = load i32, ptr %56, align 4, !tbaa !23
  %83 = getelementptr i8, ptr %56, i64 4
  %84 = load i32, ptr %83, align 4, !tbaa !23
  %85 = icmp slt i32 %82, %84
  br i1 %85, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %81
  %86 = getelementptr inbounds i8, ptr %0, i64 24
  %87 = sext i32 %82 to i64
  br label %88

88:                                               ; preds = %.lr.ph, %102
  %89 = phi i32 [ %84, %.lr.ph ], [ %103, %102 ]
  %indvars.iv = phi i64 [ %87, %.lr.ph ], [ %indvars.iv.next, %102 ]
  %90 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv
  %91 = load i32, ptr %90, align 4, !tbaa !23
  %.not84 = icmp eq i32 %91, %10
  br i1 %.not84, label %92, label %93

92:                                               ; preds = %88
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 133, ptr noundef nonnull @__PRETTY_FUNCTION__.lu_pivot) #2
  unreachable

93:                                               ; preds = %88
  %94 = sext i32 %91 to i64
  %95 = getelementptr inbounds double, ptr %14, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !26
  %97 = fcmp oeq double %96, 0.000000e+00
  br i1 %97, label %101, label %98

98:                                               ; preds = %93
  %99 = load double, ptr %86, align 8, !tbaa !27
  %100 = fcmp olt double %96, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %98, %93
  tail call void @lu_remove_col(ptr noundef nonnull %0, i32 noundef %91)
  %.pre = load i32, ptr %83, align 4, !tbaa !23
  br label %102

102:                                              ; preds = %98, %101
  %103 = phi i32 [ %89, %98 ], [ %.pre, %101 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %104 = sext i32 %103 to i64
  %105 = icmp slt i64 %indvars.iv.next, %104
  br i1 %105, label %88, label %.loopexit, !llvm.loop !28

.loopexit:                                        ; preds = %102, %81, %79
  %106 = add nsw i32 %30, -1
  %107 = mul nsw i32 %59, %106
  %108 = getelementptr inbounds i8, ptr %0, i64 340
  %109 = load i32, ptr %108, align 4, !tbaa !30
  %110 = add nsw i32 %109, %107
  store i32 %110, ptr %108, align 4, !tbaa !30
  br label %111

111:                                              ; preds = %48, %.thread, %.loopexit
  %.075 = phi i32 [ %.2, %.loopexit ], [ 1, %.thread ], [ 1, %48 ]
  ret i32 %.075
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @lu_pivot_singleton_row(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @lu_pivot_singleton_col(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @lu_pivot_doubleton_col(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @lu_pivot_small(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @lu_pivot_any(ptr noundef) local_unnamed_addr #0

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

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 = { 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 #2 = { 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, !7, i64 84}
!6 = !{!"lu", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !7, i64 44, !7, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !7, i64 224, !7, i64 228, !7, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !7, i64 312, !7, i64 316, !7, i64 320, !7, i64 324, !7, i64 328, !7, i64 332, !7, i64 336, !7, i64 340, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368, !7, i64 376, !7, i64 380, !7, i64 384, !7, i64 388, !7, i64 392, !7, i64 396, !7, i64 400, !7, i64 404, !7, i64 408, !7, i64 412, !11, i64 416, !11, i64 424, !11, i64 432, !11, i64 440, !11, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !11, i64 520, !11, i64 528, !11, i64 536, !11, i64 544, !11, i64 552, !11, i64 560, !11, i64 568, !11, i64 576, !11, i64 584, !11, i64 592, !11, i64 600, !11, i64 608, !11, i64 616, !11, i64 624, !11, i64 632, !11, i64 640, !11, i64 648, !11, i64 656, !11, i64 664, !11, i64 672, !11, i64 680, !11, i64 688}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !7, i64 316}
!13 = !{!6, !7, i64 0}
!14 = !{!6, !7, i64 4}
!15 = !{!6, !7, i64 384}
!16 = !{!6, !7, i64 380}
!17 = !{!6, !11, i64 680}
!18 = !{!6, !11, i64 632}
!19 = !{!6, !11, i64 640}
!20 = !{!6, !11, i64 536}
!21 = !{!6, !11, i64 552}
!22 = !{!6, !11, i64 424}
!23 = !{!7, !7, i64 0}
!24 = !{!6, !7, i64 88}
!25 = !{!6, !7, i64 92}
!26 = !{!10, !10, i64 0}
!27 = !{!6, !10, i64 24}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!6, !7, i64 340}


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