; LLVM IR from cvxgrp/scs :: linsys/gpu/indirect (private)

; 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.ScsMatrix = type { ptr, ptr, ptr, i32, i32 }
%struct.SCS_LIN_SYS_WORK = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.SCS_GPU_DATA_MATRIX = type { ptr, ptr, ptr, i32, i32, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [74 x i8], align 1
@__func__.scs_init_lin_sys_work = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @scs_update_lin_sys_diag_r(ptr noundef, ptr noundef) #0

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

declare i32 @cudaMemcpy(ptr noundef, ptr noundef, i64 noundef, i32 noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @scs_free_lin_sys_work(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local ptr @scs_init_lin_sys_work(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %15 = call i32 @cudaGetDeviceCount(ptr noundef %13)
  store i32 %15, ptr %8, align 4, !tbaa !9
  %16 = load i32, ptr %8, align 4, !tbaa !9
  %17 = icmp ugt i32 %16, 0
  br i1 %17, label %18, label %21

18:                                               ; preds = %3
  %19 = load i32, ptr %8, align 4, !tbaa !9
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %19)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %472

21:                                               ; preds = %3
  %22 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 200) #5
  store ptr %22, ptr %10, align 8, !tbaa !5
  %23 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 48) #5
  store ptr %23, ptr %11, align 8, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ScsMatrix, ptr %24, i32 0, i32 3
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = sext i32 %26 to i64
  %28 = call noalias ptr @calloc(i64 noundef %27, i64 noundef 8) #5
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %29, i32 0, i32 24
  store ptr %28, ptr %30, align 8, !tbaa !13
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ScsMatrix, ptr %31, i32 0, i32 4
  %33 = load i32, ptr %32, align 4, !tbaa !16
  %34 = sext i32 %33 to i64
  %35 = call noalias ptr @calloc(i64 noundef %34, i64 noundef 8) #5
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %36, i32 0, i32 3
  store ptr %35, ptr %37, align 8, !tbaa !17
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %39, i32 0, i32 11
  store ptr %38, ptr %40, align 8, !tbaa !18
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %42, i32 0, i32 12
  store ptr %41, ptr %43, align 8, !tbaa !19
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ScsMatrix, ptr %44, i32 0, i32 3
  %46 = load i32, ptr %45, align 8, !tbaa !11
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %47, i32 0, i32 1
  store i32 %46, ptr %48, align 4, !tbaa !20
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ScsMatrix, ptr %49, i32 0, i32 4
  %51 = load i32, ptr %50, align 4, !tbaa !16
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %52, i32 0, i32 0
  store i32 %51, ptr %53, align 8, !tbaa !21
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %54, i32 0, i32 16
  store ptr null, ptr %55, align 8, !tbaa !22
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %56, i32 0, i32 17
  store ptr null, ptr %57, align 8, !tbaa !23
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %58, i32 0, i32 2
  store i32 0, ptr %59, align 8, !tbaa !24
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %60, i32 0, i32 18
  store i64 0, ptr %61, align 8, !tbaa !25
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %62, i32 0, i32 19
  store ptr null, ptr %63, align 8, !tbaa !26
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %64, i32 0, i32 16
  %66 = call i32 @cublasCreate_v2(ptr noundef %65)
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %67, i32 0, i32 17
  %69 = call i32 @cusparseCreate(ptr noundef %68)
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ScsMatrix, ptr %70, i32 0, i32 4
  %72 = load i32, ptr %71, align 4, !tbaa !16
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %73, i32 0, i32 4
  store i32 %72, ptr %74, align 4, !tbaa !27
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ScsMatrix, ptr %75, i32 0, i32 3
  %77 = load i32, ptr %76, align 8, !tbaa !11
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %78, i32 0, i32 3
  store i32 %77, ptr %79, align 8, !tbaa !29
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.ScsMatrix, ptr %80, i32 0, i32 2
  %82 = load ptr, ptr %81, align 8, !tbaa !30
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ScsMatrix, ptr %83, i32 0, i32 4
  %85 = load i32, ptr %84, align 4, !tbaa !16
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i32, ptr %82, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %89, i32 0, i32 5
  store i32 %88, ptr %90, align 8, !tbaa !31
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %91, i32 0, i32 6
  store ptr null, ptr %92, align 8, !tbaa !32
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.ScsMatrix, ptr %95, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !30
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.ScsMatrix, ptr %98, i32 0, i32 4
  %100 = load i32, ptr %99, align 4, !tbaa !16
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i32, ptr %97, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = mul i64 %104, 4
  %106 = call i32 @cudaMalloc(ptr noundef %94, i64 noundef %105)
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %107, i32 0, i32 2
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.ScsMatrix, ptr %109, i32 0, i32 4
  %111 = load i32, ptr %110, align 4, !tbaa !16
  %112 = add nsw i32 %111, 1
  %113 = sext i32 %112 to i64
  %114 = mul i64 %113, 4
  %115 = call i32 @cudaMalloc(ptr noundef %108, i64 noundef %114)
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.ScsMatrix, ptr %118, i32 0, i32 2
  %120 = load ptr, ptr %119, align 8, !tbaa !30
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.ScsMatrix, ptr %121, i32 0, i32 4
  %123 = load i32, ptr %122, align 4, !tbaa !16
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds i32, ptr %120, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = mul i64 %127, 8
  %129 = call i32 @cudaMalloc(ptr noundef %117, i64 noundef %128)
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %130, i32 0, i32 4
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.ScsMatrix, ptr %132, i32 0, i32 4
  %134 = load i32, ptr %133, align 4, !tbaa !16
  %135 = sext i32 %134 to i64
  %136 = mul i64 %135, 8
  %137 = call i32 @cudaMalloc(ptr noundef %131, i64 noundef %136)
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %138, i32 0, i32 5
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.ScsMatrix, ptr %140, i32 0, i32 4
  %142 = load i32, ptr %141, align 4, !tbaa !16
  %143 = sext i32 %142 to i64
  %144 = mul i64 %143, 8
  %145 = call i32 @cudaMalloc(ptr noundef %139, i64 noundef %144)
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %146, i32 0, i32 6
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.ScsMatrix, ptr %148, i32 0, i32 4
  %150 = load i32, ptr %149, align 4, !tbaa !16
  %151 = sext i32 %150 to i64
  %152 = mul i64 %151, 8
  %153 = call i32 @cudaMalloc(ptr noundef %147, i64 noundef %152)
  %154 = load ptr, ptr %10, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %154, i32 0, i32 7
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.ScsMatrix, ptr %156, i32 0, i32 4
  %158 = load i32, ptr %157, align 4, !tbaa !16
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.ScsMatrix, ptr %159, i32 0, i32 3
  %161 = load i32, ptr %160, align 8, !tbaa !11
  %162 = add nsw i32 %158, %161
  %163 = sext i32 %162 to i64
  %164 = mul i64 %163, 8
  %165 = call i32 @cudaMalloc(ptr noundef %155, i64 noundef %164)
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %166, i32 0, i32 8
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.ScsMatrix, ptr %168, i32 0, i32 3
  %170 = load i32, ptr %169, align 8, !tbaa !11
  %171 = sext i32 %170 to i64
  %172 = mul i64 %171, 8
  %173 = call i32 @cudaMalloc(ptr noundef %167, i64 noundef %172)
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %174, i32 0, i32 9
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.ScsMatrix, ptr %176, i32 0, i32 4
  %178 = load i32, ptr %177, align 4, !tbaa !16
  %179 = sext i32 %178 to i64
  %180 = mul i64 %179, 8
  %181 = call i32 @cudaMalloc(ptr noundef %175, i64 noundef %180)
  %182 = load ptr, ptr %10, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %182, i32 0, i32 10
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.ScsMatrix, ptr %184, i32 0, i32 4
  %186 = load i32, ptr %185, align 4, !tbaa !16
  %187 = sext i32 %186 to i64
  %188 = mul i64 %187, 8
  %189 = call i32 @cudaMalloc(ptr noundef %183, i64 noundef %188)
  %190 = load ptr, ptr %10, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %190, i32 0, i32 23
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.ScsMatrix, ptr %192, i32 0, i32 4
  %194 = load i32, ptr %193, align 4, !tbaa !16
  %195 = sext i32 %194 to i64
  %196 = mul i64 %195, 8
  %197 = call i32 @cudaMalloc(ptr noundef %191, i64 noundef %196)
  %198 = load ptr, ptr %10, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %198, i32 0, i32 25
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.ScsMatrix, ptr %200, i32 0, i32 3
  %202 = load i32, ptr %201, align 8, !tbaa !11
  %203 = sext i32 %202 to i64
  %204 = mul i64 %203, 8
  %205 = call i32 @cudaMalloc(ptr noundef %199, i64 noundef %204)
  %206 = load ptr, ptr %11, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %206, i32 0, i32 1
  %208 = load ptr, ptr %207, align 8, !tbaa !33
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.ScsMatrix, ptr %209, i32 0, i32 1
  %211 = load ptr, ptr %210, align 8, !tbaa !34
  %212 = load ptr, ptr %5, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.ScsMatrix, ptr %212, i32 0, i32 2
  %214 = load ptr, ptr %213, align 8, !tbaa !30
  %215 = load ptr, ptr %5, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.ScsMatrix, ptr %215, i32 0, i32 4
  %217 = load i32, ptr %216, align 4, !tbaa !16
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds i32, ptr %214, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !9
  %221 = sext i32 %220 to i64
  %222 = mul i64 %221, 4
  %223 = call i32 @cudaMemcpy(ptr noundef %208, ptr noundef %211, i64 noundef %222, i32 noundef 1)
  %224 = load ptr, ptr %11, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %224, i32 0, i32 2
  %226 = load ptr, ptr %225, align 8, !tbaa !35
  %227 = load ptr, ptr %5, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.ScsMatrix, ptr %227, i32 0, i32 2
  %229 = load ptr, ptr %228, align 8, !tbaa !30
  %230 = load ptr, ptr %5, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.ScsMatrix, ptr %230, i32 0, i32 4
  %232 = load i32, ptr %231, align 4, !tbaa !16
  %233 = add nsw i32 %232, 1
  %234 = sext i32 %233 to i64
  %235 = mul i64 %234, 4
  %236 = call i32 @cudaMemcpy(ptr noundef %226, ptr noundef %229, i64 noundef %235, i32 noundef 1)
  %237 = load ptr, ptr %11, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %237, i32 0, i32 0
  %239 = load ptr, ptr %238, align 8, !tbaa !36
  %240 = load ptr, ptr %5, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.ScsMatrix, ptr %240, i32 0, i32 0
  %242 = load ptr, ptr %241, align 8, !tbaa !37
  %243 = load ptr, ptr %5, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.ScsMatrix, ptr %243, i32 0, i32 2
  %245 = load ptr, ptr %244, align 8, !tbaa !30
  %246 = load ptr, ptr %5, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.ScsMatrix, ptr %246, i32 0, i32 4
  %248 = load i32, ptr %247, align 4, !tbaa !16
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds i32, ptr %245, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !9
  %252 = sext i32 %251 to i64
  %253 = mul i64 %252, 8
  %254 = call i32 @cudaMemcpy(ptr noundef %239, ptr noundef %242, i64 noundef %253, i32 noundef 1)
  %255 = load ptr, ptr %11, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %255, i32 0, i32 6
  %257 = load ptr, ptr %11, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %257, i32 0, i32 4
  %259 = load i32, ptr %258, align 4, !tbaa !27
  %260 = sext i32 %259 to i64
  %261 = load ptr, ptr %11, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %261, i32 0, i32 3
  %263 = load i32, ptr %262, align 8, !tbaa !29
  %264 = sext i32 %263 to i64
  %265 = load ptr, ptr %11, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %265, i32 0, i32 5
  %267 = load i32, ptr %266, align 8, !tbaa !31
  %268 = sext i32 %267 to i64
  %269 = load ptr, ptr %11, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %269, i32 0, i32 2
  %271 = load ptr, ptr %270, align 8, !tbaa !35
  %272 = load ptr, ptr %11, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %272, i32 0, i32 1
  %274 = load ptr, ptr %273, align 8, !tbaa !33
  %275 = load ptr, ptr %11, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %275, i32 0, i32 0
  %277 = load ptr, ptr %276, align 8, !tbaa !36
  %278 = call i32 @cusparseCreateCsr(ptr noundef %256, i64 noundef %260, i64 noundef %264, i64 noundef %268, ptr noundef %271, ptr noundef %274, ptr noundef %277, i32 noundef 2, i32 noundef 2, i32 noundef 0, i32 noundef 1)
  %279 = load ptr, ptr %6, align 8, !tbaa !5
  %280 = icmp ne ptr %279, null
  br i1 %280, label %281, label %420

281:                                              ; preds = %21
  %282 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 48) #5
  store ptr %282, ptr %12, align 8, !tbaa !5
  %283 = load ptr, ptr %6, align 8, !tbaa !5
  %284 = call ptr @fill_p_matrix(ptr noundef %283)
  store ptr %284, ptr %9, align 8, !tbaa !5
  %285 = load ptr, ptr %9, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.ScsMatrix, ptr %285, i32 0, i32 4
  %287 = load i32, ptr %286, align 4, !tbaa !16
  %288 = load ptr, ptr %12, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %288, i32 0, i32 4
  store i32 %287, ptr %289, align 4, !tbaa !27
  %290 = load ptr, ptr %9, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.ScsMatrix, ptr %290, i32 0, i32 3
  %292 = load i32, ptr %291, align 8, !tbaa !11
  %293 = load ptr, ptr %12, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %293, i32 0, i32 3
  store i32 %292, ptr %294, align 8, !tbaa !29
  %295 = load ptr, ptr %9, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.ScsMatrix, ptr %295, i32 0, i32 2
  %297 = load ptr, ptr %296, align 8, !tbaa !30
  %298 = load ptr, ptr %9, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct.ScsMatrix, ptr %298, i32 0, i32 4
  %300 = load i32, ptr %299, align 4, !tbaa !16
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds i32, ptr %297, i64 %301
  %303 = load i32, ptr %302, align 4, !tbaa !9
  %304 = load ptr, ptr %12, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %304, i32 0, i32 5
  store i32 %303, ptr %305, align 8, !tbaa !31
  %306 = load ptr, ptr %12, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %306, i32 0, i32 6
  store ptr null, ptr %307, align 8, !tbaa !32
  %308 = load ptr, ptr %12, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %308, i32 0, i32 1
  %310 = load ptr, ptr %9, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.ScsMatrix, ptr %310, i32 0, i32 2
  %312 = load ptr, ptr %311, align 8, !tbaa !30
  %313 = load ptr, ptr %9, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.ScsMatrix, ptr %313, i32 0, i32 4
  %315 = load i32, ptr %314, align 4, !tbaa !16
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds i32, ptr %312, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !9
  %319 = sext i32 %318 to i64
  %320 = mul i64 %319, 4
  %321 = call i32 @cudaMalloc(ptr noundef %309, i64 noundef %320)
  %322 = load ptr, ptr %12, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %322, i32 0, i32 2
  %324 = load ptr, ptr %9, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.ScsMatrix, ptr %324, i32 0, i32 4
  %326 = load i32, ptr %325, align 4, !tbaa !16
  %327 = add nsw i32 %326, 1
  %328 = sext i32 %327 to i64
  %329 = mul i64 %328, 4
  %330 = call i32 @cudaMalloc(ptr noundef %323, i64 noundef %329)
  %331 = load ptr, ptr %12, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %331, i32 0, i32 0
  %333 = load ptr, ptr %9, align 8, !tbaa !5
  %334 = getelementptr inbounds %struct.ScsMatrix, ptr %333, i32 0, i32 2
  %335 = load ptr, ptr %334, align 8, !tbaa !30
  %336 = load ptr, ptr %9, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.ScsMatrix, ptr %336, i32 0, i32 4
  %338 = load i32, ptr %337, align 4, !tbaa !16
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds i32, ptr %335, i64 %339
  %341 = load i32, ptr %340, align 4, !tbaa !9
  %342 = sext i32 %341 to i64
  %343 = mul i64 %342, 8
  %344 = call i32 @cudaMalloc(ptr noundef %332, i64 noundef %343)
  %345 = load ptr, ptr %12, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %345, i32 0, i32 1
  %347 = load ptr, ptr %346, align 8, !tbaa !33
  %348 = load ptr, ptr %9, align 8, !tbaa !5
  %349 = getelementptr inbounds %struct.ScsMatrix, ptr %348, i32 0, i32 1
  %350 = load ptr, ptr %349, align 8, !tbaa !34
  %351 = load ptr, ptr %9, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct.ScsMatrix, ptr %351, i32 0, i32 2
  %353 = load ptr, ptr %352, align 8, !tbaa !30
  %354 = load ptr, ptr %9, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.ScsMatrix, ptr %354, i32 0, i32 4
  %356 = load i32, ptr %355, align 4, !tbaa !16
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds i32, ptr %353, i64 %357
  %359 = load i32, ptr %358, align 4, !tbaa !9
  %360 = sext i32 %359 to i64
  %361 = mul i64 %360, 4
  %362 = call i32 @cudaMemcpy(ptr noundef %347, ptr noundef %350, i64 noundef %361, i32 noundef 1)
  %363 = load ptr, ptr %12, align 8, !tbaa !5
  %364 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %363, i32 0, i32 2
  %365 = load ptr, ptr %364, align 8, !tbaa !35
  %366 = load ptr, ptr %9, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct.ScsMatrix, ptr %366, i32 0, i32 2
  %368 = load ptr, ptr %367, align 8, !tbaa !30
  %369 = load ptr, ptr %9, align 8, !tbaa !5
  %370 = getelementptr inbounds %struct.ScsMatrix, ptr %369, i32 0, i32 4
  %371 = load i32, ptr %370, align 4, !tbaa !16
  %372 = add nsw i32 %371, 1
  %373 = sext i32 %372 to i64
  %374 = mul i64 %373, 4
  %375 = call i32 @cudaMemcpy(ptr noundef %365, ptr noundef %368, i64 noundef %374, i32 noundef 1)
  %376 = load ptr, ptr %12, align 8, !tbaa !5
  %377 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %376, i32 0, i32 0
  %378 = load ptr, ptr %377, align 8, !tbaa !36
  %379 = load ptr, ptr %9, align 8, !tbaa !5
  %380 = getelementptr inbounds %struct.ScsMatrix, ptr %379, i32 0, i32 0
  %381 = load ptr, ptr %380, align 8, !tbaa !37
  %382 = load ptr, ptr %9, align 8, !tbaa !5
  %383 = getelementptr inbounds %struct.ScsMatrix, ptr %382, i32 0, i32 2
  %384 = load ptr, ptr %383, align 8, !tbaa !30
  %385 = load ptr, ptr %9, align 8, !tbaa !5
  %386 = getelementptr inbounds %struct.ScsMatrix, ptr %385, i32 0, i32 4
  %387 = load i32, ptr %386, align 4, !tbaa !16
  %388 = sext i32 %387 to i64
  %389 = getelementptr inbounds i32, ptr %384, i64 %388
  %390 = load i32, ptr %389, align 4, !tbaa !9
  %391 = sext i32 %390 to i64
  %392 = mul i64 %391, 8
  %393 = call i32 @cudaMemcpy(ptr noundef %378, ptr noundef %381, i64 noundef %392, i32 noundef 1)
  %394 = load ptr, ptr %12, align 8, !tbaa !5
  %395 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %394, i32 0, i32 6
  %396 = load ptr, ptr %12, align 8, !tbaa !5
  %397 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %396, i32 0, i32 4
  %398 = load i32, ptr %397, align 4, !tbaa !27
  %399 = sext i32 %398 to i64
  %400 = load ptr, ptr %12, align 8, !tbaa !5
  %401 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %400, i32 0, i32 3
  %402 = load i32, ptr %401, align 8, !tbaa !29
  %403 = sext i32 %402 to i64
  %404 = load ptr, ptr %12, align 8, !tbaa !5
  %405 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %404, i32 0, i32 5
  %406 = load i32, ptr %405, align 8, !tbaa !31
  %407 = sext i32 %406 to i64
  %408 = load ptr, ptr %12, align 8, !tbaa !5
  %409 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %408, i32 0, i32 2
  %410 = load ptr, ptr %409, align 8, !tbaa !35
  %411 = load ptr, ptr %12, align 8, !tbaa !5
  %412 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %411, i32 0, i32 1
  %413 = load ptr, ptr %412, align 8, !tbaa !33
  %414 = load ptr, ptr %12, align 8, !tbaa !5
  %415 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %414, i32 0, i32 0
  %416 = load ptr, ptr %415, align 8, !tbaa !36
  %417 = call i32 @cusparseCreateCsr(ptr noundef %395, i64 noundef %399, i64 noundef %403, i64 noundef %407, ptr noundef %410, ptr noundef %413, ptr noundef %416, i32 noundef 2, i32 noundef 2, i32 noundef 0, i32 noundef 1)
  %418 = load ptr, ptr %9, align 8, !tbaa !5
  %419 = call ptr @_scs_cs_spfree(ptr noundef %418)
  br label %421

