; LLVM IR from ERGO-Code/HiGHS :: check (cublas_gpu_start)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store ptr null, ptr %7, align 8, !tbaa !5
  %12 = call noalias ptr @malloc(i64 noundef 20) #8
  store ptr %12, ptr %7, align 8, !tbaa !5
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %17, label %15

15:                                               ; preds = %0
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %133

17:                                               ; preds = %0
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %29, %17
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 5
  br i1 %20, label %21, label %32

21:                                               ; preds = %18
  %22 = load i32, ptr %5, align 4, !tbaa !9
  %23 = mul nsw i32 %22, 5
  %24 = sitofp i32 %23 to float
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds float, ptr %25, i64 %27
  store float %24, ptr %28, align 4, !tbaa !11
  br label %29

29:                                               ; preds = %21
  %30 = load i32, ptr %5, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %5, align 4, !tbaa !9
  br label %18, !llvm.loop !13

32:                                               ; preds = %18
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %44, %32
  %34 = load i32, ptr %5, align 4, !tbaa !9
  %35 = icmp slt i32 %34, 5
  br i1 %35, label %36, label %47

36:                                               ; preds = %33
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load i32, ptr %5, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds float, ptr %37, i64 %39
  %41 = load float, ptr %40, align 4, !tbaa !11
  %42 = fpext float %41 to double
  %43 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %42)
  br label %44

44:                                               ; preds = %36
  %45 = load i32, ptr %5, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %5, align 4, !tbaa !9
  br label %33, !llvm.loop !15

47:                                               ; preds = %33
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %49 = call i32 @cudaMalloc(ptr noundef %6, i64 noundef 20)
  store i32 %49, ptr %2, align 4, !tbaa !16
  %50 = load i32, ptr %2, align 4, !tbaa !16
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %55

52:                                               ; preds = %47
  %53 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %54) #7
  store i32 1, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %133

55:                                               ; preds = %47
  %56 = call i32 @cublasCreate_v2(ptr noundef %4)
  store i32 %56, ptr %3, align 4, !tbaa !18
  %57 = load i32, ptr %3, align 4, !tbaa !18
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %64

59:                                               ; preds = %55
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %61) #7
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = call i32 @cudaFree(ptr noundef %62)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %133

64:                                               ; preds = %55
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = call i32 @cublasSetVector(i32 noundef 5, i32 noundef 4, ptr noundef %65, i32 noundef 1, ptr noundef %66, i32 noundef 1)
  store i32 %67, ptr %3, align 4, !tbaa !18
  %68 = load i32, ptr %3, align 4, !tbaa !18
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %77

70:                                               ; preds = %64
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %72) #7
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = call i32 @cudaFree(ptr noundef %73)
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = call i32 @cublasDestroy_v2(ptr noundef %75)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %133

77:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = call i32 @cublasSnrm2_v2(ptr noundef %78, i32 noundef 5, ptr noundef %79, i32 noundef 1, ptr noundef %9)
  store i32 %80, ptr %10, align 4, !tbaa !18
  %81 = load i32, ptr %3, align 4, !tbaa !18
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %90

83:                                               ; preds = %77
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %85) #7
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = call i32 @cudaFree(ptr noundef %86)
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = call i32 @cublasDestroy_v2(ptr noundef %88)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %132

90:                                               ; preds = %77
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.6)
  %92 = load float, ptr %9, align 4, !tbaa !11
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %91, float noundef %92)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %96 = call noalias ptr @malloc(i64 noundef 20) #8
  store ptr %96, ptr %11, align 8, !tbaa !5
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = call i32 @cublasGetVector(i32 noundef 5, i32 noundef 4, ptr noundef %97, i32 noundef 1, ptr noundef %98, i32 noundef 1)
  store i32 %99, ptr %3, align 4, !tbaa !18
  %100 = load i32, ptr %3, align 4, !tbaa !18
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %109

102:                                              ; preds = %90
  %103 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %104) #7
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = call i32 @cudaFree(ptr noundef %105)
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = call i32 @cublasDestroy_v2(ptr noundef %107)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %131

109:                                              ; preds = %90
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = call i32 @cudaFree(ptr noundef %110)
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = call i32 @cublasDestroy_v2(ptr noundef %112)
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %125, %109
  %115 = load i32, ptr %5, align 4, !tbaa !9
  %116 = icmp slt i32 %115, 5
  br i1 %116, label %117, label %128

117:                                              ; preds = %114
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  %119 = load i32, ptr %5, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds float, ptr %118, i64 %120
  %122 = load float, ptr %121, align 4, !tbaa !11
  %123 = fpext float %122 to double
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %123)
  br label %125

125:                                              ; preds = %117
  %126 = load i32, ptr %5, align 4, !tbaa !9
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %5, align 4, !tbaa !9
  br label %114, !llvm.loop !20

128:                                              ; preds = %114
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %130) #7
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %131

131:                                              ; preds = %128, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %132

132:                                              ; preds = %131, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %133

133:                                              ; preds = %132, %70, %59, %52, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %134 = load i32, ptr %1, align 4
  ret i32 %134
}

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

declare i32 @cublasCreate_v2(ptr noundef) #3

declare i32 @cudaFree(ptr noundef) #3

declare i32 @cublasSetVector(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #3

declare i32 @cublasDestroy_v2(ptr noundef) #3

declare i32 @cublasSnrm2_v2(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8), float noundef) #4 align 2

declare i32 @cublasGetVector(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #3

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

attributes #0 = { mustprogress norecurse 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 = { 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 #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 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 #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !17, i64 0}
!17 = !{!"_ZTS9cudaError", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"_ZTS14cublasStatus_t", !7, i64 0}
!20 = distinct !{!20, !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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %4 = tail call noalias dereferenceable_or_null(20) ptr @malloc(i64 noundef 20) #9
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %13, label %.preheader35.preheader

.preheader35.preheader:                           ; preds = %0
  store <4 x float> <float 0.000000e+00, float 5.000000e+00, float 1.000000e+01, float 1.500000e+01>, ptr %4, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 16
  store float 2.000000e+01, ptr %5, align 4, !tbaa !5
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef 0.000000e+00)
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef 5.000000e+00)
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef 1.000000e+01)
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef 1.500000e+01)
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef 2.000000e+01)
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %12 = call i32 @cudaMalloc(ptr noundef nonnull %2, i64 noundef 20)
  %.not31 = icmp eq i32 %12, 0
  br i1 %.not31, label %17, label %15

13:                                               ; preds = %0
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %76

15:                                               ; preds = %.preheader35.preheader
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  call void @free(ptr noundef nonnull %4) #8
  br label %76

17:                                               ; preds = %.preheader35.preheader
  %18 = call i32 @cublasCreate_v2(ptr noundef nonnull %1)
  %.not32 = icmp eq i32 %18, 0
  br i1 %.not32, label %23, label %19

19:                                               ; preds = %17
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @free(ptr noundef nonnull %4) #8
  %21 = load ptr, ptr %2, align 8, !tbaa !9
  %22 = call i32 @cudaFree(ptr noundef %21)
  br label %76

23:                                               ; preds = %17
  %24 = load ptr, ptr %2, align 8, !tbaa !9
  %25 = call i32 @cublasSetVector(i32 noundef 5, i32 noundef 4, ptr noundef nonnull %4, i32 noundef 1, ptr noundef %24, i32 noundef 1)
  %.not33 = icmp eq i32 %25, 0
  br i1 %.not33, label %32, label %26

26:                                               ; preds = %23
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @free(ptr noundef nonnull %4) #8
  %28 = load ptr, ptr %2, align 8, !tbaa !9
  %29 = call i32 @cudaFree(ptr noundef %28)
  %30 = load ptr, ptr %1, align 8, !tbaa !9
  %31 = call i32 @cublasDestroy_v2(ptr noundef %30)
  br label %76

32:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %33 = load ptr, ptr %1, align 8, !tbaa !9
  %34 = load ptr, ptr %2, align 8, !tbaa !9
  %35 = call i32 @cublasSnrm2_v2(ptr noundef %33, i32 noundef 5, ptr noundef %34, i32 noundef 1, ptr noundef nonnull %3)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.6)
  %37 = load float, ptr %3, align 4, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %36, float noundef %37)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %41 = call noalias dereferenceable_or_null(20) ptr @malloc(i64 noundef 20) #9
  %42 = load ptr, ptr %2, align 8, !tbaa !9
  %43 = call i32 @cublasGetVector(i32 noundef 5, i32 noundef 4, ptr noundef %42, i32 noundef 1, ptr noundef %41, i32 noundef 1)
  %.not34 = icmp eq i32 %43, 0
  br i1 %.not34, label %50, label %44

44:                                               ; preds = %32
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  call void @free(ptr noundef nonnull %4) #8
  %46 = load ptr, ptr %2, align 8, !tbaa !9
  %47 = call i32 @cudaFree(ptr noundef %46)
  %48 = load ptr, ptr %1, align 8, !tbaa !9
  %49 = call i32 @cublasDestroy_v2(ptr noundef %48)
  br label %75

50:                                               ; preds = %32
  %51 = load ptr, ptr %2, align 8, !tbaa !9
  %52 = call i32 @cudaFree(ptr noundef %51)
  %53 = load ptr, ptr %1, align 8, !tbaa !9
  %54 = call i32 @cublasDestroy_v2(ptr noundef %53)
  %55 = load float, ptr %41, align 4, !tbaa !5
  %56 = fpext float %55 to double
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %56)
  %58 = getelementptr inbounds i8, ptr %41, i64 4
  %59 = load float, ptr %58, align 4, !tbaa !5
  %60 = fpext float %59 to double
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %60)
  %62 = getelementptr inbounds i8, ptr %41, i64 8
  %63 = load float, ptr %62, align 4, !tbaa !5
  %64 = fpext float %63 to double
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %64)
  %66 = getelementptr inbounds i8, ptr %41, i64 12
  %67 = load float, ptr %66, align 4, !tbaa !5
  %68 = fpext float %67 to double
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %68)
  %70 = getelementptr inbounds i8, ptr %41, i64 16
  %71 = load float, ptr %70, align 4, !tbaa !5
  %72 = fpext float %71 to double
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %72)
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  call void @free(ptr noundef nonnull %4) #8
  br label %75

75:                                               ; preds = %44, %50
  %.0 = phi i32 [ 1, %44 ], [ 0, %50 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %76

76:                                               ; preds = %75, %26, %19, %15, %13
  %.2 = phi i32 [ 1, %15 ], [ 1, %19 ], [ 1, %26 ], [ %.0, %75 ], [ 1, %13 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  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: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

declare i32 @cublasCreate_v2(ptr noundef) local_unnamed_addr #6

declare i32 @cudaFree(ptr noundef) local_unnamed_addr #6

declare i32 @cublasSetVector(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

declare i32 @cublasDestroy_v2(ptr noundef) local_unnamed_addr #6

declare i32 @cublasSnrm2_v2(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8), float noundef) local_unnamed_addr #4 align 2

declare i32 @cublasGetVector(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

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

attributes #0 = { mustprogress norecurse 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 = { 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 #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 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 #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "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 = { 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 #8 = { nounwind }
attributes #9 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple 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,LoopSimplifyPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass