; LLVM IR from Derek-TH-Wang/quadruped_ctrl :: src/MPC_Ctrl/SolverMPC.ll (Z14resize_qp_matss)

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

%"class.Eigen::Matrix.33" = type { %"class.Eigen::PlainObjectBase.34" }
%"class.Eigen::PlainObjectBase.34" = type { %"class.Eigen::DenseStorage.41" }
%"class.Eigen::DenseStorage.41" = type { ptr, i64 }
%"class.Eigen::Matrix.42" = type { %"class.Eigen::PlainObjectBase.43" }
%"class.Eigen::PlainObjectBase.43" = type { %"class.Eigen::DenseStorage.50" }
%"class.Eigen::DenseStorage.50" = type { ptr, i64, i64 }
%"class.Eigen::Matrix.81" = type { %"class.Eigen::PlainObjectBase.82" }
%"class.Eigen::PlainObjectBase.82" = type { %"class.Eigen::DenseStorage.89" }
%"class.Eigen::DenseStorage.89" = type { ptr, i64 }

@A_qp = external dso_local global %"class.Eigen::Matrix.33", align 8
@B_qp = external dso_local global %"class.Eigen::Matrix.42", align 8
@S = external dso_local global %"class.Eigen::Matrix.42", align 8
@X_d = external dso_local global %"class.Eigen::Matrix.81", align 8
@U_b = external dso_local global %"class.Eigen::Matrix.81", align 8
@fmat = external dso_local global %"class.Eigen::Matrix.42", align 8
@qH = external dso_local global %"class.Eigen::Matrix.42", align 8
@qg = external dso_local global %"class.Eigen::Matrix.81", align 8
@eye_12h = external dso_local global %"class.Eigen::Matrix.42", align 8
@H_qpoases = external dso_local global ptr, align 8
@g_qpoases = external dso_local global ptr, align 8
@A_qpoases = external dso_local global ptr, align 8
@lb_qpoases = external dso_local global ptr, align 8
@ub_qpoases = external dso_local global ptr, align 8
@q_soln = external dso_local global ptr, align 8
@H_red = external dso_local global ptr, align 8
@g_red = external dso_local global ptr, align 8
@A_red = external dso_local global ptr, align 8
@lb_red = external dso_local global ptr, align 8
@ub_red = external dso_local global ptr, align 8
@q_red = external dso_local global ptr, align 8
@real_allocated = external dso_local global 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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14resize_qp_matss(i16 noundef signext %0) #1 {
  %2 = alloca i16, align 2
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store i16 %0, ptr %2, align 2, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %5 = load i16, ptr %2, align 2, !tbaa !5
  %6 = sext i16 %5 to i32
  %7 = load i16, ptr %2, align 2, !tbaa !5
  %8 = sext i16 %7 to i32
  %9 = mul nsw i32 %6, %8
  store i32 %9, ptr %4, align 4, !tbaa !9
  %10 = load i16, ptr %2, align 2, !tbaa !5
  %11 = sext i16 %10 to i32
  %12 = mul nsw i32 13, %11
  %13 = sext i32 %12 to i64
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi13ELi0ELin1ELi13EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16) @A_qp, i64 noundef %13, i32 noundef 0)
  %14 = load i16, ptr %2, align 2, !tbaa !5
  %15 = sext i16 %14 to i32
  %16 = mul nsw i32 13, %15
  %17 = mul nsw i32 %16, 1
  %18 = load i32, ptr %3, align 4, !tbaa !9
  %19 = add nsw i32 %18, %17
  store i32 %19, ptr %3, align 4, !tbaa !9
  %20 = load i16, ptr %2, align 2, !tbaa !5
  %21 = sext i16 %20 to i32
  %22 = mul nsw i32 13, %21
  %23 = sext i32 %22 to i64
  %24 = load i16, ptr %2, align 2, !tbaa !5
  %25 = sext i16 %24 to i32
  %26 = mul nsw i32 12, %25
  %27 = sext i32 %26 to i64
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24) @B_qp, i64 noundef %23, i64 noundef %27)
  %28 = load i32, ptr %4, align 4, !tbaa !9
  %29 = mul nsw i32 13, %28
  %30 = mul nsw i32 %29, 12
  %31 = load i32, ptr %3, align 4, !tbaa !9
  %32 = add nsw i32 %31, %30
  store i32 %32, ptr %3, align 4, !tbaa !9
  %33 = load i16, ptr %2, align 2, !tbaa !5
  %34 = sext i16 %33 to i32
  %35 = mul nsw i32 13, %34
  %36 = sext i32 %35 to i64
  %37 = load i16, ptr %2, align 2, !tbaa !5
  %38 = sext i16 %37 to i32
  %39 = mul nsw i32 13, %38
  %40 = sext i32 %39 to i64
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %36, i64 noundef %40)
  %41 = load i32, ptr %4, align 4, !tbaa !9
  %42 = mul nsw i32 169, %41
  %43 = load i32, ptr %3, align 4, !tbaa !9
  %44 = add nsw i32 %43, %42
  store i32 %44, ptr %3, align 4, !tbaa !9
  %45 = load i16, ptr %2, align 2, !tbaa !5
  %46 = sext i16 %45 to i32
  %47 = mul nsw i32 13, %46
  %48 = sext i32 %47 to i64
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16) @X_d, i64 noundef %48, i32 noundef 0)
  %49 = load i16, ptr %2, align 2, !tbaa !5
  %50 = sext i16 %49 to i32
  %51 = mul nsw i32 13, %50
  %52 = load i32, ptr %3, align 4, !tbaa !9
  %53 = add nsw i32 %52, %51
  store i32 %53, ptr %3, align 4, !tbaa !9
  %54 = load i16, ptr %2, align 2, !tbaa !5
  %55 = sext i16 %54 to i32
  %56 = mul nsw i32 20, %55
  %57 = sext i32 %56 to i64
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16) @U_b, i64 noundef %57, i32 noundef 0)
  %58 = load i16, ptr %2, align 2, !tbaa !5
  %59 = sext i16 %58 to i32
  %60 = mul nsw i32 20, %59
  %61 = load i32, ptr %3, align 4, !tbaa !9
  %62 = add nsw i32 %61, %60
  store i32 %62, ptr %3, align 4, !tbaa !9
  %63 = load i16, ptr %2, align 2, !tbaa !5
  %64 = sext i16 %63 to i32
  %65 = mul nsw i32 20, %64
  %66 = sext i32 %65 to i64
  %67 = load i16, ptr %2, align 2, !tbaa !5
  %68 = sext i16 %67 to i32
  %69 = mul nsw i32 12, %68
  %70 = sext i32 %69 to i64
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24) @fmat, i64 noundef %66, i64 noundef %70)
  %71 = load i32, ptr %4, align 4, !tbaa !9
  %72 = mul nsw i32 240, %71
  %73 = load i32, ptr %3, align 4, !tbaa !9
  %74 = add nsw i32 %73, %72
  store i32 %74, ptr %3, align 4, !tbaa !9
  %75 = load i16, ptr %2, align 2, !tbaa !5
  %76 = sext i16 %75 to i32
  %77 = mul nsw i32 12, %76
  %78 = sext i32 %77 to i64
  %79 = load i16, ptr %2, align 2, !tbaa !5
  %80 = sext i16 %79 to i32
  %81 = mul nsw i32 12, %80
  %82 = sext i32 %81 to i64
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24) @qH, i64 noundef %78, i64 noundef %82)
  %83 = load i32, ptr %4, align 4, !tbaa !9
  %84 = mul nsw i32 144, %83
  %85 = load i32, ptr %3, align 4, !tbaa !9
  %86 = add nsw i32 %85, %84
  store i32 %86, ptr %3, align 4, !tbaa !9
  %87 = load i16, ptr %2, align 2, !tbaa !5
  %88 = sext i16 %87 to i32
  %89 = mul nsw i32 12, %88
  %90 = sext i32 %89 to i64
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16) @qg, i64 noundef %90, i32 noundef 0)
  %91 = load i16, ptr %2, align 2, !tbaa !5
  %92 = sext i16 %91 to i32
  %93 = mul nsw i32 12, %92
  %94 = load i32, ptr %3, align 4, !tbaa !9
  %95 = add nsw i32 %94, %93
  store i32 %95, ptr %3, align 4, !tbaa !9
  %96 = load i16, ptr %2, align 2, !tbaa !5
  %97 = sext i16 %96 to i32
  %98 = mul nsw i32 12, %97
  %99 = sext i32 %98 to i64
  %100 = load i16, ptr %2, align 2, !tbaa !5
  %101 = sext i16 %100 to i32
  %102 = mul nsw i32 12, %101
  %103 = sext i32 %102 to i64
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24) @eye_12h, i64 noundef %99, i64 noundef %103)
  %104 = load i16, ptr %2, align 2, !tbaa !5
  %105 = sext i16 %104 to i32
  %106 = mul nsw i32 144, %105
  %107 = load i32, ptr %3, align 4, !tbaa !9
  %108 = add nsw i32 %107, %106
  store i32 %108, ptr %3, align 4, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !9
  %109 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELi13ELi0ELin1ELi13EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @A_qp)
  %110 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @B_qp)
  %111 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @S)
  %112 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @X_d)
  %113 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @U_b)
  %114 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @fmat)
  %115 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @qH)
  %116 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen10MatrixBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE11setIdentityEv(ptr noundef nonnull align 1 dereferenceable(1) @eye_12h)
  %117 = load i8, ptr @real_allocated, align 1, !tbaa !11
  %118 = icmp ne i8 %117, 0
  br i1 %118, label %119, label %132

