; LLVM IR from ERGO-Code/HiGHS :: src/pdlp/cupdlp/cuda (test_cuda_linalg)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [89 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

16:                                               ; preds = %0
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %155

17:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 10, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = mul i64 %19, 8
  %21 = call noalias ptr @malloc(i64 noundef %20) #7
  store ptr %21, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = mul i64 %23, 8
  %25 = call noalias ptr @malloc(i64 noundef %24) #7
  store ptr %25, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %44, %17
  %27 = load i32, ptr %7, align 4, !tbaa !5
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %47

31:                                               ; preds = %26
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = sitofp i32 %32 to double
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = load i32, ptr %7, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds double, ptr %34, i64 %36
  store double %33, ptr %37, align 8, !tbaa !11
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = sitofp i32 %38 to double
  %40 = load ptr, ptr %6, align 8, !tbaa !9
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds double, ptr %40, i64 %42
  store double %39, ptr %43, align 8, !tbaa !11
  br label %44

44:                                               ; preds = %31
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %7, align 4, !tbaa !5
  br label %26, !llvm.loop !13

47:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = mul i64 %49, 8
  %51 = call i32 @cudaMalloc(ptr noundef %8, i64 noundef %50)
  %52 = call i32 @check_cuda_call(i32 noundef %51, ptr noundef @.str, i32 noundef 42)
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %47
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %154

55:                                               ; preds = %47
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = mul i64 %57, 8
  %59 = call i32 @cudaMalloc(ptr noundef %9, i64 noundef %58)
  %60 = call i32 @check_cuda_call(i32 noundef %59, ptr noundef @.str, i32 noundef 43)
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %55
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %154

63:                                               ; preds = %55
  %64 = load ptr, ptr %8, align 8, !tbaa !9
  %65 = load ptr, ptr %5, align 8, !tbaa !9
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = mul i64 %67, 8
  %69 = call i32 @cudaMemcpy(ptr noundef %64, ptr noundef %65, i64 noundef %68, i32 noundef 1)
  %70 = call i32 @check_cuda_call(i32 noundef %69, ptr noundef @.str, i32 noundef 45)
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %63
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %154

73:                                               ; preds = %63
  %74 = load ptr, ptr %9, align 8, !tbaa !9
  %75 = load ptr, ptr %6, align 8, !tbaa !9
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = mul i64 %77, 8
  %79 = call i32 @cudaMemcpy(ptr noundef %74, ptr noundef %75, i64 noundef %78, i32 noundef 1)
  %80 = call i32 @check_cuda_call(i32 noundef %79, ptr noundef @.str, i32 noundef 47)
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %73
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %154

83:                                               ; preds = %73
  %84 = load ptr, ptr %8, align 8, !tbaa !9
  %85 = load ptr, ptr %9, align 8, !tbaa !9
  %86 = load i32, ptr %4, align 4, !tbaa !5
  call void @cupdlp_edot_cuda(ptr noundef %84, ptr noundef %85, i32 noundef %86)
  %87 = load ptr, ptr %5, align 8, !tbaa !9
  %88 = load ptr, ptr %8, align 8, !tbaa !9
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = mul i64 %90, 8
  %92 = call i32 @cudaMemcpy(ptr noundef %87, ptr noundef %88, i64 noundef %91, i32 noundef 2)
  %93 = call i32 @check_cuda_call(i32 noundef %92, ptr noundef @.str, i32 noundef 58)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %83
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %154

96:                                               ; preds = %83
  %97 = load ptr, ptr %6, align 8, !tbaa !9
  %98 = load ptr, ptr %9, align 8, !tbaa !9
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = mul i64 %100, 8
  %102 = call i32 @cudaMemcpy(ptr noundef %97, ptr noundef %98, i64 noundef %101, i32 noundef 2)
  %103 = call i32 @check_cuda_call(i32 noundef %102, ptr noundef @.str, i32 noundef 60)
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %96
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %154

106:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %107 = call i32 @cudaGetLastError()
  store i32 %107, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %108 = call i32 @cudaDeviceSynchronize()
  store i32 %108, ptr %11, align 4, !tbaa !5
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %115

111:                                              ; preds = %106
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = call ptr @cudaGetErrorString(i32 noundef %112)
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %113)
  br label %115

115:                                              ; preds = %111, %106
  %116 = load i32, ptr %11, align 4, !tbaa !5
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %122

118:                                              ; preds = %115
  %119 = load i32, ptr %11, align 4, !tbaa !5
  %120 = call ptr @cudaGetErrorString(i32 noundef %119)
  %121 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %120)
  br label %122

122:                                              ; preds = %118, %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %135, %122
  %124 = load i32, ptr %12, align 4, !tbaa !5
  %125 = load i32, ptr %4, align 4, !tbaa !5
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %138

128:                                              ; preds = %123
  %129 = load ptr, ptr %5, align 8, !tbaa !9
  %130 = load i32, ptr %12, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %129, i64 %131
  %133 = load double, ptr %132, align 8, !tbaa !11
  %134 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %133)
  br label %135