420:                                              ; preds = %21
  store ptr null, ptr %12, align 8, !tbaa !5
  br label %421

421:                                              ; preds = %420, %281
  %422 = load ptr, ptr %11, align 8, !tbaa !5
  %423 = load ptr, ptr %10, align 8, !tbaa !5
  %424 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %423, i32 0, i32 13
  store ptr %422, ptr %424, align 8, !tbaa !38
  %425 = load ptr, ptr %12, align 8, !tbaa !5
  %426 = load ptr, ptr %10, align 8, !tbaa !5
  %427 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %426, i32 0, i32 15
  store ptr %425, ptr %427, align 8, !tbaa !39
  %428 = load ptr, ptr %10, align 8, !tbaa !5
  %429 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %428, i32 0, i32 14
  store ptr null, ptr %429, align 8, !tbaa !40
  %430 = load ptr, ptr %10, align 8, !tbaa !5
  %431 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %430, i32 0, i32 21
  %432 = load ptr, ptr %11, align 8, !tbaa !5
  %433 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %432, i32 0, i32 4
  %434 = load i32, ptr %433, align 4, !tbaa !27
  %435 = sext i32 %434 to i64
  %436 = load ptr, ptr %10, align 8, !tbaa !5
  %437 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %436, i32 0, i32 8
  %438 = load ptr, ptr %437, align 8, !tbaa !41
  %439 = call i32 @cusparseCreateDnVec(ptr noundef %431, i64 noundef %435, ptr noundef %438, i32 noundef 1)
  %440 = load ptr, ptr %10, align 8, !tbaa !5
  %441 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %440, i32 0, i32 22
  %442 = load ptr, ptr %11, align 8, !tbaa !5
  %443 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %442, i32 0, i32 4
  %444 = load i32, ptr %443, align 4, !tbaa !27
  %445 = sext i32 %444 to i64
  %446 = load ptr, ptr %10, align 8, !tbaa !5
  %447 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %446, i32 0, i32 8
  %448 = load ptr, ptr %447, align 8, !tbaa !41
  %449 = call i32 @cusparseCreateDnVec(ptr noundef %441, i64 noundef %445, ptr noundef %448, i32 noundef 1)
  %450 = load ptr, ptr %10, align 8, !tbaa !5
  %451 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %450, i32 0, i32 20
  %452 = load ptr, ptr %11, align 8, !tbaa !5
  %453 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %452, i32 0, i32 3
  %454 = load i32, ptr %453, align 8, !tbaa !29
  %455 = sext i32 %454 to i64
  %456 = load ptr, ptr %10, align 8, !tbaa !5
  %457 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %456, i32 0, i32 8
  %458 = load ptr, ptr %457, align 8, !tbaa !41
  %459 = call i32 @cusparseCreateDnVec(ptr noundef %451, i64 noundef %455, ptr noundef %458, i32 noundef 1)
  %460 = load ptr, ptr %10, align 8, !tbaa !5
  %461 = load ptr, ptr %7, align 8, !tbaa !5
  call void @scs_update_lin_sys_diag_r(ptr noundef %460, ptr noundef %461)
  %462 = call i32 @cudaGetLastError()
  store i32 %462, ptr %8, align 4, !tbaa !9
  %463 = load i32, ptr %8, align 4, !tbaa !9
  %464 = icmp ne i32 %463, 0
  br i1 %464, label %465, label %470

465:                                              ; preds = %421
  %466 = load i32, ptr %8, align 4, !tbaa !9
  %467 = call ptr @cudaGetErrorString(i32 noundef %466)
  %468 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 357, ptr noundef @__func__.scs_init_lin_sys_work, ptr noundef %467)
  %469 = load ptr, ptr %10, align 8, !tbaa !5
  call void @scs_free_lin_sys_work(ptr noundef %469)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %472

470:                                              ; preds = %421
  %471 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %471, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %472

472:                                              ; preds = %470, %465, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %473 = load ptr, ptr %4, align 8
  ret ptr %473
}

declare i32 @cudaGetDeviceCount(ptr noundef) #2

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #3

declare i32 @cublasCreate_v2(ptr noundef) #2

declare i32 @cusparseCreate(ptr noundef) #2

declare i32 @cudaMalloc(ptr noundef, i64 noundef) #2

declare i32 @cusparseCreateCsr(ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

declare ptr @_scs_cs_spfree(ptr noundef) #2

declare i32 @cusparseCreateDnVec(ptr noundef, i64 noundef, ptr noundef, i32 noundef) #2

declare i32 @cudaGetLastError() #2

declare ptr @cudaGetErrorString(i32 noundef) #2

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 allocsize(0,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 #4 = { nounwind }
attributes #5 = { nounwind allocsize(0,1) }

!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, !10, i64 24}
!12 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28}
!13 = !{!14, !6, i64 184}
!14 = !{!"SCS_LIN_SYS_WORK", !10, i64 0, !10, i64 4, !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, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !15, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192}
!15 = !{!"long", !7, i64 0}
!16 = !{!12, !10, i64 28}
!17 = !{!14, !6, i64 16}
!18 = !{!14, !6, i64 80}
!19 = !{!14, !6, i64 88}
!20 = !{!14, !10, i64 4}
!21 = !{!14, !10, i64 0}
!22 = !{!14, !6, i64 120}
!23 = !{!14, !6, i64 128}
!24 = !{!14, !10, i64 8}
!25 = !{!14, !15, i64 136}
!26 = !{!14, !6, i64 144}
!27 = !{!28, !10, i64 28}
!28 = !{!"SCS_GPU_DATA_MATRIX", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !6, i64 40}
!29 = !{!28, !10, i64 24}
!30 = !{!12, !6, i64 16}
!31 = !{!28, !10, i64 32}
!32 = !{!28, !6, i64 40}
!33 = !{!28, !6, i64 8}
!34 = !{!12, !6, i64 8}
!35 = !{!28, !6, i64 16}
!36 = !{!28, !6, i64 0}
!37 = !{!12, !6, i64 0}
!38 = !{!14, !6, i64 96}
!39 = !{!14, !6, i64 112}
!40 = !{!14, !6, i64 104}
!41 = !{!14, !6, i64 56}