119:                                              ; preds = %1
  %120 = load ptr, ptr @H_qpoases, align 8, !tbaa !12
  call void @free(ptr noundef %120) #5
  %121 = load ptr, ptr @g_qpoases, align 8, !tbaa !12
  call void @free(ptr noundef %121) #5
  %122 = load ptr, ptr @A_qpoases, align 8, !tbaa !12
  call void @free(ptr noundef %122) #5
  %123 = load ptr, ptr @lb_qpoases, align 8, !tbaa !12
  call void @free(ptr noundef %123) #5
  %124 = load ptr, ptr @ub_qpoases, align 8, !tbaa !12
  call void @free(ptr noundef %124) #5
  %125 = load ptr, ptr @q_soln, align 8, !tbaa !12
  call void @free(ptr noundef %125) #5
  %126 = load ptr, ptr @H_red, align 8, !tbaa !12
  call void @free(ptr noundef %126) #5
  %127 = load ptr, ptr @g_red, align 8, !tbaa !12
  call void @free(ptr noundef %127) #5
  %128 = load ptr, ptr @A_red, align 8, !tbaa !12
  call void @free(ptr noundef %128) #5
  %129 = load ptr, ptr @lb_red, align 8, !tbaa !12
  call void @free(ptr noundef %129) #5
  %130 = load ptr, ptr @ub_red, align 8, !tbaa !12
  call void @free(ptr noundef %130) #5
  %131 = load ptr, ptr @q_red, align 8, !tbaa !12
  call void @free(ptr noundef %131) #5
  br label %132

