; LLVM IR from cvxgrp/scs :: src (scs)

; 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._scs_timer = type { %struct.timespec, %struct.timespec }
%struct.timespec = type { i64, i64 }
%struct.SCS_WORK = type { double, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, double, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, i32, i32, i32, double, i32, i32 }
%struct.ScsData = type { i32, i32, ptr, ptr, ptr, ptr }
%struct.ScsSettings = type { i32, double, i32, double, i32, double, double, double, double, double, i32, i32, i32, i32, ptr, ptr }
%struct.ScsInfo = type { i32, [128 x i8], [128 x i8], i32, i32, double, double, double, double, double, double, double, double, double, double, double, double, i32, i32, double, double, double }
%struct.ScsResiduals = type { i32, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [54 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1

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

declare void @_scs_tic(ptr noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare double @_scs_tocq(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @scs_solve(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #3 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct._scs_timer, align 8
  %12 = alloca %struct._scs_timer, align 8
  %13 = alloca %struct._scs_timer, align 8
  %14 = alloca %struct._scs_timer, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store double 0.000000e+00, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store double 0.000000e+00, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store double 0.000000e+00, ptr %17, align 8, !tbaa !11
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %30

24:                                               ; preds = %4
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %30

27:                                               ; preds = %24
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %32, label %30

30:                                               ; preds = %27, %24, %4
  %31 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 -4, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %368

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.SCS_WORK, ptr %33, i32 0, i32 16
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = getelementptr inbounds %struct.ScsData, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !15
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.SCS_WORK, ptr %38, i32 0, i32 16
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  %41 = getelementptr inbounds %struct.ScsData, ptr %40, i32 0, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !17
  %43 = add nsw i32 %37, %42
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.SCS_WORK, ptr %45, i32 0, i32 17
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  store ptr %47, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.SCS_WORK, ptr %48, i32 0, i32 18
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  store ptr %50, ptr %21, align 8, !tbaa !5
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = load ptr, ptr %21, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.ScsSettings, ptr %52, i32 0, i32 11
  store i32 %51, ptr %53, align 4, !tbaa !20
  call void @_scs_tic(ptr noundef %11)
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ScsInfo, ptr %54, i32 0, i32 2
  %56 = getelementptr inbounds [128 x i8], ptr %55, i64 0, i64 0
  %57 = call ptr @scs_get_lin_sys_method()
  %58 = call ptr @strcpy(ptr noundef %56, ptr noundef %57) #6
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ScsInfo, ptr %59, i32 0, i32 3
  store i32 0, ptr %60, align 4, !tbaa !22
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = call i32 @update_work(ptr noundef %61, ptr noundef %62)
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.SCS_WORK, ptr %64, i32 0, i32 18
  %66 = load ptr, ptr %65, align 8, !tbaa !19
  %67 = getelementptr inbounds %struct.ScsSettings, ptr %66, i32 0, i32 10
  %68 = load i32, ptr %67, align 8, !tbaa !24
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %73

70:                                               ; preds = %32
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = load ptr, ptr %20, align 8, !tbaa !5
  call void @print_header(ptr noundef %71, ptr noundef %72)
  br label %73

73:                                               ; preds = %70, %32
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %309, %73
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.SCS_WORK, ptr %76, i32 0, i32 18
  %78 = load ptr, ptr %77, align 8, !tbaa !19
  %79 = getelementptr inbounds %struct.ScsSettings, ptr %78, i32 0, i32 4
  %80 = load i32, ptr %79, align 8, !tbaa !25
  %81 = icmp slt i32 %75, %80
  br i1 %81, label %82, label %312

82:                                               ; preds = %74
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.SCS_WORK, ptr %83, i32 0, i32 15
  %85 = load ptr, ptr %84, align 8, !tbaa !26
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %116

87:                                               ; preds = %82
  call void @_scs_tic(ptr noundef %14)
  %88 = load i32, ptr %10, align 4, !tbaa !9
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %90, label %112

90:                                               ; preds = %87
  %91 = load i32, ptr %10, align 4, !tbaa !9
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.SCS_WORK, ptr %92, i32 0, i32 18
  %94 = load ptr, ptr %93, align 8, !tbaa !19
  %95 = getelementptr inbounds %struct.ScsSettings, ptr %94, i32 0, i32 13
  %96 = load i32, ptr %95, align 4, !tbaa !27
  %97 = srem i32 %91, %96
  %98 = icmp eq i32 %97, 0
  br i1 %98, label %99, label %112

99:                                               ; preds = %90
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.SCS_WORK, ptr %100, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !28
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.SCS_WORK, ptr %103, i32 0, i32 5
  %105 = load ptr, ptr %104, align 8, !tbaa !29
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.SCS_WORK, ptr %106, i32 0, i32 15
  %108 = load ptr, ptr %107, align 8, !tbaa !26
  %109 = call double @aa_apply(ptr noundef %102, ptr noundef %105, ptr noundef %108)
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.SCS_WORK, ptr %110, i32 0, i32 30
  store double %109, ptr %111, align 8, !tbaa !30
  br label %112

112:                                              ; preds = %99, %90, %87
  %113 = call double @_scs_tocq(ptr noundef %14)
  %114 = load double, ptr %15, align 8, !tbaa !11
  %115 = fadd double %114, %113
  store double %115, ptr %15, align 8, !tbaa !11
  br label %116

116:                                              ; preds = %112, %82
  %117 = load i32, ptr %10, align 4, !tbaa !9
  %118 = icmp sge i32 %117, 1
  br i1 %118, label %119, label %124

119:                                              ; preds = %116
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.SCS_WORK, ptr %120, i32 0, i32 4
  %122 = load ptr, ptr %121, align 8, !tbaa !28
  %123 = load i32, ptr %19, align 4, !tbaa !9
  call void @normalize_v(ptr noundef %122, i32 noundef %123)
  br label %124

124:                                              ; preds = %119, %116
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.SCS_WORK, ptr %125, i32 0, i32 5
  %127 = load ptr, ptr %126, align 8, !tbaa !29
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.SCS_WORK, ptr %128, i32 0, i32 4
  %130 = load ptr, ptr %129, align 8, !tbaa !28
  %131 = load i32, ptr %19, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = mul i64 %132, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %127, ptr align 8 %130, i64 %133, i1 false)
  call void @_scs_tic(ptr noundef %12)
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = load i32, ptr %10, align 4, !tbaa !9
  %136 = call i32 @project_lin_sys(ptr noundef %134, i32 noundef %135)
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %153

138:                                              ; preds = %124
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.SCS_WORK, ptr %140, i32 0, i32 16
  %142 = load ptr, ptr %141, align 8, !tbaa !13
  %143 = getelementptr inbounds %struct.ScsData, ptr %142, i32 0, i32 0
  %144 = load i32, ptr %143, align 8, !tbaa !15
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.SCS_WORK, ptr %145, i32 0, i32 16
  %147 = load ptr, ptr %146, align 8, !tbaa !13
  %148 = getelementptr inbounds %struct.ScsData, ptr %147, i32 0, i32 1
  %149 = load i32, ptr %148, align 4, !tbaa !17
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = call i32 @failure(ptr noundef %139, i32 noundef %144, i32 noundef %149, ptr noundef %150, ptr noundef %151, i32 noundef -4, ptr noundef @.str.1, ptr noundef @.str.2)
  store i32 %152, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %367

153:                                              ; preds = %124
  %154 = call double @_scs_tocq(ptr noundef %12)
  %155 = load double, ptr %17, align 8, !tbaa !11
  %156 = fadd double %155, %154
  store double %156, ptr %17, align 8, !tbaa !11
  call void @_scs_tic(ptr noundef %13)
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = load ptr, ptr %20, align 8, !tbaa !5
  %159 = load i32, ptr %10, align 4, !tbaa !9
  %160 = call i32 @project_cones(ptr noundef %157, ptr noundef %158, i32 noundef %159)
  %161 = icmp slt i32 %160, 0
  br i1 %161, label %162, label %177

162:                                              ; preds = %153
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.SCS_WORK, ptr %164, i32 0, i32 16
  %166 = load ptr, ptr %165, align 8, !tbaa !13
  %167 = getelementptr inbounds %struct.ScsData, ptr %166, i32 0, i32 0
  %168 = load i32, ptr %167, align 8, !tbaa !15
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.SCS_WORK, ptr %169, i32 0, i32 16
  %171 = load ptr, ptr %170, align 8, !tbaa !13
  %172 = getelementptr inbounds %struct.ScsData, ptr %171, i32 0, i32 1
  %173 = load i32, ptr %172, align 4, !tbaa !17
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = load ptr, ptr %8, align 8, !tbaa !5
  %176 = call i32 @failure(ptr noundef %163, i32 noundef %168, i32 noundef %173, ptr noundef %174, ptr noundef %175, i32 noundef -4, ptr noundef @.str.3, ptr noundef @.str.2)
  store i32 %176, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %367

177:                                              ; preds = %153
  %178 = call double @_scs_tocq(ptr noundef %13)
  %179 = load double, ptr %16, align 8, !tbaa !11
  %180 = fadd double %179, %178
  store double %180, ptr %16, align 8, !tbaa !11
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  call void @compute_rsk(ptr noundef %181)
  %182 = load i32, ptr %10, align 4, !tbaa !9
  %183 = srem i32 %182, 25
  %184 = icmp eq i32 %183, 0
  br i1 %184, label %185, label %216

185:                                              ; preds = %177
  %186 = load ptr, ptr %6, align 8, !tbaa !5
  %187 = load i32, ptr %10, align 4, !tbaa !9
  call void @populate_residual_struct(ptr noundef %186, i32 noundef %187)
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  %189 = load i32, ptr %10, align 4, !tbaa !9
  %190 = call i32 @has_converged(ptr noundef %188, i32 noundef %189)
  %191 = load ptr, ptr %8, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.ScsInfo, ptr %191, i32 0, i32 3
  store i32 %190, ptr %192, align 4, !tbaa !22
  %193 = icmp ne i32 %190, 0
  br i1 %193, label %194, label %195

194:                                              ; preds = %185
  br label %312

195:                                              ; preds = %185
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.SCS_WORK, ptr %196, i32 0, i32 18
  %198 = load ptr, ptr %197, align 8, !tbaa !19
  %199 = getelementptr inbounds %struct.ScsSettings, ptr %198, i32 0, i32 9
  %200 = load double, ptr %199, align 8, !tbaa !31
  %201 = fcmp une double %200, 0.000000e+00
  br i1 %201, label %202, label %215

202:                                              ; preds = %195
  %203 = call double @_scs_tocq(ptr noundef %11)
  %204 = load ptr, ptr %6, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.SCS_WORK, ptr %204, i32 0, i32 18
  %206 = load ptr, ptr %205, align 8, !tbaa !19
  %207 = getelementptr inbounds %struct.ScsSettings, ptr %206, i32 0, i32 9
  %208 = load double, ptr %207, align 8, !tbaa !31
  %209 = fmul double 1.000000e+03, %208
  %210 = fcmp ogt double %203, %209
  br i1 %210, label %211, label %214

211:                                              ; preds = %202
  %212 = load ptr, ptr %6, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.SCS_WORK, ptr %212, i32 0, i32 1
  store i32 1, ptr %213, align 8, !tbaa !32
  br label %312

214:                                              ; preds = %202
  br label %215

215:                                              ; preds = %214, %195
  br label %216

216:                                              ; preds = %215, %177
  %217 = load ptr, ptr %6, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.SCS_WORK, ptr %217, i32 0, i32 18
  %219 = load ptr, ptr %218, align 8, !tbaa !19
  %220 = getelementptr inbounds %struct.ScsSettings, ptr %219, i32 0, i32 10
  %221 = load i32, ptr %220, align 8, !tbaa !24
  %222 = icmp ne i32 %221, 0
  br i1 %222, label %223, label %232

223:                                              ; preds = %216
  %224 = load i32, ptr %10, align 4, !tbaa !9
  %225 = srem i32 %224, 250
  %226 = icmp eq i32 %225, 0
  br i1 %226, label %227, label %232

227:                                              ; preds = %223
  %228 = load ptr, ptr %6, align 8, !tbaa !5
  %229 = load i32, ptr %10, align 4, !tbaa !9
  call void @populate_residual_struct(ptr noundef %228, i32 noundef %229)
  %230 = load ptr, ptr %6, align 8, !tbaa !5
  %231 = load i32, ptr %10, align 4, !tbaa !9
  call void @print_summary(ptr noundef %230, i32 noundef %231, ptr noundef %11)
  br label %232

232:                                              ; preds = %227, %223, %216
  %233 = load ptr, ptr %6, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.SCS_WORK, ptr %233, i32 0, i32 18
  %235 = load ptr, ptr %234, align 8, !tbaa !19
  %236 = getelementptr inbounds %struct.ScsSettings, ptr %235, i32 0, i32 2
  %237 = load i32, ptr %236, align 8, !tbaa !33
  %238 = icmp ne i32 %237, 0
  br i1 %238, label %239, label %251

239:                                              ; preds = %232
  %240 = load i32, ptr %10, align 4, !tbaa !9
  %241 = load ptr, ptr %6, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.SCS_WORK, ptr %241, i32 0, i32 22
  %243 = load ptr, ptr %242, align 8, !tbaa !34
  %244 = getelementptr inbounds %struct.ScsResiduals, ptr %243, i32 0, i32 0
  %245 = load i32, ptr %244, align 8, !tbaa !35
  %246 = icmp eq i32 %240, %245
  br i1 %246, label %247, label %251

247:                                              ; preds = %239
  %248 = load ptr, ptr %6, align 8, !tbaa !5
  %249 = load ptr, ptr %20, align 8, !tbaa !5
  %250 = load i32, ptr %10, align 4, !tbaa !9
  call void @update_scale(ptr noundef %248, ptr noundef %249, i32 noundef %250)
  br label %251

251:                                              ; preds = %247, %239, %232
  %252 = load ptr, ptr %6, align 8, !tbaa !5
  call void @update_dual_vars(ptr noundef %252)
  %253 = load ptr, ptr %6, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.SCS_WORK, ptr %253, i32 0, i32 15
  %255 = load ptr, ptr %254, align 8, !tbaa !26
  %256 = icmp ne ptr %255, null
  br i1 %256, label %257, label %294

257:                                              ; preds = %251
  %258 = load i32, ptr %10, align 4, !tbaa !9
  %259 = load ptr, ptr %6, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.SCS_WORK, ptr %259, i32 0, i32 18
  %261 = load ptr, ptr %260, align 8, !tbaa !19
  %262 = getelementptr inbounds %struct.ScsSettings, ptr %261, i32 0, i32 13
  %263 = load i32, ptr %262, align 4, !tbaa !27
  %264 = srem i32 %258, %263
  %265 = icmp eq i32 %264, 0
  br i1 %265, label %266, label %294

266:                                              ; preds = %257
  %267 = load ptr, ptr %6, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.SCS_WORK, ptr %267, i32 0, i32 30
  %269 = load double, ptr %268, align 8, !tbaa !30
  %270 = fcmp ogt double %269, 0.000000e+00
  br i1 %270, label %271, label %294

271:                                              ; preds = %266
  %272 = load ptr, ptr %6, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.SCS_WORK, ptr %272, i32 0, i32 4
  %274 = load ptr, ptr %273, align 8, !tbaa !28
  %275 = load ptr, ptr %6, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.SCS_WORK, ptr %275, i32 0, i32 5
  %277 = load ptr, ptr %276, align 8, !tbaa !29
  %278 = load ptr, ptr %6, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.SCS_WORK, ptr %278, i32 0, i32 15
  %280 = load ptr, ptr %279, align 8, !tbaa !26
  %281 = call i32 @aa_safeguard(ptr noundef %274, ptr noundef %277, ptr noundef %280)
  %282 = icmp slt i32 %281, 0
  br i1 %282, label %283, label %288

283:                                              ; preds = %271
  %284 = load ptr, ptr %6, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.SCS_WORK, ptr %284, i32 0, i32 31
  %286 = load i32, ptr %285, align 8, !tbaa !37
  %287 = add nsw i32 %286, 1
  store i32 %287, ptr %285, align 8, !tbaa !37
  br label %293

288:                                              ; preds = %271
  %289 = load ptr, ptr %6, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.SCS_WORK, ptr %289, i32 0, i32 32
  %291 = load i32, ptr %290, align 4, !tbaa !38
  %292 = add nsw i32 %291, 1
  store i32 %292, ptr %290, align 4, !tbaa !38
  br label %293

293:                                              ; preds = %288, %283
  br label %294

294:                                              ; preds = %293, %266, %257, %251
  %295 = load ptr, ptr %6, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.SCS_WORK, ptr %295, i32 0, i32 18
  %297 = load ptr, ptr %296, align 8, !tbaa !19
  %298 = getelementptr inbounds %struct.ScsSettings, ptr %297, i32 0, i32 15
  %299 = load ptr, ptr %298, align 8, !tbaa !39
  %300 = icmp ne ptr %299, null
  br i1 %300, label %301, label %308

301:                                              ; preds = %294
  %302 = load ptr, ptr %6, align 8, !tbaa !5
  %303 = load i32, ptr %10, align 4, !tbaa !9
  call void @populate_residual_struct(ptr noundef %302, i32 noundef %303)
  %304 = load ptr, ptr %20, align 8, !tbaa !5
  %305 = load ptr, ptr %21, align 8, !tbaa !5
  %306 = load ptr, ptr %6, align 8, !tbaa !5
  %307 = load i32, ptr %10, align 4, !tbaa !9
  call void @_scs_log_data_to_csv(ptr noundef %304, ptr noundef %305, ptr noundef %306, i32 noundef %307, ptr noundef %11)
  br label %308

308:                                              ; preds = %301, %294
  br label %309

309:                                              ; preds = %308
  %310 = load i32, ptr %10, align 4, !tbaa !9
  %311 = add nsw i32 %310, 1
  store i32 %311, ptr %10, align 4, !tbaa !9
  br label %74, !llvm.loop !40

312:                                              ; preds = %211, %194, %74
  %313 = load ptr, ptr %6, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.SCS_WORK, ptr %313, i32 0, i32 18
  %315 = load ptr, ptr %314, align 8, !tbaa !19
  %316 = getelementptr inbounds %struct.ScsSettings, ptr %315, i32 0, i32 15
  %317 = load ptr, ptr %316, align 8, !tbaa !39
  %318 = icmp ne ptr %317, null
  br i1 %318, label %319, label %326

319:                                              ; preds = %312
  %320 = load ptr, ptr %6, align 8, !tbaa !5
  %321 = load i32, ptr %10, align 4, !tbaa !9
  call void @populate_residual_struct(ptr noundef %320, i32 noundef %321)
  %322 = load ptr, ptr %20, align 8, !tbaa !5
  %323 = load ptr, ptr %21, align 8, !tbaa !5
  %324 = load ptr, ptr %6, align 8, !tbaa !5
  %325 = load i32, ptr %10, align 4, !tbaa !9
  call void @_scs_log_data_to_csv(ptr noundef %322, ptr noundef %323, ptr noundef %324, i32 noundef %325, ptr noundef %11)
  br label %326

326:                                              ; preds = %319, %312
  %327 = load ptr, ptr %6, align 8, !tbaa !5
  %328 = getelementptr inbounds %struct.SCS_WORK, ptr %327, i32 0, i32 18
  %329 = load ptr, ptr %328, align 8, !tbaa !19
  %330 = getelementptr inbounds %struct.ScsSettings, ptr %329, i32 0, i32 10
  %331 = load i32, ptr %330, align 8, !tbaa !24
  %332 = icmp ne i32 %331, 0
  br i1 %332, label %333, label %338

333:                                              ; preds = %326
  %334 = load ptr, ptr %6, align 8, !tbaa !5
  %335 = load i32, ptr %10, align 4, !tbaa !9
  call void @populate_residual_struct(ptr noundef %334, i32 noundef %335)
  %336 = load ptr, ptr %6, align 8, !tbaa !5
  %337 = load i32, ptr %10, align 4, !tbaa !9
  call void @print_summary(ptr noundef %336, i32 noundef %337, ptr noundef %11)
  br label %338

338:                                              ; preds = %333, %326
  %339 = load ptr, ptr %6, align 8, !tbaa !5
  %340 = load ptr, ptr %7, align 8, !tbaa !5
  %341 = load ptr, ptr %8, align 8, !tbaa !5
  %342 = load i32, ptr %10, align 4, !tbaa !9
  call void @finalize(ptr noundef %339, ptr noundef %340, ptr noundef %341, i32 noundef %342)
  %343 = call double @_scs_tocq(ptr noundef %11)
  %344 = load ptr, ptr %8, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.ScsInfo, ptr %344, i32 0, i32 14
  store double %343, ptr %345, align 8, !tbaa !42
  %346 = load double, ptr %17, align 8, !tbaa !11
  %347 = load ptr, ptr %8, align 8, !tbaa !5
  %348 = getelementptr inbounds %struct.ScsInfo, ptr %347, i32 0, i32 19
  store double %346, ptr %348, align 8, !tbaa !43
  %349 = load double, ptr %16, align 8, !tbaa !11
  %350 = load ptr, ptr %8, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.ScsInfo, ptr %350, i32 0, i32 20
  store double %349, ptr %351, align 8, !tbaa !44
  %352 = load double, ptr %15, align 8, !tbaa !11
  %353 = load ptr, ptr %8, align 8, !tbaa !5
  %354 = getelementptr inbounds %struct.ScsInfo, ptr %353, i32 0, i32 21
  store double %352, ptr %354, align 8, !tbaa !45
  %355 = load ptr, ptr %6, align 8, !tbaa !5
  %356 = getelementptr inbounds %struct.SCS_WORK, ptr %355, i32 0, i32 18
  %357 = load ptr, ptr %356, align 8, !tbaa !19
  %358 = getelementptr inbounds %struct.ScsSettings, ptr %357, i32 0, i32 10
  %359 = load i32, ptr %358, align 8, !tbaa !24
  %360 = icmp ne i32 %359, 0
  br i1 %360, label %361, label %363

361:                                              ; preds = %338
  %362 = load ptr, ptr %8, align 8, !tbaa !5
  call void @print_footer(ptr noundef %362)
  br label %363

363:                                              ; preds = %361, %338
  %364 = load ptr, ptr %8, align 8, !tbaa !5
  %365 = getelementptr inbounds %struct.ScsInfo, ptr %364, i32 0, i32 3
  %366 = load i32, ptr %365, align 4, !tbaa !22
  store i32 %366, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %367

367:                                              ; preds = %363, %162, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %368

368:                                              ; preds = %367, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %369 = load i32, ptr %5, align 4
  ret i32 %369
}

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

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #4

declare ptr @scs_get_lin_sys_method() #1

; Function Attrs: nounwind uwtable
declare hidden i32 @update_work(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @print_header(ptr noundef, ptr noundef) #3

declare double @aa_apply(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @normalize_v(ptr noundef, i32 noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i32 @project_lin_sys(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @failure(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @project_cones(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @compute_rsk(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare hidden i32 @has_converged(ptr noundef, i32 noundef) #3

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

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

; Function Attrs: nounwind uwtable
declare hidden void @update_dual_vars(ptr noundef) #3

declare i32 @aa_safeguard(ptr noundef, ptr noundef, ptr noundef) #1

declare void @_scs_log_data_to_csv(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare hidden void @print_footer(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint 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 #6 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !6, i64 128}
!14 = !{!"SCS_WORK", !12, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !12, i64 104, !12, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !12, i64 208, !10, i64 216, !10, i64 220, !10, i64 224, !12, i64 232, !10, i64 240, !10, i64 244}
!15 = !{!16, !10, i64 0}
!16 = !{!"", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!17 = !{!16, !10, i64 4}
!18 = !{!14, !6, i64 136}
!19 = !{!14, !6, i64 144}
!20 = !{!21, !10, i64 84}
!21 = !{!"", !10, i64 0, !12, i64 8, !10, i64 16, !12, i64 24, !10, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !6, i64 96, !6, i64 104}
!22 = !{!23, !10, i64 260}
!23 = !{!"", !10, i64 0, !7, i64 4, !7, i64 132, !10, i64 260, !10, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !12, i64 312, !12, i64 320, !12, i64 328, !12, i64 336, !12, i64 344, !12, i64 352, !12, i64 360, !10, i64 368, !10, i64 372, !12, i64 376, !12, i64 384, !12, i64 392}
!24 = !{!21, !10, i64 80}
!25 = !{!21, !10, i64 32}
!26 = !{!14, !6, i64 120}
!27 = !{!21, !10, i64 92}
!28 = !{!14, !6, i64 32}
!29 = !{!14, !6, i64 40}
!30 = !{!14, !12, i64 232}
!31 = !{!21, !12, i64 72}
!32 = !{!14, !10, i64 8}
!33 = !{!21, !10, i64 16}
!34 = !{!14, !6, i64 176}
!35 = !{!36, !10, i64 0}
!36 = !{!"", !10, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!37 = !{!14, !10, i64 240}
!38 = !{!14, !10, i64 244}
!39 = !{!21, !6, i64 104}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!23, !12, i64 344}
!43 = !{!23, !12, i64 376}
!44 = !{!23, !12, i64 384}
!45 = !{!23, !12, i64 392}


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

%struct._scs_timer = type { %struct.timespec, %struct.timespec }
%struct.timespec = type { i64, i64 }

@.str = external hidden unnamed_addr constant [54 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1

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

declare void @_scs_tic(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare double @_scs_tocq(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @scs_solve(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = alloca %struct._scs_timer, align 8
  %6 = alloca %struct._scs_timer, align 8
  %7 = alloca %struct._scs_timer, align 8
  %8 = alloca %struct._scs_timer, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #7
  %9 = icmp ne ptr %1, null
  %10 = icmp ne ptr %0, null
  %or.cond = and i1 %10, %9
  %11 = icmp ne ptr %2, null
  %or.cond3 = and i1 %or.cond, %11
  br i1 %or.cond3, label %14, label %12

12:                                               ; preds = %4
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %181

14:                                               ; preds = %4
  %15 = getelementptr inbounds i8, ptr %0, i64 128
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = load i32, ptr %16, align 8, !tbaa !12
  %18 = getelementptr inbounds i8, ptr %16, i64 4
  %19 = load i32, ptr %18, align 4, !tbaa !14
  %20 = add i32 %17, 1
  %21 = add i32 %20, %19
  %22 = getelementptr inbounds i8, ptr %0, i64 136
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  %24 = getelementptr inbounds i8, ptr %0, i64 144
  %25 = load ptr, ptr %24, align 8, !tbaa !16
  %26 = getelementptr inbounds i8, ptr %25, i64 84
  store i32 %3, ptr %26, align 4, !tbaa !17
  call void @_scs_tic(ptr noundef nonnull %5) #7
  %27 = getelementptr inbounds i8, ptr %2, i64 132
  %28 = call ptr @scs_get_lin_sys_method() #7
  %29 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %27, ptr noundef nonnull dereferenceable(1) %28) #7
  %30 = getelementptr inbounds i8, ptr %2, i64 260
  store i32 0, ptr %30, align 4, !tbaa !19
  %31 = call i32 @update_work(ptr noundef nonnull %0, ptr noundef nonnull %1)
  %32 = load ptr, ptr %24, align 8, !tbaa !16
  %33 = getelementptr inbounds i8, ptr %32, i64 80
  %34 = load i32, ptr %33, align 8, !tbaa !21
  %.not = icmp eq i32 %34, 0
  br i1 %.not, label %36, label %35

35:                                               ; preds = %14
  call void @print_header(ptr noundef nonnull %0, ptr noundef %23)
  %.pre = load ptr, ptr %24, align 8, !tbaa !16
  br label %36

36:                                               ; preds = %35, %14
  %37 = phi ptr [ %.pre, %35 ], [ %32, %14 ]
  %38 = getelementptr inbounds i8, ptr %37, i64 32
  %39 = load i32, ptr %38, align 8, !tbaa !22
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %36
  %41 = getelementptr inbounds i8, ptr %0, i64 120
  %42 = getelementptr inbounds i8, ptr %0, i64 32
  %43 = getelementptr inbounds i8, ptr %0, i64 40
  %44 = getelementptr inbounds i8, ptr %0, i64 232
  %45 = sext i32 %21 to i64
  %46 = shl nsw i64 %45, 3
  %47 = getelementptr inbounds i8, ptr %0, i64 176
  %48 = getelementptr inbounds i8, ptr %0, i64 244
  %49 = getelementptr inbounds i8, ptr %0, i64 240
  br label %50

50:                                               ; preds = %.lr.ph, %154
  %.0119155 = phi i32 [ 0, %.lr.ph ], [ %156, %154 ]
  %.0120154 = phi double [ 0.000000e+00, %.lr.ph ], [ %.1121, %154 ]
  %.0122153 = phi double [ 0.000000e+00, %.lr.ph ], [ %82, %154 ]
  %.0124152 = phi double [ 0.000000e+00, %.lr.ph ], [ %93, %154 ]
  %51 = load ptr, ptr %41, align 8, !tbaa !23
  %.not130 = icmp eq ptr %51, null
  br i1 %.not130, label %67, label %52

52:                                               ; preds = %50
  call void @_scs_tic(ptr noundef nonnull %8) #7
  %.not131 = icmp eq i32 %.0119155, 0
  br i1 %.not131, label %64, label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %24, align 8, !tbaa !16
  %55 = getelementptr inbounds i8, ptr %54, i64 92
  %56 = load i32, ptr %55, align 4, !tbaa !24
  %57 = srem i32 %.0119155, %56
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %64

59:                                               ; preds = %53
  %60 = load ptr, ptr %42, align 8, !tbaa !25
  %61 = load ptr, ptr %43, align 8, !tbaa !26
  %62 = load ptr, ptr %41, align 8, !tbaa !23
  %63 = call double @aa_apply(ptr noundef %60, ptr noundef %61, ptr noundef %62) #7
  store double %63, ptr %44, align 8, !tbaa !27
  br label %64

64:                                               ; preds = %59, %53, %52
  %65 = call double @_scs_tocq(ptr noundef nonnull %8) #7
  %66 = fadd double %.0120154, %65
  br label %67

67:                                               ; preds = %64, %50
  %.1121 = phi double [ %66, %64 ], [ %.0120154, %50 ]
  %.not132 = icmp eq i32 %.0119155, 0
  br i1 %.not132, label %70, label %68

68:                                               ; preds = %67
  %69 = load ptr, ptr %42, align 8, !tbaa !25
  call void @normalize_v(ptr noundef %69, i32 noundef %21)
  br label %70

70:                                               ; preds = %68, %67
  %71 = load ptr, ptr %43, align 8, !tbaa !26
  %72 = load ptr, ptr %42, align 8, !tbaa !25
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %71, ptr align 8 %72, i64 %46, i1 false)
  call void @_scs_tic(ptr noundef nonnull %6) #7
  %73 = call i32 @project_lin_sys(ptr noundef nonnull %0, i32 noundef %.0119155)
  %.not133 = icmp eq i32 %73, 0
  br i1 %.not133, label %80, label %74

74:                                               ; preds = %70
  %75 = load ptr, ptr %15, align 8, !tbaa !5
  %76 = load i32, ptr %75, align 8, !tbaa !12
  %77 = getelementptr inbounds i8, ptr %75, i64 4
  %78 = load i32, ptr %77, align 4, !tbaa !14
  %79 = call i32 @failure(ptr noundef nonnull %0, i32 noundef %76, i32 noundef %78, ptr noundef nonnull %1, ptr noundef nonnull %2, i32 noundef -4, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2)
  br label %181

80:                                               ; preds = %70
  %81 = call double @_scs_tocq(ptr noundef nonnull %6) #7
  %82 = fadd double %.0122153, %81
  call void @_scs_tic(ptr noundef nonnull %7) #7
  %83 = call i32 @project_cones(ptr noundef nonnull %0, ptr noundef %23, i32 noundef %.0119155)
  %84 = icmp slt i32 %83, 0
  br i1 %84, label %85, label %91

85:                                               ; preds = %80
  %86 = load ptr, ptr %15, align 8, !tbaa !5
  %87 = load i32, ptr %86, align 8, !tbaa !12
  %88 = getelementptr inbounds i8, ptr %86, i64 4
  %89 = load i32, ptr %88, align 4, !tbaa !14
  %90 = call i32 @failure(ptr noundef nonnull %0, i32 noundef %87, i32 noundef %89, ptr noundef nonnull %1, ptr noundef nonnull %2, i32 noundef -4, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2)
  br label %181

91:                                               ; preds = %80
  %92 = call double @_scs_tocq(ptr noundef nonnull %7) #7
  %93 = fadd double %.0124152, %92
  call void @compute_rsk(ptr noundef nonnull %0)
  %94 = urem i32 %.0119155, 25
  %95 = icmp eq i32 %94, 0
  br i1 %95, label %96, label %._crit_edge

._crit_edge:                                      ; preds = %91
  %.pre174 = load ptr, ptr %24, align 8, !tbaa !16
  br label %111

96:                                               ; preds = %91
  call void @populate_residual_struct(ptr noundef nonnull %0, i32 noundef %.0119155)
  %97 = call i32 @has_converged(ptr noundef nonnull %0, i32 noundef %.0119155)
  store i32 %97, ptr %30, align 4, !tbaa !19
  %.not134 = icmp eq i32 %97, 0
  %.pre177.pre = load ptr, ptr %24, align 8, !tbaa !16
  br i1 %.not134, label %98, label %.loopexit

98:                                               ; preds = %96
  %99 = getelementptr inbounds i8, ptr %.pre177.pre, i64 72
  %100 = load double, ptr %99, align 8, !tbaa !28
  %101 = fcmp une double %100, 0.000000e+00
  br i1 %101, label %102, label %111

102:                                              ; preds = %98
  %103 = call double @_scs_tocq(ptr noundef nonnull %5) #7
  %104 = load ptr, ptr %24, align 8, !tbaa !16
  %105 = getelementptr inbounds i8, ptr %104, i64 72
  %106 = load double, ptr %105, align 8, !tbaa !28
  %107 = fmul double %106, 1.000000e+03
  %108 = fcmp ogt double %103, %107
  br i1 %108, label %109, label %111

109:                                              ; preds = %102
  %110 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 1, ptr %110, align 8, !tbaa !29
  br label %.loopexit

111:                                              ; preds = %._crit_edge, %98, %102
  %112 = phi ptr [ %.pre174, %._crit_edge ], [ %.pre177.pre, %98 ], [ %104, %102 ]
  %113 = getelementptr inbounds i8, ptr %112, i64 80
  %114 = load i32, ptr %113, align 8, !tbaa !21
  %.not135 = icmp ne i32 %114, 0
  %115 = urem i32 %.0119155, 250
  %116 = icmp eq i32 %115, 0
  %or.cond143 = and i1 %116, %.not135
  br i1 %or.cond143, label %117, label %118

117:                                              ; preds = %111
  call void @populate_residual_struct(ptr noundef nonnull %0, i32 noundef %.0119155)
  call void @print_summary(ptr noundef nonnull %0, i32 noundef %.0119155, ptr noundef nonnull %5)
  %.pre175 = load ptr, ptr %24, align 8, !tbaa !16
  br label %118

118:                                              ; preds = %117, %111
  %119 = phi ptr [ %.pre175, %117 ], [ %112, %111 ]
  %120 = getelementptr inbounds i8, ptr %119, i64 16
  %121 = load i32, ptr %120, align 8, !tbaa !30
  %.not136 = icmp eq i32 %121, 0
  br i1 %.not136, label %127, label %122

122:                                              ; preds = %118
  %123 = load ptr, ptr %47, align 8, !tbaa !31
  %124 = load i32, ptr %123, align 8, !tbaa !32
  %125 = icmp eq i32 %.0119155, %124
  br i1 %125, label %126, label %127

126:                                              ; preds = %122
  call void @update_scale(ptr noundef nonnull %0, ptr noundef %23, i32 noundef %.0119155)
  br label %127

127:                                              ; preds = %126, %122, %118
  call void @update_dual_vars(ptr noundef nonnull %0)
  %128 = load ptr, ptr %41, align 8, !tbaa !23
  %.not137 = icmp eq ptr %128, null
  br i1 %.not137, label %149, label %129

129:                                              ; preds = %127
  %130 = load ptr, ptr %24, align 8, !tbaa !16
  %131 = getelementptr inbounds i8, ptr %130, i64 92
  %132 = load i32, ptr %131, align 4, !tbaa !24
  %133 = srem i32 %.0119155, %132
  %134 = icmp eq i32 %133, 0
  br i1 %134, label %135, label %149

135:                                              ; preds = %129
  %136 = load double, ptr %44, align 8, !tbaa !27
  %137 = fcmp ogt double %136, 0.000000e+00
  br i1 %137, label %138, label %149

138:                                              ; preds = %135
  %139 = load ptr, ptr %42, align 8, !tbaa !25
  %140 = load ptr, ptr %43, align 8, !tbaa !26
  %141 = call i32 @aa_safeguard(ptr noundef %139, ptr noundef %140, ptr noundef nonnull %128) #7
  %142 = icmp slt i32 %141, 0
  br i1 %142, label %143, label %146

143:                                              ; preds = %138
  %144 = load i32, ptr %49, align 8, !tbaa !34
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %49, align 8, !tbaa !34
  br label %149

146:                                              ; preds = %138
  %147 = load i32, ptr %48, align 4, !tbaa !35
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %48, align 4, !tbaa !35
  br label %149

149:                                              ; preds = %143, %146, %135, %129, %127
  %150 = load ptr, ptr %24, align 8, !tbaa !16
  %151 = getelementptr inbounds i8, ptr %150, i64 104
  %152 = load ptr, ptr %151, align 8, !tbaa !36
  %.not138 = icmp eq ptr %152, null
  br i1 %.not138, label %154, label %153

153:                                              ; preds = %149
  call void @populate_residual_struct(ptr noundef nonnull %0, i32 noundef %.0119155)
  call void @_scs_log_data_to_csv(ptr noundef %23, ptr noundef %25, ptr noundef nonnull %0, i32 noundef %.0119155, ptr noundef nonnull %5) #7
  %.pre176 = load ptr, ptr %24, align 8, !tbaa !16
  br label %154

154:                                              ; preds = %149, %153
  %155 = phi ptr [ %150, %149 ], [ %.pre176, %153 ]
  %156 = add nuw nsw i32 %.0119155, 1
  %157 = getelementptr inbounds i8, ptr %155, i64 32
  %158 = load i32, ptr %157, align 8, !tbaa !22
  %159 = icmp slt i32 %156, %158
  br i1 %159, label %50, label %.loopexit, !llvm.loop !37

.loopexit:                                        ; preds = %154, %96, %36, %109
  %160 = phi ptr [ %104, %109 ], [ %37, %36 ], [ %155, %154 ], [ %.pre177.pre, %96 ]
  %.0119147 = phi i32 [ %.0119155, %109 ], [ 0, %36 ], [ %156, %154 ], [ %.0119155, %96 ]
  %.1125 = phi double [ %93, %109 ], [ 0.000000e+00, %36 ], [ %93, %96 ], [ %93, %154 ]
  %.1123 = phi double [ %82, %109 ], [ 0.000000e+00, %36 ], [ %82, %96 ], [ %82, %154 ]
  %.2 = phi double [ %.1121, %109 ], [ 0.000000e+00, %36 ], [ %.1121, %96 ], [ %.1121, %154 ]
  %161 = getelementptr inbounds i8, ptr %160, i64 104
  %162 = load ptr, ptr %161, align 8, !tbaa !36
  %.not139 = icmp eq ptr %162, null
  br i1 %.not139, label %164, label %163

163:                                              ; preds = %.loopexit
  call void @populate_residual_struct(ptr noundef nonnull %0, i32 noundef %.0119147)
  call void @_scs_log_data_to_csv(ptr noundef %23, ptr noundef %25, ptr noundef nonnull %0, i32 noundef %.0119147, ptr noundef nonnull %5) #7
  %.pre178 = load ptr, ptr %24, align 8, !tbaa !16
  br label %164

164:                                              ; preds = %163, %.loopexit
  %165 = phi ptr [ %.pre178, %163 ], [ %160, %.loopexit ]
  %166 = getelementptr inbounds i8, ptr %165, i64 80
  %167 = load i32, ptr %166, align 8, !tbaa !21
  %.not140 = icmp eq i32 %167, 0
  br i1 %.not140, label %169, label %168

168:                                              ; preds = %164
  call void @populate_residual_struct(ptr noundef nonnull %0, i32 noundef %.0119147)
  call void @print_summary(ptr noundef nonnull %0, i32 noundef %.0119147, ptr noundef nonnull %5)
  br label %169

169:                                              ; preds = %168, %164
  call void @finalize(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, i32 noundef %.0119147)
  %170 = call double @_scs_tocq(ptr noundef nonnull %5) #7
  %171 = getelementptr inbounds i8, ptr %2, i64 344
  store double %170, ptr %171, align 8, !tbaa !39
  %172 = getelementptr inbounds i8, ptr %2, i64 376
  store double %.1123, ptr %172, align 8, !tbaa !40
  %173 = getelementptr inbounds i8, ptr %2, i64 384
  store double %.1125, ptr %173, align 8, !tbaa !41
  %174 = getelementptr inbounds i8, ptr %2, i64 392
  store double %.2, ptr %174, align 8, !tbaa !42
  %175 = load ptr, ptr %24, align 8, !tbaa !16
  %176 = getelementptr inbounds i8, ptr %175, i64 80
  %177 = load i32, ptr %176, align 8, !tbaa !21
  %.not141 = icmp eq i32 %177, 0
  br i1 %.not141, label %179, label %178

178:                                              ; preds = %169
  call void @print_footer(ptr noundef nonnull %2)
  br label %179

179:                                              ; preds = %178, %169
  %180 = load i32, ptr %30, align 4, !tbaa !19
  br label %181

181:                                              ; preds = %74, %85, %179, %12
  %.1 = phi i32 [ -4, %12 ], [ %79, %74 ], [ %90, %85 ], [ %180, %179 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  ret i32 %.1
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #5

declare ptr @scs_get_lin_sys_method() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @update_work(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @print_header(ptr noundef, ptr noundef) local_unnamed_addr #3

declare double @aa_apply(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @normalize_v(ptr noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare hidden i32 @project_lin_sys(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @failure(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @project_cones(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @compute_rsk(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare hidden i32 @has_converged(ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
declare hidden void @update_dual_vars(ptr noundef) local_unnamed_addr #3

declare i32 @aa_safeguard(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @_scs_log_data_to_csv(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden void @print_footer(ptr noundef) local_unnamed_addr #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 128}
!6 = !{!"SCS_WORK", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !7, i64 104, !7, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !7, i64 208, !10, i64 216, !10, i64 220, !10, i64 224, !7, i64 232, !10, i64 240, !10, i64 244}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !10, i64 0}
!13 = !{!"", !10, i64 0, !10, i64 4, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!14 = !{!13, !10, i64 4}
!15 = !{!6, !11, i64 136}
!16 = !{!6, !11, i64 144}
!17 = !{!18, !10, i64 84}
!18 = !{!"", !10, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !10, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !11, i64 96, !11, i64 104}
!19 = !{!20, !10, i64 260}
!20 = !{!"", !10, i64 0, !8, i64 4, !8, i64 132, !10, i64 260, !10, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !10, i64 368, !10, i64 372, !7, i64 376, !7, i64 384, !7, i64 392}
!21 = !{!18, !10, i64 80}
!22 = !{!18, !10, i64 32}
!23 = !{!6, !11, i64 120}
!24 = !{!18, !10, i64 92}
!25 = !{!6, !11, i64 32}
!26 = !{!6, !11, i64 40}
!27 = !{!6, !7, i64 232}
!28 = !{!18, !7, i64 72}
!29 = !{!6, !10, i64 8}
!30 = !{!18, !10, i64 16}
!31 = !{!6, !11, i64 176}
!32 = !{!33, !10, i64 0}
!33 = !{!"", !10, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176}
!34 = !{!6, !10, i64 240}
!35 = !{!6, !10, i64 244}
!36 = !{!18, !11, i64 104}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!20, !7, i64 344}
!40 = !{!20, !7, i64 376}
!41 = !{!20, !7, i64 384}
!42 = !{!20, !7, i64 392}


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