; 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.1 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [74 x i8], align 1
@__func__.scs_init_lin_sys_work = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @scs_update_lin_sys_diag_r(ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare i32 @cudaMemcpy(ptr noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @scs_free_lin_sys_work(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @scs_init_lin_sys_work(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %5 = call i32 @cudaGetDeviceCount(ptr noundef nonnull %4) #5
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %8, label %6

6:                                                ; preds = %3
  %7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5)
  br label %238

8:                                                ; preds = %3
  %9 = call noalias dereferenceable_or_null(200) ptr @calloc(i64 noundef 1, i64 noundef 200) #6
  %10 = call noalias dereferenceable_or_null(48) ptr @calloc(i64 noundef 1, i64 noundef 48) #6
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = call noalias ptr @calloc(i64 noundef %13, i64 noundef 8) #6
  %15 = getelementptr inbounds i8, ptr %9, i64 184
  store ptr %14, ptr %15, align 8, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %0, i64 28
  %17 = load i32, ptr %16, align 4, !tbaa !14
  %18 = sext i32 %17 to i64
  %19 = call noalias ptr @calloc(i64 noundef %18, i64 noundef 8) #6
  %20 = getelementptr inbounds i8, ptr %9, i64 16
  store ptr %19, ptr %20, align 8, !tbaa !15
  %21 = getelementptr inbounds i8, ptr %9, i64 80
  store ptr %0, ptr %21, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %9, i64 88
  store ptr %1, ptr %22, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %9, i64 4
  store i32 %12, ptr %23, align 4, !tbaa !18
  store i32 %17, ptr %9, align 8, !tbaa !19
  %24 = getelementptr inbounds i8, ptr %9, i64 120
  %25 = getelementptr inbounds i8, ptr %9, i64 128
  %26 = call i32 @cublasCreate_v2(ptr noundef nonnull %24) #5
  %27 = call i32 @cusparseCreate(ptr noundef nonnull %25) #5
  %28 = load i32, ptr %16, align 4, !tbaa !14
  %29 = getelementptr inbounds i8, ptr %10, i64 28
  store i32 %28, ptr %29, align 4, !tbaa !20
  %30 = load i32, ptr %11, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %10, i64 24
  store i32 %30, ptr %31, align 8, !tbaa !22
  %32 = getelementptr inbounds i8, ptr %0, i64 16
  %33 = load ptr, ptr %32, align 8, !tbaa !23
  %34 = sext i32 %28 to i64
  %35 = getelementptr inbounds i32, ptr %33, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !24
  %37 = getelementptr inbounds i8, ptr %10, i64 32
  store i32 %36, ptr %37, align 8, !tbaa !25
  %38 = getelementptr inbounds i8, ptr %10, i64 40
  %39 = getelementptr inbounds i8, ptr %10, i64 8
  %40 = sext i32 %36 to i64
  %41 = shl nsw i64 %40, 2
  %42 = call i32 @cudaMalloc(ptr noundef nonnull %39, i64 noundef %41) #5
  %43 = getelementptr inbounds i8, ptr %10, i64 16
  %44 = load i32, ptr %16, align 4, !tbaa !14
  %45 = add nsw i32 %44, 1
  %46 = sext i32 %45 to i64
  %47 = shl nsw i64 %46, 2
  %48 = call i32 @cudaMalloc(ptr noundef nonnull %43, i64 noundef %47) #5
  %49 = load ptr, ptr %32, align 8, !tbaa !23
  %50 = load i32, ptr %16, align 4, !tbaa !14
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !24
  %54 = sext i32 %53 to i64
  %55 = shl nsw i64 %54, 3
  %56 = call i32 @cudaMalloc(ptr noundef %10, i64 noundef %55) #5
  %57 = getelementptr inbounds i8, ptr %9, i64 24
  %58 = load i32, ptr %16, align 4, !tbaa !14
  %59 = sext i32 %58 to i64
  %60 = shl nsw i64 %59, 3
  %61 = call i32 @cudaMalloc(ptr noundef nonnull %57, i64 noundef %60) #5
  %62 = getelementptr inbounds i8, ptr %9, i64 32
  %63 = load i32, ptr %16, align 4, !tbaa !14
  %64 = sext i32 %63 to i64
  %65 = shl nsw i64 %64, 3
  %66 = call i32 @cudaMalloc(ptr noundef nonnull %62, i64 noundef %65) #5
  %67 = getelementptr inbounds i8, ptr %9, i64 40
  %68 = load i32, ptr %16, align 4, !tbaa !14
  %69 = sext i32 %68 to i64
  %70 = shl nsw i64 %69, 3
  %71 = call i32 @cudaMalloc(ptr noundef nonnull %67, i64 noundef %70) #5
  %72 = getelementptr inbounds i8, ptr %9, i64 48
  %73 = load i32, ptr %16, align 4, !tbaa !14
  %74 = load i32, ptr %11, align 8, !tbaa !5
  %75 = add nsw i32 %74, %73
  %76 = sext i32 %75 to i64
  %77 = shl nsw i64 %76, 3
  %78 = call i32 @cudaMalloc(ptr noundef nonnull %72, i64 noundef %77) #5
  %79 = getelementptr inbounds i8, ptr %9, i64 56
  %80 = load i32, ptr %11, align 8, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = shl nsw i64 %81, 3
  %83 = call i32 @cudaMalloc(ptr noundef nonnull %79, i64 noundef %82) #5
  %84 = getelementptr inbounds i8, ptr %9, i64 64
  %85 = load i32, ptr %16, align 4, !tbaa !14
  %86 = sext i32 %85 to i64
  %87 = shl nsw i64 %86, 3
  %88 = call i32 @cudaMalloc(ptr noundef nonnull %84, i64 noundef %87) #5
  %89 = getelementptr inbounds i8, ptr %9, i64 72
  %90 = load i32, ptr %16, align 4, !tbaa !14
  %91 = sext i32 %90 to i64
  %92 = shl nsw i64 %91, 3
  %93 = call i32 @cudaMalloc(ptr noundef nonnull %89, i64 noundef %92) #5
  %94 = getelementptr inbounds i8, ptr %9, i64 176
  %95 = load i32, ptr %16, align 4, !tbaa !14
  %96 = sext i32 %95 to i64
  %97 = shl nsw i64 %96, 3
  %98 = call i32 @cudaMalloc(ptr noundef nonnull %94, i64 noundef %97) #5
  %99 = getelementptr inbounds i8, ptr %9, i64 192
  %100 = load i32, ptr %11, align 8, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = shl nsw i64 %101, 3
  %103 = call i32 @cudaMalloc(ptr noundef nonnull %99, i64 noundef %102) #5
  %104 = load ptr, ptr %39, align 8, !tbaa !26
  %105 = getelementptr inbounds i8, ptr %0, i64 8
  %106 = load ptr, ptr %105, align 8, !tbaa !27
  %107 = load ptr, ptr %32, align 8, !tbaa !23
  %108 = load i32, ptr %16, align 4, !tbaa !14
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr %107, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !24
  %112 = sext i32 %111 to i64
  %113 = shl nsw i64 %112, 2
  %114 = call i32 @cudaMemcpy(ptr noundef %104, ptr noundef %106, i64 noundef %113, i32 noundef 1) #5
  %115 = load ptr, ptr %43, align 8, !tbaa !28
  %116 = load ptr, ptr %32, align 8, !tbaa !23
  %117 = load i32, ptr %16, align 4, !tbaa !14
  %118 = add nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = shl nsw i64 %119, 2
  %121 = call i32 @cudaMemcpy(ptr noundef %115, ptr noundef %116, i64 noundef %120, i32 noundef 1) #5
  %122 = load ptr, ptr %10, align 8, !tbaa !29
  %123 = load ptr, ptr %0, align 8, !tbaa !30
  %124 = load ptr, ptr %32, align 8, !tbaa !23
  %125 = load i32, ptr %16, align 4, !tbaa !14
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %124, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !24
  %129 = sext i32 %128 to i64
  %130 = shl nsw i64 %129, 3
  %131 = call i32 @cudaMemcpy(ptr noundef %122, ptr noundef %123, i64 noundef %130, i32 noundef 1) #5
  %132 = load i32, ptr %29, align 4, !tbaa !20
  %133 = sext i32 %132 to i64
  %134 = load i32, ptr %31, align 8, !tbaa !22
  %135 = sext i32 %134 to i64
  %136 = load i32, ptr %37, align 8, !tbaa !25
  %137 = sext i32 %136 to i64
  %138 = load ptr, ptr %43, align 8, !tbaa !28
  %139 = load ptr, ptr %39, align 8, !tbaa !26
  %140 = load ptr, ptr %10, align 8, !tbaa !29
  %141 = call i32 @cusparseCreateCsr(ptr noundef nonnull %38, i64 noundef %133, i64 noundef %135, i64 noundef %137, ptr noundef %138, ptr noundef %139, ptr noundef %140, i32 noundef 2, i32 noundef 2, i32 noundef 0, i32 noundef 1) #5
  %.not135 = icmp eq ptr %1, null
  br i1 %.not135, label %215, label %142

142:                                              ; preds = %8
  %143 = call noalias dereferenceable_or_null(48) ptr @calloc(i64 noundef 1, i64 noundef 48) #6
  %144 = call ptr @fill_p_matrix(ptr noundef nonnull %1)
  %145 = getelementptr inbounds i8, ptr %144, i64 28
  %146 = load i32, ptr %145, align 4, !tbaa !14
  %147 = getelementptr inbounds i8, ptr %143, i64 28
  store i32 %146, ptr %147, align 4, !tbaa !20
  %148 = getelementptr inbounds i8, ptr %144, i64 24
  %149 = load i32, ptr %148, align 8, !tbaa !5
  %150 = getelementptr inbounds i8, ptr %143, i64 24
  store i32 %149, ptr %150, align 8, !tbaa !22
  %151 = getelementptr inbounds i8, ptr %144, i64 16
  %152 = load ptr, ptr %151, align 8, !tbaa !23
  %153 = sext i32 %146 to i64
  %154 = getelementptr inbounds i32, ptr %152, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !24
  %156 = getelementptr inbounds i8, ptr %143, i64 32
  store i32 %155, ptr %156, align 8, !tbaa !25
  %157 = getelementptr inbounds i8, ptr %143, i64 40
  store ptr null, ptr %157, align 8, !tbaa !31
  %158 = getelementptr inbounds i8, ptr %143, i64 8
  %159 = sext i32 %155 to i64
  %160 = shl nsw i64 %159, 2
  %161 = call i32 @cudaMalloc(ptr noundef nonnull %158, i64 noundef %160) #5
  %162 = getelementptr inbounds i8, ptr %143, i64 16
  %163 = load i32, ptr %145, align 4, !tbaa !14
  %164 = add nsw i32 %163, 1
  %165 = sext i32 %164 to i64
  %166 = shl nsw i64 %165, 2
  %167 = call i32 @cudaMalloc(ptr noundef nonnull %162, i64 noundef %166) #5
  %168 = load ptr, ptr %151, align 8, !tbaa !23
  %169 = load i32, ptr %145, align 4, !tbaa !14
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i32, ptr %168, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !24
  %173 = sext i32 %172 to i64
  %174 = shl nsw i64 %173, 3
  %175 = call i32 @cudaMalloc(ptr noundef %143, i64 noundef %174) #5
  %176 = load ptr, ptr %158, align 8, !tbaa !26
  %177 = getelementptr inbounds i8, ptr %144, i64 8
  %178 = load ptr, ptr %177, align 8, !tbaa !27
  %179 = load ptr, ptr %151, align 8, !tbaa !23
  %180 = load i32, ptr %145, align 4, !tbaa !14
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds i32, ptr %179, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !24
  %184 = sext i32 %183 to i64
  %185 = shl nsw i64 %184, 2
  %186 = call i32 @cudaMemcpy(ptr noundef %176, ptr noundef %178, i64 noundef %185, i32 noundef 1) #5
  %187 = load ptr, ptr %162, align 8, !tbaa !28
  %188 = load ptr, ptr %151, align 8, !tbaa !23
  %189 = load i32, ptr %145, align 4, !tbaa !14
  %190 = add nsw i32 %189, 1
  %191 = sext i32 %190 to i64
  %192 = shl nsw i64 %191, 2
  %193 = call i32 @cudaMemcpy(ptr noundef %187, ptr noundef %188, i64 noundef %192, i32 noundef 1) #5
  %194 = load ptr, ptr %143, align 8, !tbaa !29
  %195 = load ptr, ptr %144, align 8, !tbaa !30
  %196 = load ptr, ptr %151, align 8, !tbaa !23
  %197 = load i32, ptr %145, align 4, !tbaa !14
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds i32, ptr %196, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !24
  %201 = sext i32 %200 to i64
  %202 = shl nsw i64 %201, 3
  %203 = call i32 @cudaMemcpy(ptr noundef %194, ptr noundef %195, i64 noundef %202, i32 noundef 1) #5
  %204 = load i32, ptr %147, align 4, !tbaa !20
  %205 = sext i32 %204 to i64
  %206 = load i32, ptr %150, align 8, !tbaa !22
  %207 = sext i32 %206 to i64
  %208 = load i32, ptr %156, align 8, !tbaa !25
  %209 = sext i32 %208 to i64
  %210 = load ptr, ptr %162, align 8, !tbaa !28
  %211 = load ptr, ptr %158, align 8, !tbaa !26
  %212 = load ptr, ptr %143, align 8, !tbaa !29
  %213 = call i32 @cusparseCreateCsr(ptr noundef nonnull %157, i64 noundef %205, i64 noundef %207, i64 noundef %209, ptr noundef %210, ptr noundef %211, ptr noundef %212, i32 noundef 2, i32 noundef 2, i32 noundef 0, i32 noundef 1) #5
  %214 = call ptr @_scs_cs_spfree(ptr noundef nonnull %144) #5
  br label %215

215:                                              ; preds = %8, %142
  %.0 = phi ptr [ %143, %142 ], [ null, %8 ]
  %216 = getelementptr inbounds i8, ptr %9, i64 96
  store ptr %10, ptr %216, align 8, !tbaa !32
  %217 = getelementptr inbounds i8, ptr %9, i64 112
  store ptr %.0, ptr %217, align 8, !tbaa !33
  %218 = getelementptr inbounds i8, ptr %9, i64 104
  store ptr null, ptr %218, align 8, !tbaa !34
  %219 = getelementptr inbounds i8, ptr %9, i64 160
  %220 = load i32, ptr %29, align 4, !tbaa !20
  %221 = sext i32 %220 to i64
  %222 = load ptr, ptr %79, align 8, !tbaa !35
  %223 = call i32 @cusparseCreateDnVec(ptr noundef nonnull %219, i64 noundef %221, ptr noundef %222, i32 noundef 1) #5
  %224 = getelementptr inbounds i8, ptr %9, i64 168
  %225 = load i32, ptr %29, align 4, !tbaa !20
  %226 = sext i32 %225 to i64
  %227 = load ptr, ptr %79, align 8, !tbaa !35
  %228 = call i32 @cusparseCreateDnVec(ptr noundef nonnull %224, i64 noundef %226, ptr noundef %227, i32 noundef 1) #5
  %229 = getelementptr inbounds i8, ptr %9, i64 152
  %230 = load i32, ptr %31, align 8, !tbaa !22
  %231 = sext i32 %230 to i64
  %232 = load ptr, ptr %79, align 8, !tbaa !35
  %233 = call i32 @cusparseCreateDnVec(ptr noundef nonnull %229, i64 noundef %231, ptr noundef %232, i32 noundef 1) #5
  call void @scs_update_lin_sys_diag_r(ptr noundef nonnull %9, ptr noundef %2)
  %234 = call i32 @cudaGetLastError() #5
  %.not136 = icmp eq i32 %234, 0
  br i1 %.not136, label %238, label %235

235:                                              ; preds = %215
  %236 = call ptr @cudaGetErrorString(i32 noundef %234) #5
  %237 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull @.str.3, i32 noundef 357, ptr noundef nonnull @__func__.scs_init_lin_sys_work, ptr noundef %236)
  call void @scs_free_lin_sys_work(ptr noundef nonnull %9)
  br label %238

238:                                              ; preds = %215, %235, %6
  %.0131 = phi ptr [ null, %6 ], [ null, %235 ], [ %9, %215 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  ret ptr %.0131
}

declare i32 @cudaGetDeviceCount(ptr noundef) local_unnamed_addr #2

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

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

declare i32 @cublasCreate_v2(ptr noundef) local_unnamed_addr #2

declare i32 @cusparseCreate(ptr noundef) local_unnamed_addr #2

declare i32 @cudaMalloc(ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @cusparseCreateCsr(ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

declare ptr @_scs_cs_spfree(ptr noundef) local_unnamed_addr #2

declare i32 @cusparseCreateDnVec(ptr noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @cudaGetLastError() local_unnamed_addr #2

declare ptr @cudaGetErrorString(i32 noundef) local_unnamed_addr #2

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 = { 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 #4 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) 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 = { nounwind }
attributes #6 = { nounwind allocsize(0,1) }

!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, !10, i64 24}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 184}
!12 = !{!"SCS_LIN_SYS_WORK", !10, i64 0, !10, i64 4, !10, 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, !13, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192}
!13 = !{!"long", !8, i64 0}
!14 = !{!6, !10, i64 28}
!15 = !{!12, !7, i64 16}
!16 = !{!12, !7, i64 80}
!17 = !{!12, !7, i64 88}
!18 = !{!12, !10, i64 4}
!19 = !{!12, !10, i64 0}
!20 = !{!21, !10, i64 28}
!21 = !{!"SCS_GPU_DATA_MATRIX", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !7, i64 40}
!22 = !{!21, !10, i64 24}
!23 = !{!6, !7, i64 16}
!24 = !{!10, !10, i64 0}
!25 = !{!21, !10, i64 32}
!26 = !{!21, !7, i64 8}
!27 = !{!6, !7, i64 8}
!28 = !{!21, !7, i64 16}
!29 = !{!21, !7, i64 0}
!30 = !{!6, !7, i64 0}
!31 = !{!21, !7, i64 40}
!32 = !{!12, !7, i64 96}
!33 = !{!12, !7, i64 112}
!34 = !{!12, !7, i64 104}
!35 = !{!12, !7, i64 56}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass