; 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.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.4 = external hidden unnamed_addr constant [73 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 i32 @cudaMemcpy(ptr noundef, ptr noundef, i64 noundef, i32 noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @scs_solve_lin_sys(ptr noundef %0, ptr noundef %1, ptr noundef %2, double noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  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 double %3, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store double -1.000000e+00, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %17, i32 0, i32 7
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  store ptr %19, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %20, i32 0, i32 8
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  store ptr %22, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %23, i32 0, i32 13
  %25 = load ptr, ptr %24, align 8, !tbaa !16
  store ptr %25, ptr %15, align 8, !tbaa !5
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !17
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 4, !tbaa !18
  %33 = add nsw i32 %29, %32
  %34 = call double @_scs_norm_inf(ptr noundef %26, i32 noundef %33)
  %35 = fcmp ole double %34, 0x3D719799812DEA11
  br i1 %35, label %36, label %47

36:                                               ; preds = %4
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !17
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %41, i32 0, i32 1
  %43 = load i32, ptr %42, align 4, !tbaa !18
  %44 = add nsw i32 %40, %43
  %45 = sext i32 %44 to i64
  %46 = mul i64 %45, 8
  call void @llvm.memset.p0.i64(ptr align 8 %37, i8 0, i64 %46, i1 false)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %201

47:                                               ; preds = %4
  %48 = load double, ptr %9, align 8, !tbaa !9
  %49 = fcmp ole double %48, 0.000000e+00
  br i1 %49, label %50, label %53

50:                                               ; preds = %47
  %51 = load double, ptr %9, align 8, !tbaa !9
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, double noundef %51)
  br label %53

53:                                               ; preds = %50, %47
  %54 = load ptr, ptr %13, align 8, !tbaa !5
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %56, i32 0, i32 4
  %58 = load i32, ptr %57, align 4, !tbaa !19
  %59 = load ptr, ptr %15, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %59, i32 0, i32 3
  %61 = load i32, ptr %60, align 8, !tbaa !21
  %62 = add nsw i32 %58, %61
  %63 = sext i32 %62 to i64
  %64 = mul i64 %63, 8
  %65 = call i32 @cudaMemcpy(ptr noundef %54, ptr noundef %55, i64 noundef %64, i32 noundef 1)
  %66 = load ptr, ptr %14, align 8, !tbaa !5
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %68, i32 0, i32 4
  %70 = load i32, ptr %69, align 4, !tbaa !19
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds double, ptr %67, i64 %71
  %73 = load ptr, ptr %15, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %73, i32 0, i32 3
  %75 = load i32, ptr %74, align 8, !tbaa !21
  %76 = sext i32 %75 to i64
  %77 = mul i64 %76, 8
  %78 = call i32 @cudaMemcpy(ptr noundef %66, ptr noundef %72, i64 noundef %77, i32 noundef 3)
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %79, i32 0, i32 16
  %81 = load ptr, ptr %80, align 8, !tbaa !22
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %82, i32 0, i32 25
  %84 = load ptr, ptr %83, align 8, !tbaa !23
  %85 = load ptr, ptr %14, align 8, !tbaa !5
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %86, i32 0, i32 13
  %88 = load ptr, ptr %87, align 8, !tbaa !16
  %89 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %88, i32 0, i32 3
  %90 = load i32, ptr %89, align 8, !tbaa !21
  call void @scale_by_diag(ptr noundef %81, ptr noundef %84, ptr noundef %85, i32 noundef %90)
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %91, i32 0, i32 20
  %93 = load ptr, ptr %92, align 8, !tbaa !24
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = call i32 @cusparseDnVecSetValues(ptr noundef %93, ptr noundef %94)
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %96, i32 0, i32 21
  %98 = load ptr, ptr %97, align 8, !tbaa !25
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = call i32 @cusparseDnVecSetValues(ptr noundef %98, ptr noundef %99)
  %101 = load ptr, ptr %15, align 8, !tbaa !5
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %102, i32 0, i32 20
  %104 = load ptr, ptr %103, align 8, !tbaa !24
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %105, i32 0, i32 21
  %107 = load ptr, ptr %106, align 8, !tbaa !25
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %108, i32 0, i32 17
  %110 = load ptr, ptr %109, align 8, !tbaa !26
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %111, i32 0, i32 18
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %113, i32 0, i32 19
  call void @_scs_accum_by_atrans_gpu(ptr noundef %101, ptr noundef %104, ptr noundef %107, ptr noundef %110, ptr noundef %112, ptr noundef %114)
  %115 = load ptr, ptr %15, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %115, i32 0, i32 4
  %117 = load i32, ptr %116, align 4, !tbaa !19
  %118 = mul nsw i32 10, %117
  store i32 %118, ptr %11, align 4, !tbaa !27
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = load ptr, ptr %13, align 8, !tbaa !5
  %122 = load i32, ptr %11, align 4, !tbaa !27
  %123 = load double, ptr %9, align 8, !tbaa !9
  %124 = call i32 @pcg(ptr noundef %119, ptr noundef %120, ptr noundef %121, i32 noundef %122, double noundef %123)
  store i32 %124, ptr %10, align 4, !tbaa !27
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %125, i32 0, i32 16
  %127 = load ptr, ptr %126, align 8, !tbaa !22
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %128, i32 0, i32 3
  %130 = load i32, ptr %129, align 8, !tbaa !21
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %132, i32 0, i32 4
  %134 = load i32, ptr %133, align 4, !tbaa !19
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds double, ptr %131, i64 %135
  %137 = call i32 @cublasDscal_v2(ptr noundef %127, i32 noundef %130, ptr noundef %12, ptr noundef %136, i32 noundef 1)
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %138, i32 0, i32 20
  %140 = load ptr, ptr %139, align 8, !tbaa !24
  %141 = load ptr, ptr %13, align 8, !tbaa !5
  %142 = load ptr, ptr %15, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %142, i32 0, i32 4
  %144 = load i32, ptr %143, align 4, !tbaa !19
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds double, ptr %141, i64 %145
  %147 = call i32 @cusparseDnVecSetValues(ptr noundef %140, ptr noundef %146)
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %148, i32 0, i32 21
  %150 = load ptr, ptr %149, align 8, !tbaa !25
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  %152 = call i32 @cusparseDnVecSetValues(ptr noundef %150, ptr noundef %151)
  %153 = load ptr, ptr %15, align 8, !tbaa !5
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %154, i32 0, i32 21
  %156 = load ptr, ptr %155, align 8, !tbaa !25
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %157, i32 0, i32 20
  %159 = load ptr, ptr %158, align 8, !tbaa !24
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %160, i32 0, i32 17
  %162 = load ptr, ptr %161, align 8, !tbaa !26
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %163, i32 0, i32 18
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %165, i32 0, i32 19
  call void @_scs_accum_by_a_gpu(ptr noundef %153, ptr noundef %156, ptr noundef %159, ptr noundef %162, ptr noundef %164, ptr noundef %166)
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %167, i32 0, i32 16
  %169 = load ptr, ptr %168, align 8, !tbaa !22
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %170, i32 0, i32 25
  %172 = load ptr, ptr %171, align 8, !tbaa !23
  %173 = load ptr, ptr %13, align 8, !tbaa !5
  %174 = load ptr, ptr %6, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %174, i32 0, i32 0
  %176 = load i32, ptr %175, align 8, !tbaa !17
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds double, ptr %173, i64 %177
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %179, i32 0, i32 13
  %181 = load ptr, ptr %180, align 8, !tbaa !16
  %182 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %181, i32 0, i32 3
  %183 = load i32, ptr %182, align 8, !tbaa !21
  call void @scale_by_diag(ptr noundef %169, ptr noundef %172, ptr noundef %178, i32 noundef %183)
  %184 = load ptr, ptr %7, align 8, !tbaa !5
  %185 = load ptr, ptr %13, align 8, !tbaa !5
  %186 = load ptr, ptr %15, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %186, i32 0, i32 4
  %188 = load i32, ptr %187, align 4, !tbaa !19
  %189 = load ptr, ptr %15, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.SCS_GPU_DATA_MATRIX, ptr %189, i32 0, i32 3
  %191 = load i32, ptr %190, align 8, !tbaa !21
  %192 = add nsw i32 %188, %191
  %193 = sext i32 %192 to i64
  %194 = mul i64 %193, 8
  %195 = call i32 @cudaMemcpy(ptr noundef %184, ptr noundef %185, i64 noundef %194, i32 noundef 2)
  %196 = load i32, ptr %10, align 4, !tbaa !27
  %197 = load ptr, ptr %6, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.SCS_LIN_SYS_WORK, ptr %197, i32 0, i32 2
  %199 = load i32, ptr %198, align 8, !tbaa !28
  %200 = add nsw i32 %199, %196
  store i32 %200, ptr %198, align 8, !tbaa !28
  store i32 0, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %201

201:                                              ; preds = %53, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %202 = load i32, ptr %5, align 4
  ret i32 %202
}

declare double @_scs_norm_inf(ptr noundef, i32 noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

declare void @_scs_accum_by_atrans_gpu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @pcg(ptr noundef, ptr noundef, ptr noundef, i32 noundef, double noundef) #2

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

declare void @_scs_accum_by_a_gpu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 48}
!12 = !{!"SCS_LIN_SYS_WORK", !13, i64 0, !13, i64 4, !13, 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, !14, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !6, i64 56}
!16 = !{!12, !6, i64 96}
!17 = !{!12, !13, i64 0}
!18 = !{!12, !13, i64 4}
!19 = !{!20, !13, i64 28}
!20 = !{!"SCS_GPU_DATA_MATRIX", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !13, i64 28, !13, i64 32, !6, i64 40}
!21 = !{!20, !13, i64 24}
!22 = !{!12, !6, i64 120}
!23 = !{!12, !6, i64 192}
!24 = !{!12, !6, i64 152}
!25 = !{!12, !6, i64 160}
!26 = !{!12, !6, i64 128}
!27 = !{!13, !13, i64 0}
!28 = !{!12, !13, i64 8}


; 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.4 = external hidden unnamed_addr constant [73 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 i32 @cudaMemcpy(ptr noundef, ptr noundef, i64 noundef, i32 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @scs_solve_lin_sys(ptr noundef %0, ptr noundef %1, ptr noundef %2, double noundef %3) local_unnamed_addr #3 {
  %5 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store double -1.000000e+00, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  %7 = load ptr, ptr %6, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  %9 = load ptr, ptr %8, align 8, !tbaa !14
  %10 = getelementptr inbounds i8, ptr %0, i64 96
  %11 = load ptr, ptr %10, align 8, !tbaa !15
  %12 = load i32, ptr %0, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 4
  %14 = load i32, ptr %13, align 4, !tbaa !17
  %15 = add nsw i32 %14, %12
  %16 = tail call double @_scs_norm_inf(ptr noundef %1, i32 noundef %15) #5
  %17 = fcmp ugt double %16, 0x3D719799812DEA11
  br i1 %17, label %24, label %18

18:                                               ; preds = %4
  %19 = load i32, ptr %0, align 8, !tbaa !16
  %20 = load i32, ptr %13, align 4, !tbaa !17
  %21 = add nsw i32 %20, %19
  %22 = sext i32 %21 to i64
  %23 = shl nsw i64 %22, 3
  tail call void @llvm.memset.p0.i64(ptr align 8 %1, i8 0, i64 %23, i1 false)
  br label %99

24:                                               ; preds = %4
  %25 = fcmp ugt double %3, 0.000000e+00
  br i1 %25, label %28, label %26

26:                                               ; preds = %24
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, double noundef %3)
  br label %28

28:                                               ; preds = %26, %24
  %29 = getelementptr inbounds i8, ptr %11, i64 28
  %30 = load i32, ptr %29, align 4, !tbaa !18
  %31 = getelementptr inbounds i8, ptr %11, i64 24
  %32 = load i32, ptr %31, align 8, !tbaa !20
  %33 = add nsw i32 %32, %30
  %34 = sext i32 %33 to i64
  %35 = shl nsw i64 %34, 3
  %36 = tail call i32 @cudaMemcpy(ptr noundef %7, ptr noundef %1, i64 noundef %35, i32 noundef 1) #5
  %37 = load i32, ptr %29, align 4, !tbaa !18
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds double, ptr %7, i64 %38
  %40 = load i32, ptr %31, align 8, !tbaa !20
  %41 = sext i32 %40 to i64
  %42 = shl nsw i64 %41, 3
  %43 = tail call i32 @cudaMemcpy(ptr noundef %9, ptr noundef %39, i64 noundef %42, i32 noundef 3) #5
  %44 = getelementptr inbounds i8, ptr %0, i64 120
  %45 = load ptr, ptr %44, align 8, !tbaa !21
  %46 = getelementptr inbounds i8, ptr %0, i64 192
  %47 = load ptr, ptr %46, align 8, !tbaa !22
  %48 = load ptr, ptr %10, align 8, !tbaa !15
  %49 = getelementptr inbounds i8, ptr %48, i64 24
  %50 = load i32, ptr %49, align 8, !tbaa !20
  tail call void @scale_by_diag(ptr noundef %45, ptr noundef %47, ptr noundef %9, i32 noundef %50)
  %51 = getelementptr inbounds i8, ptr %0, i64 152
  %52 = load ptr, ptr %51, align 8, !tbaa !23
  %53 = tail call i32 @cusparseDnVecSetValues(ptr noundef %52, ptr noundef %9) #5
  %54 = getelementptr inbounds i8, ptr %0, i64 160
  %55 = load ptr, ptr %54, align 8, !tbaa !24
  %56 = tail call i32 @cusparseDnVecSetValues(ptr noundef %55, ptr noundef %7) #5
  %57 = load ptr, ptr %51, align 8, !tbaa !23
  %58 = load ptr, ptr %54, align 8, !tbaa !24
  %59 = getelementptr inbounds i8, ptr %0, i64 128
  %60 = load ptr, ptr %59, align 8, !tbaa !25
  %61 = getelementptr inbounds i8, ptr %0, i64 136
  %62 = getelementptr inbounds i8, ptr %0, i64 144
  tail call void @_scs_accum_by_atrans_gpu(ptr noundef %11, ptr noundef %57, ptr noundef %58, ptr noundef %60, ptr noundef nonnull %61, ptr noundef nonnull %62) #5
  %63 = load i32, ptr %29, align 4, !tbaa !18
  %64 = mul nsw i32 %63, 10
  %65 = tail call i32 @pcg(ptr noundef nonnull %0, ptr noundef %2, ptr noundef %7, i32 noundef %64, double noundef %3)
  %66 = load ptr, ptr %44, align 8, !tbaa !21
  %67 = load i32, ptr %31, align 8, !tbaa !20
  %68 = load i32, ptr %29, align 4, !tbaa !18
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds double, ptr %7, i64 %69
  %71 = call i32 @cublasDscal_v2(ptr noundef %66, i32 noundef %67, ptr noundef nonnull %5, ptr noundef %70, i32 noundef 1) #5
  %72 = load ptr, ptr %51, align 8, !tbaa !23
  %73 = load i32, ptr %29, align 4, !tbaa !18
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds double, ptr %7, i64 %74
  %76 = call i32 @cusparseDnVecSetValues(ptr noundef %72, ptr noundef %75) #5
  %77 = load ptr, ptr %54, align 8, !tbaa !24
  %78 = call i32 @cusparseDnVecSetValues(ptr noundef %77, ptr noundef %7) #5
  %79 = load ptr, ptr %54, align 8, !tbaa !24
  %80 = load ptr, ptr %51, align 8, !tbaa !23
  %81 = load ptr, ptr %59, align 8, !tbaa !25
  call void @_scs_accum_by_a_gpu(ptr noundef %11, ptr noundef %79, ptr noundef %80, ptr noundef %81, ptr noundef nonnull %61, ptr noundef nonnull %62) #5
  %82 = load ptr, ptr %44, align 8, !tbaa !21
  %83 = load ptr, ptr %46, align 8, !tbaa !22
  %84 = load i32, ptr %0, align 8, !tbaa !16
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %7, i64 %85
  %87 = load ptr, ptr %10, align 8, !tbaa !15
  %88 = getelementptr inbounds i8, ptr %87, i64 24
  %89 = load i32, ptr %88, align 8, !tbaa !20
  call void @scale_by_diag(ptr noundef %82, ptr noundef %83, ptr noundef %86, i32 noundef %89)
  %90 = load i32, ptr %29, align 4, !tbaa !18
  %91 = load i32, ptr %31, align 8, !tbaa !20
  %92 = add nsw i32 %91, %90
  %93 = sext i32 %92 to i64
  %94 = shl nsw i64 %93, 3
  %95 = call i32 @cudaMemcpy(ptr noundef %1, ptr noundef %7, i64 noundef %94, i32 noundef 2) #5
  %96 = getelementptr inbounds i8, ptr %0, i64 8
  %97 = load i32, ptr %96, align 8, !tbaa !26
  %98 = add nsw i32 %97, %65
  store i32 %98, ptr %96, align 8, !tbaa !26
  br label %99

99:                                               ; preds = %28, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret i32 0
}

declare double @_scs_norm_inf(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

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

declare void @_scs_accum_by_atrans_gpu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

declare void @_scs_accum_by_a_gpu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 48}
!10 = !{!"SCS_LIN_SYS_WORK", !11, i64 0, !11, i64 4, !11, 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, !13, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192}
!11 = !{!"int", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !12, i64 56}
!15 = !{!10, !12, i64 96}
!16 = !{!10, !11, i64 0}
!17 = !{!10, !11, i64 4}
!18 = !{!19, !11, i64 28}
!19 = !{!"SCS_GPU_DATA_MATRIX", !12, i64 0, !12, i64 8, !12, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !12, i64 40}
!20 = !{!19, !11, i64 24}
!21 = !{!10, !12, i64 120}
!22 = !{!10, !12, i64 192}
!23 = !{!10, !12, i64 152}
!24 = !{!10, !12, i64 160}
!25 = !{!10, !12, i64 128}
!26 = !{!10, !11, i64 8}


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