; LLVM IR from OpenMathLib/OpenBLAS :: lapack-netlib/LAPACKE/src (lapacke_ctpmqrt_work)

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

@.str = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @LAPACKE_ctpmqrt_work(i32 noundef %0, i8 noundef signext %1, i8 noundef signext %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, ptr noundef %8, i32 noundef %9, ptr noundef %10, i32 noundef %11, ptr noundef %12, i32 noundef %13, ptr noundef %14, i32 noundef %15, ptr noundef %16) #0 {
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i8, align 1
  %21 = alloca i8, align 1
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca ptr, align 8
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca i32, align 4
  %35 = alloca ptr, align 8
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca ptr, align 8
  %46 = alloca ptr, align 8
  %47 = alloca ptr, align 8
  %48 = alloca ptr, align 8
  store i32 %0, ptr %19, align 4, !tbaa !5
  store i8 %1, ptr %20, align 1, !tbaa !9
  store i8 %2, ptr %21, align 1, !tbaa !9
  store i32 %3, ptr %22, align 4, !tbaa !5
  store i32 %4, ptr %23, align 4, !tbaa !5
  store i32 %5, ptr %24, align 4, !tbaa !5
  store i32 %6, ptr %25, align 4, !tbaa !5
  store i32 %7, ptr %26, align 4, !tbaa !5
  store ptr %8, ptr %27, align 8, !tbaa !10
  store i32 %9, ptr %28, align 4, !tbaa !5
  store ptr %10, ptr %29, align 8, !tbaa !10
  store i32 %11, ptr %30, align 4, !tbaa !5
  store ptr %12, ptr %31, align 8, !tbaa !10
  store i32 %13, ptr %32, align 4, !tbaa !5
  store ptr %14, ptr %33, align 8, !tbaa !10
  store i32 %15, ptr %34, align 4, !tbaa !5
  store ptr %16, ptr %35, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  store i32 0, ptr %36, align 4, !tbaa !5
  %49 = load i32, ptr %19, align 4, !tbaa !5
  %50 = icmp eq i32 %49, 102
  br i1 %50, label %51, label %63

51:                                               ; preds = %17
  %52 = load ptr, ptr %27, align 8, !tbaa !10
  %53 = load ptr, ptr %29, align 8, !tbaa !10
  %54 = load ptr, ptr %31, align 8, !tbaa !10
  %55 = load ptr, ptr %33, align 8, !tbaa !10
  %56 = load ptr, ptr %35, align 8, !tbaa !10
  call void @ctpmqrt_(ptr noundef %20, ptr noundef %21, ptr noundef %22, ptr noundef %23, ptr noundef %24, ptr noundef %25, ptr noundef %26, ptr noundef %52, ptr noundef %28, ptr noundef %53, ptr noundef %30, ptr noundef %54, ptr noundef %32, ptr noundef %55, ptr noundef %34, ptr noundef %56, ptr noundef %36, i64 noundef 1, i64 noundef 1)
  %57 = load i32, ptr %36, align 4, !tbaa !5
  %58 = icmp slt i32 %57, 0
  br i1 %58, label %59, label %62

59:                                               ; preds = %51
  %60 = load i32, ptr %36, align 4, !tbaa !5
  %61 = sub nsw i32 %60, 1
  store i32 %61, ptr %36, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %59, %51
  br label %278

63:                                               ; preds = %17
  %64 = load i32, ptr %19, align 4, !tbaa !5
  %65 = icmp eq i32 %64, 101
  br i1 %65, label %66, label %275

66:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #6
  %67 = load i8, ptr %20, align 1, !tbaa !9
  %68 = call i32 @LAPACKE_lsame(i8 noundef signext %67, i8 noundef signext 108) #7
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %74

70:                                               ; preds = %66
  %71 = load i32, ptr %24, align 4, !tbaa !5
  store i32 %71, ptr %37, align 4, !tbaa !5
  %72 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %72, ptr %38, align 4, !tbaa !5
  %73 = load i32, ptr %22, align 4, !tbaa !5
  store i32 %73, ptr %39, align 4, !tbaa !5
  br label %86