132:                                              ; preds = %119, %1
  %133 = load i16, ptr %2, align 2, !tbaa !5
  %134 = sext i16 %133 to i32
  %135 = mul nsw i32 144, %134
  %136 = load i16, ptr %2, align 2, !tbaa !5
  %137 = sext i16 %136 to i32
  %138 = mul nsw i32 %135, %137
  %139 = sext i32 %138 to i64
  %140 = mul i64 %139, 8
  %141 = call noalias ptr @malloc(i64 noundef %140) #6
  store ptr %141, ptr @H_qpoases, align 8, !tbaa !12
  %142 = load i32, ptr %4, align 4, !tbaa !9
  %143 = mul nsw i32 144, %142
  %144 = load i32, ptr %3, align 4, !tbaa !9
  %145 = add nsw i32 %144, %143
  store i32 %145, ptr %3, align 4, !tbaa !9
  %146 = load i16, ptr %2, align 2, !tbaa !5
  %147 = sext i16 %146 to i32
  %148 = mul nsw i32 12, %147
  %149 = sext i32 %148 to i64
  %150 = mul i64 %149, 8
  %151 = call noalias ptr @malloc(i64 noundef %150) #6
  store ptr %151, ptr @g_qpoases, align 8, !tbaa !12
  %152 = load i16, ptr %2, align 2, !tbaa !5
  %153 = sext i16 %152 to i32
  %154 = mul nsw i32 12, %153
  %155 = load i32, ptr %3, align 4, !tbaa !9
  %156 = add nsw i32 %155, %154
  store i32 %156, ptr %3, align 4, !tbaa !9
  %157 = load i16, ptr %2, align 2, !tbaa !5
  %158 = sext i16 %157 to i32
  %159 = mul nsw i32 240, %158
  %160 = load i16, ptr %2, align 2, !tbaa !5
  %161 = sext i16 %160 to i32
  %162 = mul nsw i32 %159, %161
  %163 = sext i32 %162 to i64
  %164 = mul i64 %163, 8
  %165 = call noalias ptr @malloc(i64 noundef %164) #6
  store ptr %165, ptr @A_qpoases, align 8, !tbaa !12
  %166 = load i32, ptr %4, align 4, !tbaa !9
  %167 = mul nsw i32 240, %166
  %168 = load i32, ptr %3, align 4, !tbaa !9
  %169 = add nsw i32 %168, %167
  store i32 %169, ptr %3, align 4, !tbaa !9
  %170 = load i16, ptr %2, align 2, !tbaa !5
  %171 = sext i16 %170 to i32
  %172 = mul nsw i32 20, %171
  %173 = sext i32 %172 to i64
  %174 = mul i64 %173, 8
  %175 = call noalias ptr @malloc(i64 noundef %174) #6
  store ptr %175, ptr @lb_qpoases, align 8, !tbaa !12
  %176 = load i16, ptr %2, align 2, !tbaa !5
  %177 = sext i16 %176 to i32
  %178 = mul nsw i32 20, %177
  %179 = load i32, ptr %3, align 4, !tbaa !9
  %180 = add nsw i32 %179, %178
  store i32 %180, ptr %3, align 4, !tbaa !9
  %181 = load i16, ptr %2, align 2, !tbaa !5
  %182 = sext i16 %181 to i32
  %183 = mul nsw i32 20, %182
  %184 = sext i32 %183 to i64
  %185 = mul i64 %184, 8
  %186 = call noalias ptr @malloc(i64 noundef %185) #6
  store ptr %186, ptr @ub_qpoases, align 8, !tbaa !12
  %187 = load i16, ptr %2, align 2, !tbaa !5
  %188 = sext i16 %187 to i32
  %189 = mul nsw i32 20, %188
  %190 = load i32, ptr %3, align 4, !tbaa !9
  %191 = add nsw i32 %190, %189
  store i32 %191, ptr %3, align 4, !tbaa !9
  %192 = load i16, ptr %2, align 2, !tbaa !5
  %193 = sext i16 %192 to i32
  %194 = mul nsw i32 12, %193
  %195 = sext i32 %194 to i64
  %196 = mul i64 %195, 8
  %197 = call noalias ptr @malloc(i64 noundef %196) #6
  store ptr %197, ptr @q_soln, align 8, !tbaa !12
  %198 = load i16, ptr %2, align 2, !tbaa !5
  %199 = sext i16 %198 to i32
  %200 = mul nsw i32 12, %199
  %201 = load i32, ptr %3, align 4, !tbaa !9
  %202 = add nsw i32 %201, %200
  store i32 %202, ptr %3, align 4, !tbaa !9
  %203 = load i16, ptr %2, align 2, !tbaa !5
  %204 = sext i16 %203 to i32
  %205 = mul nsw i32 144, %204
  %206 = load i16, ptr %2, align 2, !tbaa !5
  %207 = sext i16 %206 to i32
  %208 = mul nsw i32 %205, %207
  %209 = sext i32 %208 to i64
  %210 = mul i64 %209, 8
  %211 = call noalias ptr @malloc(i64 noundef %210) #6
  store ptr %211, ptr @H_red, align 8, !tbaa !12
  %212 = load i32, ptr %4, align 4, !tbaa !9
  %213 = mul nsw i32 144, %212
  %214 = load i32, ptr %3, align 4, !tbaa !9
  %215 = add nsw i32 %214, %213
  store i32 %215, ptr %3, align 4, !tbaa !9
  %216 = load i16, ptr %2, align 2, !tbaa !5
  %217 = sext i16 %216 to i32
  %218 = mul nsw i32 12, %217
  %219 = sext i32 %218 to i64
  %220 = mul i64 %219, 8
  %221 = call noalias ptr @malloc(i64 noundef %220) #6
  store ptr %221, ptr @g_red, align 8, !tbaa !12
  %222 = load i16, ptr %2, align 2, !tbaa !5
  %223 = sext i16 %222 to i32
  %224 = mul nsw i32 12, %223
  %225 = load i32, ptr %3, align 4, !tbaa !9
  %226 = add nsw i32 %225, %224
  store i32 %226, ptr %3, align 4, !tbaa !9
  %227 = load i16, ptr %2, align 2, !tbaa !5
  %228 = sext i16 %227 to i32
  %229 = mul nsw i32 240, %228
  %230 = load i16, ptr %2, align 2, !tbaa !5
  %231 = sext i16 %230 to i32
  %232 = mul nsw i32 %229, %231
  %233 = sext i32 %232 to i64
  %234 = mul i64 %233, 8
  %235 = call noalias ptr @malloc(i64 noundef %234) #6
  store ptr %235, ptr @A_red, align 8, !tbaa !12
  %236 = load i32, ptr %4, align 4, !tbaa !9
  %237 = mul nsw i32 240, %236
  %238 = load i32, ptr %3, align 4, !tbaa !9
  %239 = add nsw i32 %238, %237
  store i32 %239, ptr %3, align 4, !tbaa !9
  %240 = load i16, ptr %2, align 2, !tbaa !5
  %241 = sext i16 %240 to i32
  %242 = mul nsw i32 20, %241
  %243 = sext i32 %242 to i64
  %244 = mul i64 %243, 8
  %245 = call noalias ptr @malloc(i64 noundef %244) #6
  store ptr %245, ptr @lb_red, align 8, !tbaa !12
  %246 = load i16, ptr %2, align 2, !tbaa !5
  %247 = sext i16 %246 to i32
  %248 = mul nsw i32 20, %247
  %249 = load i32, ptr %3, align 4, !tbaa !9
  %250 = add nsw i32 %249, %248
  store i32 %250, ptr %3, align 4, !tbaa !9
  %251 = load i16, ptr %2, align 2, !tbaa !5
  %252 = sext i16 %251 to i32
  %253 = mul nsw i32 20, %252
  %254 = sext i32 %253 to i64
  %255 = mul i64 %254, 8
  %256 = call noalias ptr @malloc(i64 noundef %255) #6
  store ptr %256, ptr @ub_red, align 8, !tbaa !12
  %257 = load i16, ptr %2, align 2, !tbaa !5
  %258 = sext i16 %257 to i32
  %259 = mul nsw i32 20, %258
  %260 = load i32, ptr %3, align 4, !tbaa !9
  %261 = add nsw i32 %260, %259
  store i32 %261, ptr %3, align 4, !tbaa !9
  %262 = load i16, ptr %2, align 2, !tbaa !5
  %263 = sext i16 %262 to i32
  %264 = mul nsw i32 12, %263
  %265 = sext i32 %264 to i64
  %266 = mul i64 %265, 8
  %267 = call noalias ptr @malloc(i64 noundef %266) #6
  store ptr %267, ptr @q_red, align 8, !tbaa !12
  %268 = load i16, ptr %2, align 2, !tbaa !5
  %269 = sext i16 %268 to i32
  %270 = mul nsw i32 12, %269
  %271 = load i32, ptr %3, align 4, !tbaa !9
  %272 = add nsw i32 %271, %270
  store i32 %272, ptr %3, align 4, !tbaa !9
  store i8 1, ptr @real_allocated, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi13ELi0ELin1ELi13EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELi13ELi0ELin1ELi13EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen10MatrixBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE11setIdentityEv(ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { inlinehint mustprogress 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 = { 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 }
attributes #6 = { 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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"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"

%"class.Eigen::Matrix.33" = type { %"class.Eigen::PlainObjectBase.34" }
%"class.Eigen::PlainObjectBase.34" = type { %"class.Eigen::DenseStorage.41" }
%"class.Eigen::DenseStorage.41" = type { ptr, i64 }
%"class.Eigen::Matrix.42" = type { %"class.Eigen::PlainObjectBase.43" }
%"class.Eigen::PlainObjectBase.43" = type { %"class.Eigen::DenseStorage.50" }
%"class.Eigen::DenseStorage.50" = type { ptr, i64, i64 }
%"class.Eigen::Matrix.81" = type { %"class.Eigen::PlainObjectBase.82" }
%"class.Eigen::PlainObjectBase.82" = type { %"class.Eigen::DenseStorage.89" }
%"class.Eigen::DenseStorage.89" = type { ptr, i64 }

@A_qp = external dso_local global %"class.Eigen::Matrix.33", align 8
@B_qp = external dso_local global %"class.Eigen::Matrix.42", align 8
@S = external dso_local global %"class.Eigen::Matrix.42", align 8
@X_d = external dso_local global %"class.Eigen::Matrix.81", align 8
@U_b = external dso_local global %"class.Eigen::Matrix.81", align 8
@fmat = external dso_local global %"class.Eigen::Matrix.42", align 8
@qH = external dso_local global %"class.Eigen::Matrix.42", align 8
@qg = external dso_local global %"class.Eigen::Matrix.81", align 8
@eye_12h = external dso_local global %"class.Eigen::Matrix.42", align 8
@H_qpoases = external dso_local local_unnamed_addr global ptr, align 8
@g_qpoases = external dso_local local_unnamed_addr global ptr, align 8
@A_qpoases = external dso_local local_unnamed_addr global ptr, align 8
@lb_qpoases = external dso_local local_unnamed_addr global ptr, align 8
@ub_qpoases = external dso_local local_unnamed_addr global ptr, align 8
@q_soln = external dso_local local_unnamed_addr global ptr, align 8
@H_red = external dso_local local_unnamed_addr global ptr, align 8
@g_red = external dso_local local_unnamed_addr global ptr, align 8
@A_red = external dso_local local_unnamed_addr global ptr, align 8
@lb_red = external dso_local local_unnamed_addr global ptr, align 8
@ub_red = external dso_local local_unnamed_addr global ptr, align 8
@q_red = external dso_local local_unnamed_addr global ptr, align 8
@real_allocated = external dso_local local_unnamed_addr global i8, align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14resize_qp_matss(i16 noundef signext %0) local_unnamed_addr #0 {
  %2 = sext i16 %0 to i32
  %3 = mul nsw i32 %2, 13
  %4 = sext i32 %3 to i64
  tail call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi13ELi0ELin1ELi13EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16) @A_qp, i64 noundef %4, i32 noundef 0)
  %5 = mul nsw i32 %2, 12
  %6 = sext i32 %5 to i64
  tail call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24) @B_qp, i64 noundef %4, i64 noundef %6)
  tail call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %4, i64 noundef %4)
  tail call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16) @X_d, i64 noundef %4, i32 noundef 0)
  %7 = mul nsw i32 %2, 20
  %8 = sext i32 %7 to i64
  tail call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16) @U_b, i64 noundef %8, i32 noundef 0)
  tail call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24) @fmat, i64 noundef %8, i64 noundef %6)
  tail call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24) @qH, i64 noundef %6, i64 noundef %6)
  tail call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16) @qg, i64 noundef %6, i32 noundef 0)
  tail call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24) @eye_12h, i64 noundef %6, i64 noundef %6)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELi13ELi0ELin1ELi13EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @A_qp)
  %10 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @B_qp)
  %11 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @S)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @X_d)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @U_b)
  %14 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @fmat)
  %15 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) @qH)
  %16 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen10MatrixBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE11setIdentityEv(ptr noundef nonnull align 1 dereferenceable(1) @eye_12h)
  %17 = load i8, ptr @real_allocated, align 1, !tbaa !5
  %.not = icmp eq i8 %17, 0
  br i1 %.not, label %31, label %18

18:                                               ; preds = %1
  %19 = load ptr, ptr @H_qpoases, align 8, !tbaa !8
  tail call void @free(ptr noundef %19) #4
  %20 = load ptr, ptr @g_qpoases, align 8, !tbaa !8
  tail call void @free(ptr noundef %20) #4
  %21 = load ptr, ptr @A_qpoases, align 8, !tbaa !8
  tail call void @free(ptr noundef %21) #4
  %22 = load ptr, ptr @lb_qpoases, align 8, !tbaa !8
  tail call void @free(ptr noundef %22) #4
  %23 = load ptr, ptr @ub_qpoases, align 8, !tbaa !8
  tail call void @free(ptr noundef %23) #4
  %24 = load ptr, ptr @q_soln, align 8, !tbaa !8
  tail call void @free(ptr noundef %24) #4
  %25 = load ptr, ptr @H_red, align 8, !tbaa !8
  tail call void @free(ptr noundef %25) #4
  %26 = load ptr, ptr @g_red, align 8, !tbaa !8
  tail call void @free(ptr noundef %26) #4
  %27 = load ptr, ptr @A_red, align 8, !tbaa !8
  tail call void @free(ptr noundef %27) #4
  %28 = load ptr, ptr @lb_red, align 8, !tbaa !8
  tail call void @free(ptr noundef %28) #4
  %29 = load ptr, ptr @ub_red, align 8, !tbaa !8
  tail call void @free(ptr noundef %29) #4
  %30 = load ptr, ptr @q_red, align 8, !tbaa !8
  tail call void @free(ptr noundef %30) #4
  br label %31

31:                                               ; preds = %18, %1
  %32 = mul nsw i32 %2, %2
  %33 = mul i32 %32, 144
  %34 = sext i32 %33 to i64
  %35 = shl nsw i64 %34, 3
  %36 = tail call noalias ptr @malloc(i64 noundef %35) #5
  store ptr %36, ptr @H_qpoases, align 8, !tbaa !8
  %37 = shl nsw i64 %6, 3
  %38 = tail call noalias ptr @malloc(i64 noundef %37) #5
  store ptr %38, ptr @g_qpoases, align 8, !tbaa !8
  %39 = mul i32 %32, 240
  %40 = sext i32 %39 to i64
  %41 = shl nsw i64 %40, 3
  %42 = tail call noalias ptr @malloc(i64 noundef %41) #5
  store ptr %42, ptr @A_qpoases, align 8, !tbaa !8
  %43 = shl nsw i64 %8, 3
  %44 = tail call noalias ptr @malloc(i64 noundef %43) #5
  store ptr %44, ptr @lb_qpoases, align 8, !tbaa !8
  %45 = tail call noalias ptr @malloc(i64 noundef %43) #5
  store ptr %45, ptr @ub_qpoases, align 8, !tbaa !8
  %46 = tail call noalias ptr @malloc(i64 noundef %37) #5
  store ptr %46, ptr @q_soln, align 8, !tbaa !8
  %47 = tail call noalias ptr @malloc(i64 noundef %35) #5
  store ptr %47, ptr @H_red, align 8, !tbaa !8
  %48 = tail call noalias ptr @malloc(i64 noundef %37) #5
  store ptr %48, ptr @g_red, align 8, !tbaa !8
  %49 = tail call noalias ptr @malloc(i64 noundef %41) #5
  store ptr %49, ptr @A_red, align 8, !tbaa !8
  %50 = tail call noalias ptr @malloc(i64 noundef %43) #5
  store ptr %50, ptr @lb_red, align 8, !tbaa !8
  %51 = tail call noalias ptr @malloc(i64 noundef %43) #5
  store ptr %51, ptr @ub_red, align 8, !tbaa !8
  %52 = tail call noalias ptr @malloc(i64 noundef %37) #5
  store ptr %52, ptr @q_red, align 8, !tbaa !8
  store i8 1, ptr @real_allocated, align 1, !tbaa !5
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi13ELi0ELin1ELi13EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE6resizeEll(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE6resizeElNS_10NoChange_tE(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELi13ELi0ELin1ELi13EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIfLin1ELi1ELi0ELin1ELi1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen10MatrixBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE11setIdentityEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture 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 #3

attributes #0 = { mustprogress 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 = { inlinehint mustprogress 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 = { 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 #3 = { 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 #4 = { nounwind }
attributes #5 = { 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++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,TailCallElimPass