135:                                              ; preds = %128
  %136 = load i32, ptr %12, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %12, align 4, !tbaa !5
  br label %123, !llvm.loop !15

138:                                              ; preds = %127
  %139 = load ptr, ptr %5, align 8, !tbaa !9
  call void @free(ptr noundef %139) #6
  %140 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %140) #6
  %141 = load ptr, ptr %8, align 8, !tbaa !9
  %142 = call i32 @cudaFree(ptr noundef %141)
  %143 = call i32 @check_cuda_call(i32 noundef %142, ptr noundef @.str, i32 noundef 77)
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %146

145:                                              ; preds = %138
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %153

146:                                              ; preds = %138
  %147 = load ptr, ptr %9, align 8, !tbaa !9
  %148 = call i32 @cudaFree(ptr noundef %147)
  %149 = call i32 @check_cuda_call(i32 noundef %148, ptr noundef @.str, i32 noundef 78)
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %146
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %153

152:                                              ; preds = %146
  store i32 0, ptr %3, align 4
  br label %153

153:                                              ; preds = %152, %151, %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %154

154:                                              ; preds = %153, %105, %95, %82, %72, %62, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %155

155:                                              ; preds = %154, %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %156 = load i32, ptr %3, align 4
  switch i32 %156, label %159 [
    i32 0, label %157
    i32 1, label %157
  ]

157:                                              ; preds = %155, %155
  %158 = load i32, ptr %1, align 4
  ret i32 %158

159:                                              ; preds = %155
  unreachable
}

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

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

declare i32 @cudaGetDeviceCount(ptr noundef) #3

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

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

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

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

declare void @cupdlp_edot_cuda(ptr noundef, ptr noundef, i32 noundef) #3

declare i32 @cudaGetLastError() #3

declare i32 @cudaDeviceSynchronize() #3

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

declare ptr @cudaGetErrorString(i32 noundef) #3

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

declare i32 @cudaFree(ptr noundef) #3

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 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [89 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

6:                                                ; preds = %0
  %7 = call noalias dereferenceable_or_null(80) ptr @malloc(i64 noundef 80) #8
  %8 = call noalias dereferenceable_or_null(80) ptr @malloc(i64 noundef 80) #8
  %9 = getelementptr inbounds i8, ptr %7, i64 8
  store <2 x double> <double 0.000000e+00, double 1.000000e+00>, ptr %7, align 8, !tbaa !5
  store <2 x double> <double 0.000000e+00, double 1.000000e+00>, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %7, i64 16
  %11 = getelementptr inbounds i8, ptr %8, i64 16
  %12 = getelementptr inbounds i8, ptr %7, i64 24
  store <2 x double> <double 2.000000e+00, double 3.000000e+00>, ptr %10, align 8, !tbaa !5
  store <2 x double> <double 2.000000e+00, double 3.000000e+00>, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %7, i64 32
  %14 = getelementptr inbounds i8, ptr %8, i64 32
  %15 = getelementptr inbounds i8, ptr %7, i64 40
  store <2 x double> <double 4.000000e+00, double 5.000000e+00>, ptr %13, align 8, !tbaa !5
  store <2 x double> <double 4.000000e+00, double 5.000000e+00>, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %7, i64 48
  %17 = getelementptr inbounds i8, ptr %8, i64 48
  %18 = getelementptr inbounds i8, ptr %7, i64 56
  store <2 x double> <double 6.000000e+00, double 7.000000e+00>, ptr %16, align 8, !tbaa !5
  store <2 x double> <double 6.000000e+00, double 7.000000e+00>, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %7, i64 64
  %20 = getelementptr inbounds i8, ptr %8, i64 64
  %21 = getelementptr inbounds i8, ptr %7, i64 72
  store <2 x double> <double 8.000000e+00, double 9.000000e+00>, ptr %19, align 8, !tbaa !5
  store <2 x double> <double 8.000000e+00, double 9.000000e+00>, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %22 = call i32 @cudaMalloc(ptr noundef nonnull %2, i64 noundef 80) #7
  %23 = call i32 @check_cuda_call(i32 noundef %22, ptr noundef nonnull @.str, i32 noundef 42)
  %.not37 = icmp eq i32 %23, 0
  br i1 %.not37, label %24, label %83

24:                                               ; preds = %6
  %25 = call i32 @cudaMalloc(ptr noundef nonnull %3, i64 noundef 80) #7
  %26 = call i32 @check_cuda_call(i32 noundef %25, ptr noundef nonnull @.str, i32 noundef 43)
  %.not38 = icmp eq i32 %26, 0
  br i1 %.not38, label %27, label %83

27:                                               ; preds = %24
  %28 = load ptr, ptr %2, align 8, !tbaa !9
  %29 = call i32 @cudaMemcpy(ptr noundef %28, ptr noundef nonnull %7, i64 noundef 80, i32 noundef 1) #7
  %30 = call i32 @check_cuda_call(i32 noundef %29, ptr noundef nonnull @.str, i32 noundef 45)
  %.not39 = icmp eq i32 %30, 0
  br i1 %.not39, label %31, label %83

31:                                               ; preds = %27
  %32 = load ptr, ptr %3, align 8, !tbaa !9
  %33 = call i32 @cudaMemcpy(ptr noundef %32, ptr noundef nonnull %8, i64 noundef 80, i32 noundef 1) #7
  %34 = call i32 @check_cuda_call(i32 noundef %33, ptr noundef nonnull @.str, i32 noundef 47)
  %.not40 = icmp eq i32 %34, 0
  br i1 %.not40, label %35, label %83

35:                                               ; preds = %31
  %36 = load ptr, ptr %2, align 8, !tbaa !9
  %37 = load ptr, ptr %3, align 8, !tbaa !9
  call void @cupdlp_edot_cuda(ptr noundef %36, ptr noundef %37, i32 noundef 10) #7
  %38 = load ptr, ptr %2, align 8, !tbaa !9
  %39 = call i32 @cudaMemcpy(ptr noundef nonnull %7, ptr noundef %38, i64 noundef 80, i32 noundef 2) #7
  %40 = call i32 @check_cuda_call(i32 noundef %39, ptr noundef nonnull @.str, i32 noundef 58)
  %.not41 = icmp eq i32 %40, 0
  br i1 %.not41, label %41, label %83

41:                                               ; preds = %35
  %42 = load ptr, ptr %3, align 8, !tbaa !9
  %43 = call i32 @cudaMemcpy(ptr noundef nonnull %8, ptr noundef %42, i64 noundef 80, i32 noundef 2) #7
  %44 = call i32 @check_cuda_call(i32 noundef %43, ptr noundef nonnull @.str, i32 noundef 60)
  %.not42 = icmp eq i32 %44, 0
  br i1 %.not42, label %45, label %83

45:                                               ; preds = %41
  %46 = call i32 @cudaGetLastError() #7
  %47 = call i32 @cudaDeviceSynchronize() #7
  %.not43 = icmp eq i32 %46, 0
  br i1 %.not43, label %51, label %48

48:                                               ; preds = %45
  %49 = call ptr @cudaGetErrorString(i32 noundef %46) #7
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %49)
  br label %51