74:                                               ; preds = %66
  %75 = load i8, ptr %20, align 1, !tbaa !9
  %76 = call i32 @LAPACKE_lsame(i8 noundef signext %75, i8 noundef signext 114) #7
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %82

78:                                               ; preds = %74
  %79 = load i32, ptr %22, align 4, !tbaa !5
  store i32 %79, ptr %37, align 4, !tbaa !5
  %80 = load i32, ptr %24, align 4, !tbaa !5
  store i32 %80, ptr %38, align 4, !tbaa !5
  %81 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %81, ptr %39, align 4, !tbaa !5
  br label %85

82:                                               ; preds = %74
  store i32 -2, ptr %36, align 4, !tbaa !5
  %83 = load i32, ptr %36, align 4, !tbaa !5
  call void @LAPACKE_xerbla(ptr noundef @.str, i32 noundef %83)
  %84 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %84, ptr %18, align 4
  store i32 1, ptr %40, align 4
  br label %272

85:                                               ; preds = %78
  br label %86

86:                                               ; preds = %85, %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #6
  %87 = load i32, ptr %37, align 4, !tbaa !5
  %88 = icmp sgt i32 1, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %86
  br label %92

90:                                               ; preds = %86
  %91 = load i32, ptr %37, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %90, %89
  %93 = phi i32 [ 1, %89 ], [ %91, %90 ]
  store i32 %93, ptr %41, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #6
  %94 = load i32, ptr %22, align 4, !tbaa !5
  %95 = icmp sgt i32 1, %94
  br i1 %95, label %96, label %97

96:                                               ; preds = %92
  br label %99

97:                                               ; preds = %92
  %98 = load i32, ptr %22, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %97, %96
  %100 = phi i32 [ 1, %96 ], [ %98, %97 ]
  store i32 %100, ptr %42, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #6
  %101 = load i32, ptr %26, align 4, !tbaa !5
  %102 = icmp sgt i32 1, %101
  br i1 %102, label %103, label %104

103:                                              ; preds = %99
  br label %106

104:                                              ; preds = %99
  %105 = load i32, ptr %26, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %104, %103
  %107 = phi i32 [ 1, %103 ], [ %105, %104 ]
  store i32 %107, ptr %43, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #6
  %108 = load i32, ptr %39, align 4, !tbaa !5
  %109 = icmp sgt i32 1, %108
  br i1 %109, label %110, label %111

110:                                              ; preds = %106
  br label %113

111:                                              ; preds = %106
  %112 = load i32, ptr %39, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %111, %110
  %114 = phi i32 [ 1, %110 ], [ %112, %111 ]
  store i32 %114, ptr %44, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #6
  store ptr null, ptr %45, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #6
  store ptr null, ptr %46, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #6
  store ptr null, ptr %47, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #6
  store ptr null, ptr %48, align 8, !tbaa !10
  %115 = load i32, ptr %32, align 4, !tbaa !5
  %116 = load i32, ptr %38, align 4, !tbaa !5
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %118, label %121

118:                                              ; preds = %113
  store i32 -14, ptr %36, align 4, !tbaa !5
  %119 = load i32, ptr %36, align 4, !tbaa !5
  call void @LAPACKE_xerbla(ptr noundef @.str, i32 noundef %119)
  %120 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %120, ptr %18, align 4
  store i32 1, ptr %40, align 4
  br label %271

121:                                              ; preds = %113
  %122 = load i32, ptr %34, align 4, !tbaa !5
  %123 = load i32, ptr %23, align 4, !tbaa !5
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %125, label %128

125:                                              ; preds = %121
  store i32 -16, ptr %36, align 4, !tbaa !5
  %126 = load i32, ptr %36, align 4, !tbaa !5
  call void @LAPACKE_xerbla(ptr noundef @.str, i32 noundef %126)
  %127 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %127, ptr %18, align 4
  store i32 1, ptr %40, align 4
  br label %271

128:                                              ; preds = %121
  %129 = load i32, ptr %30, align 4, !tbaa !5
  %130 = load i32, ptr %24, align 4, !tbaa !5
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %132, label %135

132:                                              ; preds = %128
  store i32 -12, ptr %36, align 4, !tbaa !5
  %133 = load i32, ptr %36, align 4, !tbaa !5
  call void @LAPACKE_xerbla(ptr noundef @.str, i32 noundef %133)
  %134 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %134, ptr %18, align 4
  store i32 1, ptr %40, align 4
  br label %271

135:                                              ; preds = %128
  %136 = load i32, ptr %28, align 4, !tbaa !5
  %137 = load i32, ptr %24, align 4, !tbaa !5
  %138 = icmp slt i32 %136, %137
  br i1 %138, label %139, label %142

139:                                              ; preds = %135
  store i32 -10, ptr %36, align 4, !tbaa !5
  %140 = load i32, ptr %36, align 4, !tbaa !5
  call void @LAPACKE_xerbla(ptr noundef @.str, i32 noundef %140)
  %141 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %141, ptr %18, align 4
  store i32 1, ptr %40, align 4
  br label %271

142:                                              ; preds = %135
  %143 = load i32, ptr %44, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = mul i64 8, %144
  %146 = load i32, ptr %24, align 4, !tbaa !5
  %147 = icmp sgt i32 1, %146
  br i1 %147, label %148, label %149

148:                                              ; preds = %142
  br label %151

149:                                              ; preds = %142
  %150 = load i32, ptr %24, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %149, %148
  %152 = phi i32 [ 1, %148 ], [ %150, %149 ]
  %153 = sext i32 %152 to i64
  %154 = mul i64 %145, %153
  %155 = call noalias ptr @malloc(i64 noundef %154) #8
  store ptr %155, ptr %45, align 8, !tbaa !10
  %156 = load ptr, ptr %45, align 8, !tbaa !10
  %157 = icmp eq ptr %156, null
  br i1 %157, label %158, label %159

158:                                              ; preds = %151
  store i32 -1011, ptr %36, align 4, !tbaa !5
  br label %265

159:                                              ; preds = %151
  %160 = load i32, ptr %43, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = mul i64 8, %161
  %163 = load i32, ptr %24, align 4, !tbaa !5
  %164 = icmp sgt i32 1, %163
  br i1 %164, label %165, label %166

165:                                              ; preds = %159
  br label %168

166:                                              ; preds = %159
  %167 = load i32, ptr %24, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %166, %165
  %169 = phi i32 [ 1, %165 ], [ %167, %166 ]
  %170 = sext i32 %169 to i64
  %171 = mul i64 %162, %170
  %172 = call noalias ptr @malloc(i64 noundef %171) #8
  store ptr %172, ptr %46, align 8, !tbaa !10
  %173 = load ptr, ptr %46, align 8, !tbaa !10
  %174 = icmp eq ptr %173, null
  br i1 %174, label %175, label %176

175:                                              ; preds = %168
  store i32 -1011, ptr %36, align 4, !tbaa !5
  br label %263

176:                                              ; preds = %168
  %177 = load i32, ptr %41, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = mul i64 8, %178
  %180 = load i32, ptr %38, align 4, !tbaa !5
  %181 = icmp sgt i32 1, %180
  br i1 %181, label %182, label %183

182:                                              ; preds = %176
  br label %185

183:                                              ; preds = %176
  %184 = load i32, ptr %38, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %183, %182
  %186 = phi i32 [ 1, %182 ], [ %184, %183 ]
  %187 = sext i32 %186 to i64
  %188 = mul i64 %179, %187
  %189 = call noalias ptr @malloc(i64 noundef %188) #8
  store ptr %189, ptr %47, align 8, !tbaa !10
  %190 = load ptr, ptr %47, align 8, !tbaa !10
  %191 = icmp eq ptr %190, null
  br i1 %191, label %192, label %193

192:                                              ; preds = %185
  store i32 -1011, ptr %36, align 4, !tbaa !5
  br label %261

193:                                              ; preds = %185
  %194 = load i32, ptr %42, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = mul i64 8, %195
  %197 = load i32, ptr %23, align 4, !tbaa !5
  %198 = icmp sgt i32 1, %197
  br i1 %198, label %199, label %200

199:                                              ; preds = %193
  br label %202

200:                                              ; preds = %193
  %201 = load i32, ptr %23, align 4, !tbaa !5
  br label %202

202:                                              ; preds = %200, %199
  %203 = phi i32 [ 1, %199 ], [ %201, %200 ]
  %204 = sext i32 %203 to i64
  %205 = mul i64 %196, %204
  %206 = call noalias ptr @malloc(i64 noundef %205) #8
  store ptr %206, ptr %48, align 8, !tbaa !10
  %207 = load ptr, ptr %48, align 8, !tbaa !10
  %208 = icmp eq ptr %207, null
  br i1 %208, label %209, label %210

209:                                              ; preds = %202
  store i32 -1011, ptr %36, align 4, !tbaa !5
  br label %259

210:                                              ; preds = %202
  %211 = load i32, ptr %39, align 4, !tbaa !5
  %212 = load i32, ptr %24, align 4, !tbaa !5
  %213 = load ptr, ptr %27, align 8, !tbaa !10
  %214 = load i32, ptr %28, align 4, !tbaa !5
  %215 = load ptr, ptr %45, align 8, !tbaa !10
  %216 = load i32, ptr %44, align 4, !tbaa !5
  call void @LAPACKE_cge_trans(i32 noundef 101, i32 noundef %211, i32 noundef %212, ptr noundef %213, i32 noundef %214, ptr noundef %215, i32 noundef %216)
  %217 = load i32, ptr %26, align 4, !tbaa !5
  %218 = load i32, ptr %24, align 4, !tbaa !5
  %219 = load ptr, ptr %29, align 8, !tbaa !10
  %220 = load i32, ptr %30, align 4, !tbaa !5
  %221 = load ptr, ptr %46, align 8, !tbaa !10
  %222 = load i32, ptr %43, align 4, !tbaa !5
  call void @LAPACKE_cge_trans(i32 noundef 101, i32 noundef %217, i32 noundef %218, ptr noundef %219, i32 noundef %220, ptr noundef %221, i32 noundef %222)
  %223 = load i32, ptr %37, align 4, !tbaa !5
  %224 = load i32, ptr %38, align 4, !tbaa !5
  %225 = load ptr, ptr %31, align 8, !tbaa !10
  %226 = load i32, ptr %32, align 4, !tbaa !5
  %227 = load ptr, ptr %47, align 8, !tbaa !10
  %228 = load i32, ptr %41, align 4, !tbaa !5
  call void @LAPACKE_cge_trans(i32 noundef 101, i32 noundef %223, i32 noundef %224, ptr noundef %225, i32 noundef %226, ptr noundef %227, i32 noundef %228)
  %229 = load i32, ptr %22, align 4, !tbaa !5
  %230 = load i32, ptr %23, align 4, !tbaa !5
  %231 = load ptr, ptr %33, align 8, !tbaa !10
  %232 = load i32, ptr %34, align 4, !tbaa !5
  %233 = load ptr, ptr %48, align 8, !tbaa !10
  %234 = load i32, ptr %42, align 4, !tbaa !5
  call void @LAPACKE_cge_trans(i32 noundef 101, i32 noundef %229, i32 noundef %230, ptr noundef %231, i32 noundef %232, ptr noundef %233, i32 noundef %234)
  %235 = load ptr, ptr %45, align 8, !tbaa !10
  %236 = load ptr, ptr %46, align 8, !tbaa !10
  %237 = load ptr, ptr %47, align 8, !tbaa !10
  %238 = load ptr, ptr %48, align 8, !tbaa !10
  %239 = load ptr, ptr %35, align 8, !tbaa !10
  call void @ctpmqrt_(ptr noundef %20, ptr noundef %21, ptr noundef %22, ptr noundef %23, ptr noundef %24, ptr noundef %25, ptr noundef %26, ptr noundef %235, ptr noundef %44, ptr noundef %236, ptr noundef %43, ptr noundef %237, ptr noundef %41, ptr noundef %238, ptr noundef %42, ptr noundef %239, ptr noundef %36, i64 noundef 1, i64 noundef 1)
  %240 = load i32, ptr %36, align 4, !tbaa !5
  %241 = icmp slt i32 %240, 0
  br i1 %241, label %242, label %245

242:                                              ; preds = %210
  %243 = load i32, ptr %36, align 4, !tbaa !5
  %244 = sub nsw i32 %243, 1
  store i32 %244, ptr %36, align 4, !tbaa !5
  br label %245

245:                                              ; preds = %242, %210
  %246 = load i32, ptr %37, align 4, !tbaa !5
  %247 = load i32, ptr %38, align 4, !tbaa !5
  %248 = load ptr, ptr %47, align 8, !tbaa !10
  %249 = load i32, ptr %41, align 4, !tbaa !5
  %250 = load ptr, ptr %31, align 8, !tbaa !10
  %251 = load i32, ptr %32, align 4, !tbaa !5
  call void @LAPACKE_cge_trans(i32 noundef 102, i32 noundef %246, i32 noundef %247, ptr noundef %248, i32 noundef %249, ptr noundef %250, i32 noundef %251)
  %252 = load i32, ptr %22, align 4, !tbaa !5
  %253 = load i32, ptr %23, align 4, !tbaa !5
  %254 = load ptr, ptr %48, align 8, !tbaa !10
  %255 = load i32, ptr %42, align 4, !tbaa !5
  %256 = load ptr, ptr %33, align 8, !tbaa !10
  %257 = load i32, ptr %34, align 4, !tbaa !5
  call void @LAPACKE_cge_trans(i32 noundef 102, i32 noundef %252, i32 noundef %253, ptr noundef %254, i32 noundef %255, ptr noundef %256, i32 noundef %257)
  %258 = load ptr, ptr %48, align 8, !tbaa !10
  call void @free(ptr noundef %258) #6
  br label %259

259:                                              ; preds = %245, %209
  %260 = load ptr, ptr %47, align 8, !tbaa !10
  call void @free(ptr noundef %260) #6
  br label %261

261:                                              ; preds = %259, %192
  %262 = load ptr, ptr %46, align 8, !tbaa !10
  call void @free(ptr noundef %262) #6
  br label %263

263:                                              ; preds = %261, %175
  %264 = load ptr, ptr %45, align 8, !tbaa !10
  call void @free(ptr noundef %264) #6
  br label %265

265:                                              ; preds = %263, %158
  %266 = load i32, ptr %36, align 4, !tbaa !5
  %267 = icmp eq i32 %266, -1011
  br i1 %267, label %268, label %270

268:                                              ; preds = %265
  %269 = load i32, ptr %36, align 4, !tbaa !5
  call void @LAPACKE_xerbla(ptr noundef @.str, i32 noundef %269)
  br label %270

270:                                              ; preds = %268, %265
  store i32 0, ptr %40, align 4
  br label %271

271:                                              ; preds = %270, %139, %132, %125, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #6
  br label %272

272:                                              ; preds = %271, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #6
  %273 = load i32, ptr %40, align 4
  switch i32 %273, label %280 [
    i32 0, label %274
  ]

274:                                              ; preds = %272
  br label %277

275:                                              ; preds = %63
  store i32 -1, ptr %36, align 4, !tbaa !5
  %276 = load i32, ptr %36, align 4, !tbaa !5
  call void @LAPACKE_xerbla(ptr noundef @.str, i32 noundef %276)
  br label %277

277:                                              ; preds = %275, %274
  br label %278

278:                                              ; preds = %277, %62
  %279 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %279, ptr %18, align 4
  store i32 1, ptr %40, align 4
  br label %280

280:                                              ; preds = %278, %272
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  %281 = load i32, ptr %18, align 4
  ret i32 %281
}

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

declare void @ctpmqrt_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef) #2

; Function Attrs: nounwind willreturn memory(none)
declare i32 @LAPACKE_lsame(i8 noundef signext, i8 noundef signext) #3

declare void @LAPACKE_xerbla(ptr noundef, i32 noundef) #2

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

declare void @LAPACKE_cge_trans(i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #2

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

; 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 = { "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 willreturn memory(none) "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 = { 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 #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 = { nounwind willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}


; 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 [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @LAPACKE_ctpmqrt_work(i32 noundef %0, i8 noundef signext %1, i8 noundef signext %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, ptr noundef %8, i32 noundef %9, ptr noundef %10, i32 noundef %11, ptr noundef %12, i32 noundef %13, ptr noundef %14, i32 noundef %15, ptr noundef %16) local_unnamed_addr #0 {
  %18 = alloca i8, align 1
  %19 = alloca i8, align 1
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  store i8 %1, ptr %18, align 1, !tbaa !5
  store i8 %2, ptr %19, align 1, !tbaa !5
  store i32 %3, ptr %20, align 4, !tbaa !8
  store i32 %4, ptr %21, align 4, !tbaa !8
  store i32 %5, ptr %22, align 4, !tbaa !8
  store i32 %6, ptr %23, align 4, !tbaa !8
  store i32 %7, ptr %24, align 4, !tbaa !8
  store i32 %9, ptr %25, align 4, !tbaa !8
  store i32 %11, ptr %26, align 4, !tbaa !8
  store i32 %13, ptr %27, align 4, !tbaa !8
  store i32 %15, ptr %28, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %29) #7
  store i32 0, ptr %29, align 4, !tbaa !8
  switch i32 %0, label %95 [
    i32 102, label %34
    i32 101, label %36
  ]

34:                                               ; preds = %17
  call void @ctpmqrt_(ptr noundef nonnull %18, ptr noundef nonnull %19, ptr noundef nonnull %20, ptr noundef nonnull %21, ptr noundef nonnull %22, ptr noundef nonnull %23, ptr noundef nonnull %24, ptr noundef %8, ptr noundef nonnull %25, ptr noundef %10, ptr noundef nonnull %26, ptr noundef %12, ptr noundef nonnull %27, ptr noundef %14, ptr noundef nonnull %28, ptr noundef %16, ptr noundef nonnull %29, i64 noundef 1, i64 noundef 1) #7
  %35 = load i32, ptr %29, align 4, !tbaa !8
  %.lobit = ashr i32 %35, 31
  %spec.select = add nsw i32 %35, %.lobit
  br label %96

36:                                               ; preds = %17
  %37 = tail call i32 @LAPACKE_lsame(i8 noundef signext %1, i8 noundef signext 108) #8
  %.not = icmp eq i32 %37, 0
  br i1 %.not, label %38, label %._crit_edge

38:                                               ; preds = %36
  %39 = tail call i32 @LAPACKE_lsame(i8 noundef signext %1, i8 noundef signext 114) #8
  %.not59 = icmp eq i32 %39, 0
  br i1 %.not59, label %.thread62, label %._crit_edge

.thread62:                                        ; preds = %38
  tail call void @LAPACKE_xerbla(ptr noundef nonnull @.str, i32 noundef -2) #7
  br label %96

._crit_edge:                                      ; preds = %38, %36
  %.047 = phi i32 [ %5, %36 ], [ %3, %38 ]
  %.046 = phi i32 [ %4, %36 ], [ %5, %38 ]
  %.045 = phi i32 [ %3, %36 ], [ %4, %38 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %30) #7
  %40 = tail call i32 @llvm.smax.i32(i32 %.047, i32 1)
  store i32 %40, ptr %30, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %31) #7
  %41 = tail call i32 @llvm.smax.i32(i32 %3, i32 1)
  store i32 %41, ptr %31, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %32) #7
  %42 = tail call i32 @llvm.smax.i32(i32 %7, i32 1)
  store i32 %42, ptr %32, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %33) #7
  %43 = tail call i32 @llvm.smax.i32(i32 %.045, i32 1)
  store i32 %43, ptr %33, align 4, !tbaa !8
  %44 = icmp sgt i32 %.046, %13
  br i1 %44, label %.thread65, label %45

45:                                               ; preds = %._crit_edge
  %46 = icmp slt i32 %15, %4
  br i1 %46, label %.thread65, label %47

47:                                               ; preds = %45
  %48 = icmp slt i32 %11, %5
  br i1 %48, label %.thread65, label %49

49:                                               ; preds = %47
  %50 = icmp slt i32 %9, %5
  br i1 %50, label %.thread65, label %51

51:                                               ; preds = %49
  %52 = zext nneg i32 %43 to i64
  %53 = tail call i32 @llvm.smax.i32(i32 %5, i32 1)
  %54 = zext nneg i32 %53 to i64
  %55 = shl nuw nsw i64 %54, 3
  %56 = mul i64 %55, %52
  %57 = tail call noalias ptr @malloc(i64 noundef %56) #9
  %58 = icmp eq ptr %57, null
  br i1 %58, label %.thread, label %59

.thread:                                          ; preds = %51
  store i32 -1011, ptr %29, align 4, !tbaa !8
  br label %93

59:                                               ; preds = %51
  %60 = zext nneg i32 %42 to i64
  %61 = mul i64 %55, %60
  %62 = tail call noalias ptr @malloc(i64 noundef %61) #9
  %63 = icmp eq ptr %62, null
  br i1 %63, label %.thread60, label %64

.thread60:                                        ; preds = %59
  store i32 -1011, ptr %29, align 4, !tbaa !8
  tail call void @free(ptr noundef nonnull %57) #7
  br label %93

64:                                               ; preds = %59
  %65 = zext nneg i32 %40 to i64
  %66 = tail call i32 @llvm.smax.i32(i32 %.046, i32 1)
  %67 = zext nneg i32 %66 to i64
  %68 = shl nuw nsw i64 %67, 3
  %69 = mul i64 %68, %65
  %70 = tail call noalias ptr @malloc(i64 noundef %69) #9
  %71 = icmp eq ptr %70, null
  br i1 %71, label %.critedge, label %72

.critedge:                                        ; preds = %64
  store i32 -1011, ptr %29, align 4, !tbaa !8
  tail call void @free(ptr noundef nonnull %62) #7
  tail call void @free(ptr noundef nonnull %57) #7
  br label %93

72:                                               ; preds = %64
  %73 = zext nneg i32 %41 to i64
  %74 = shl nuw nsw i64 %73, 3
  %75 = tail call i32 @llvm.smax.i32(i32 %4, i32 1)
  %76 = zext nneg i32 %75 to i64
  %77 = mul i64 %74, %76
  %78 = tail call noalias ptr @malloc(i64 noundef %77) #9
  %79 = icmp eq ptr %78, null
  br i1 %79, label %80, label %81

80:                                               ; preds = %72
  store i32 -1011, ptr %29, align 4, !tbaa !8
  br label %91

81:                                               ; preds = %72
  tail call void @LAPACKE_cge_trans(i32 noundef 101, i32 noundef %.045, i32 noundef %5, ptr noundef %8, i32 noundef %9, ptr noundef nonnull %57, i32 noundef %43) #7
  tail call void @LAPACKE_cge_trans(i32 noundef 101, i32 noundef %7, i32 noundef %5, ptr noundef %10, i32 noundef %11, ptr noundef nonnull %62, i32 noundef %42) #7
  tail call void @LAPACKE_cge_trans(i32 noundef 101, i32 noundef %.047, i32 noundef %.046, ptr noundef %12, i32 noundef %13, ptr noundef nonnull %70, i32 noundef %40) #7
  tail call void @LAPACKE_cge_trans(i32 noundef 101, i32 noundef %3, i32 noundef %4, ptr noundef %14, i32 noundef %15, ptr noundef nonnull %78, i32 noundef %41) #7
  call void @ctpmqrt_(ptr noundef nonnull %18, ptr noundef nonnull %19, ptr noundef nonnull %20, ptr noundef nonnull %21, ptr noundef nonnull %22, ptr noundef nonnull %23, ptr noundef nonnull %24, ptr noundef nonnull %57, ptr noundef nonnull %33, ptr noundef nonnull %62, ptr noundef nonnull %32, ptr noundef nonnull %70, ptr noundef nonnull %30, ptr noundef nonnull %78, ptr noundef nonnull %31, ptr noundef %16, ptr noundef nonnull %29, i64 noundef 1, i64 noundef 1) #7
  %82 = load i32, ptr %29, align 4, !tbaa !8
  %83 = icmp slt i32 %82, 0
  br i1 %83, label %84, label %86

84:                                               ; preds = %81
  %85 = add nsw i32 %82, -1
  store i32 %85, ptr %29, align 4, !tbaa !8
  br label %86

86:                                               ; preds = %84, %81
  %87 = load i32, ptr %30, align 4, !tbaa !8
  call void @LAPACKE_cge_trans(i32 noundef 102, i32 noundef %.047, i32 noundef %.046, ptr noundef nonnull %70, i32 noundef %87, ptr noundef %12, i32 noundef %13) #7
  %88 = load i32, ptr %20, align 4, !tbaa !8
  %89 = load i32, ptr %21, align 4, !tbaa !8
  %90 = load i32, ptr %31, align 4, !tbaa !8
  call void @LAPACKE_cge_trans(i32 noundef 102, i32 noundef %88, i32 noundef %89, ptr noundef nonnull %78, i32 noundef %90, ptr noundef %14, i32 noundef %15) #7
  call void @free(ptr noundef nonnull %78) #7
  %.pr.pr.pr.pre = load i32, ptr %29, align 4, !tbaa !8
  br label %91

91:                                               ; preds = %86, %80
  %.pr.pr.pr = phi i32 [ %.pr.pr.pr.pre, %86 ], [ -1011, %80 ]
  call void @free(ptr noundef nonnull %70) #7
  %92 = icmp eq i32 %.pr.pr.pr, -1011
  call void @free(ptr noundef nonnull %62) #7
  call void @free(ptr noundef nonnull %57) #7
  br i1 %92, label %93, label %94

93:                                               ; preds = %.critedge, %.thread60, %.thread, %91
  call void @LAPACKE_xerbla(ptr noundef nonnull @.str, i32 noundef -1011) #7
  %.pre.pre = load i32, ptr %29, align 4, !tbaa !8
  br label %94

.thread65:                                        ; preds = %49, %47, %45, %._crit_edge
  %.sink = phi i32 [ -14, %._crit_edge ], [ -16, %45 ], [ -12, %47 ], [ -10, %49 ]
  tail call void @LAPACKE_xerbla(ptr noundef nonnull @.str, i32 noundef %.sink) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %33) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %30) #7
  br label %96

94:                                               ; preds = %93, %91
  %.pre = phi i32 [ %.pre.pre, %93 ], [ %.pr.pr.pr, %91 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %33) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %30) #7
  br label %96

95:                                               ; preds = %17
  tail call void @LAPACKE_xerbla(ptr noundef nonnull @.str, i32 noundef -1) #7
  br label %96

96:                                               ; preds = %34, %95, %94, %.thread65, %.thread62
  %.2 = phi i32 [ -2, %.thread62 ], [ %.sink, %.thread65 ], [ %.pre, %94 ], [ -1, %95 ], [ %spec.select, %34 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #7
  ret i32 %.2
}

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

declare void @ctpmqrt_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare i32 @LAPACKE_lsame(i8 noundef signext, i8 noundef signext) local_unnamed_addr #3

declare void @LAPACKE_xerbla(ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare void @LAPACKE_cge_trans(i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 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 #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}


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