51:                                               ; preds = %48, %45
  %.not44 = icmp eq i32 %47, 0
  br i1 %.not44, label %55, label %52

52:                                               ; preds = %51
  %53 = call ptr @cudaGetErrorString(i32 noundef %47) #7
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %53)
  br label %55

55:                                               ; preds = %52, %51
  %56 = load double, ptr %7, align 8, !tbaa !5
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %56)
  %58 = load double, ptr %9, align 8, !tbaa !5
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %58)
  %60 = load double, ptr %10, align 8, !tbaa !5
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %60)
  %62 = load double, ptr %12, align 8, !tbaa !5
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %62)
  %64 = load double, ptr %13, align 8, !tbaa !5
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %64)
  %66 = load double, ptr %15, align 8, !tbaa !5
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %66)
  %68 = load double, ptr %16, align 8, !tbaa !5
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %68)
  %70 = load double, ptr %18, align 8, !tbaa !5
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %70)
  %72 = load double, ptr %19, align 8, !tbaa !5
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %72)
  %74 = load double, ptr %21, align 8, !tbaa !5
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %74)
  call void @free(ptr noundef nonnull %7) #7
  call void @free(ptr noundef nonnull %8) #7
  %76 = load ptr, ptr %2, align 8, !tbaa !9
  %77 = call i32 @cudaFree(ptr noundef %76) #7
  %78 = call i32 @check_cuda_call(i32 noundef %77, ptr noundef nonnull @.str, i32 noundef 77)
  %.not45 = icmp eq i32 %78, 0
  br i1 %.not45, label %79, label %83

79:                                               ; preds = %55
  %80 = load ptr, ptr %3, align 8, !tbaa !9
  %81 = call i32 @cudaFree(ptr noundef %80) #7
  %82 = call i32 @check_cuda_call(i32 noundef %81, ptr noundef nonnull @.str, i32 noundef 78)
  %.not46 = icmp ne i32 %82, 0
  %. = zext i1 %.not46 to i32
  br label %83

83:                                               ; preds = %55, %79, %41, %35, %31, %27, %24, %6
  %.1 = phi i32 [ 1, %6 ], [ 1, %24 ], [ 1, %27 ], [ 1, %31 ], [ 1, %35 ], [ 1, %41 ], [ 1, %55 ], [ %., %79 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %84

84:                                               ; preds = %0, %83
  %.2 = phi i32 [ %.1, %83 ], [ 1, %0 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 %.2
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @check_cuda_call(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @cudaGetDeviceCount(ptr noundef) local_unnamed_addr #3

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

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

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

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

declare void @cupdlp_edot_cuda(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @cudaGetLastError() local_unnamed_addr #3

declare i32 @cudaDeviceSynchronize() local_unnamed_addr #3

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

declare ptr @cudaGetErrorString(i32 noundef) local_unnamed_addr #3

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

declare i32 @cudaFree(ptr noundef) local_unnamed_addr #3

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 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass