; LLVM IR from PRiME-project/PRiMEStereoMatch :: src/oclUtil.ll (Z13createContextPP11_cl_context)

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

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.20 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [28 x i8], align 1
@__const._Z13createContextPP11_cl_context.devices = external hidden unnamed_addr constant [3 x %struct.anon], align 16
@.str.47 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [36 x i8], align 1

declare i32 @printf(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 @clGetPlatformIDs(i32 noundef, ptr noundef, ptr noundef) #0

declare i32 @clGetDeviceIDs(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z12checkSuccessi(i32 noundef) #2

; 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) #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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)) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z13createContextPP11_cl_context(ptr noundef %0) #3 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [3 x %struct.anon], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [3 x i64], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr null, ptr %6, align 8, !tbaa !5
  %13 = call i32 @clGetPlatformIDs(i32 noundef 1, ptr noundef %6, ptr noundef %5)
  %14 = call noundef zeroext i1 @_Z12checkSuccessi(i32 noundef %13)
  br i1 %14, label %21, label %15

15:                                               ; preds = %1
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.42)
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef @.str.20)
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef @.str.21)
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %18, i32 noundef 278)
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i1 false, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %110

21:                                               ; preds = %1
  %22 = load i32, ptr %5, align 4, !tbaa !9
  %23 = icmp ule i32 %22, 0
  br i1 %23, label %24, label %30

24:                                               ; preds = %21
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.43)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef @.str.20)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef @.str.21)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %27, i32 noundef 284)
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i1 false, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %110

30:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = call i32 @clGetDeviceIDs(ptr noundef %31, i64 noundef 4294967295, i32 noundef 0, ptr noundef null, ptr noundef %8)
  call void @llvm.lifetime.start.p0(i64 72, ptr %9) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 @__const._Z13createContextPP11_cl_context.devices, i64 72, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 3, ptr %10, align 4, !tbaa !9
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str.47)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %69, %30
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = icmp slt i32 %35, 3
  br i1 %36, label %38, label %37

37:                                               ; preds = %34
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %72

38:                                               ; preds = %34
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [3 x %struct.anon], ptr %9, i64 0, i64 %41
  %43 = getelementptr inbounds %struct.anon, ptr %42, i32 0, i32 0
  %44 = load i64, ptr %43, align 8, !tbaa !11
  %45 = load i32, ptr %11, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [3 x %struct.anon], ptr %9, i64 0, i64 %46
  %48 = getelementptr inbounds %struct.anon, ptr %47, i32 0, i32 2
  %49 = call i32 @clGetDeviceIDs(ptr noundef %39, i64 noundef %44, i32 noundef 0, ptr noundef null, ptr noundef %48)
  store i32 %49, ptr %4, align 4, !tbaa !9
  %50 = load i32, ptr %4, align 4, !tbaa !9
  %51 = icmp eq i32 -1, %50
  br i1 %51, label %52, label %57

52:                                               ; preds = %38
  %53 = load i32, ptr %11, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [3 x %struct.anon], ptr %9, i64 0, i64 %54
  %56 = getelementptr inbounds %struct.anon, ptr %55, i32 0, i32 2
  store i32 0, ptr %56, align 8, !tbaa !14
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %52, %38
  %58 = load i32, ptr %11, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [3 x %struct.anon], ptr %9, i64 0, i64 %59
  %61 = getelementptr inbounds %struct.anon, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !15
  %63 = load i32, ptr %11, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [3 x %struct.anon], ptr %9, i64 0, i64 %64
  %66 = getelementptr inbounds %struct.anon, ptr %65, i32 0, i32 2
  %67 = load i32, ptr %66, align 8, !tbaa !14
  %68 = call i32 (ptr, ...) @printf(ptr noundef @.str.48, ptr noundef %62, i32 noundef %67)
  br label %69

69:                                               ; preds = %57
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %11, align 4, !tbaa !9
  br label %34, !llvm.loop !16

72:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  store i64 4228, ptr %12, align 8, !tbaa !18
  %73 = getelementptr inbounds i64, ptr %12, i64 1
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = ptrtoint ptr %74 to i64
  store i64 %75, ptr %73, align 8, !tbaa !18
  %76 = getelementptr inbounds i64, ptr %12, i64 2
  store i64 0, ptr %76, align 8, !tbaa !18
  %77 = getelementptr inbounds [3 x %struct.anon], ptr %9, i64 0, i64 2
  %78 = getelementptr inbounds %struct.anon, ptr %77, i32 0, i32 2
  %79 = load i32, ptr %78, align 16, !tbaa !14
  %80 = icmp ugt i32 %79, 0
  br i1 %80, label %81, label %85

81:                                               ; preds = %72
  %82 = getelementptr inbounds [3 x i64], ptr %12, i64 0, i64 0
  %83 = call ptr @clCreateContextFromType(ptr noundef %82, i64 noundef 8, ptr noundef @_Z14context_notifyPKcPKvmPv, ptr noundef null, ptr noundef %4)
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %83, ptr %84, align 8, !tbaa !5
  br label %99

85:                                               ; preds = %72
  %86 = getelementptr inbounds [3 x %struct.anon], ptr %9, i64 0, i64 1
  %87 = getelementptr inbounds %struct.anon, ptr %86, i32 0, i32 2
  %88 = load i32, ptr %87, align 8, !tbaa !14
  %89 = icmp ugt i32 %88, 0
  br i1 %89, label %90, label %94

90:                                               ; preds = %85
  %91 = getelementptr inbounds [3 x i64], ptr %12, i64 0, i64 0
  %92 = call ptr @clCreateContextFromType(ptr noundef %91, i64 noundef 4, ptr noundef @_Z14context_notifyPKcPKvmPv, ptr noundef null, ptr noundef %4)
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %92, ptr %93, align 8, !tbaa !5
  br label %98

94:                                               ; preds = %85
  %95 = getelementptr inbounds [3 x i64], ptr %12, i64 0, i64 0
  %96 = call ptr @clCreateContextFromType(ptr noundef %95, i64 noundef 2, ptr noundef @_Z14context_notifyPKcPKvmPv, ptr noundef null, ptr noundef %4)
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %96, ptr %97, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %94, %90
  br label %99

99:                                               ; preds = %98, %81
  %100 = load i32, ptr %4, align 4, !tbaa !9
  %101 = call noundef zeroext i1 @_Z12checkSuccessi(i32 noundef %100)
  br i1 %101, label %108, label %102

102:                                              ; preds = %99
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.49)
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef @.str.20)
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %104, ptr noundef @.str.21)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %105, i32 noundef 323)
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %106, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i1 false, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %109

108:                                              ; preds = %99
  store i1 true, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %109

109:                                              ; preds = %108, %102
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %110

110:                                              ; preds = %109, %24, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %111 = load i1, ptr %2, align 1
  ret i1 %111
}

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

declare ptr @clCreateContextFromType(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z14context_notifyPKcPKvmPv(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #3

attributes #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 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"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, !13, i64 0}
!12 = !{!"_ZTSZ13createContextPP11_cl_contextE3$_0", !13, i64 0, !6, i64 8, !10, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !10, i64 16}
!15 = !{!12, !6, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!13, !13, i64 0}


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

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.20 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [28 x i8], align 1
@__const._Z13createContextPP11_cl_context.devices = external hidden unnamed_addr constant [3 x %struct.anon], align 16
@.str.47 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 @clGetPlatformIDs(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @clGetDeviceIDs(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr 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: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z12checkSuccessi(i32 noundef) local_unnamed_addr #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) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; 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)) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z13createContextPP11_cl_context(ptr nocapture noundef writeonly %0) local_unnamed_addr #4 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [3 x %struct.anon], align 16
  %7 = alloca [3 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store ptr null, ptr %4, align 8, !tbaa !9
  %8 = call i32 @clGetPlatformIDs(i32 noundef 1, ptr noundef nonnull %4, ptr noundef nonnull %3)
  %9 = call noundef zeroext i1 @_Z12checkSuccessi(i32 noundef %8)
  br i1 %9, label %16, label %10

10:                                               ; preds = %1
  %11 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.42)
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull @.str.20)
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull @.str.21)
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %13, i32 noundef 278)
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %82

16:                                               ; preds = %1
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %25

19:                                               ; preds = %16
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.43)
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull @.str.20)
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull @.str.21)
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %22, i32 noundef 284)
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %82

25:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %26 = load ptr, ptr %4, align 8, !tbaa !9
  %27 = call i32 @clGetDeviceIDs(ptr noundef %26, i64 noundef 4294967295, i32 noundef 0, ptr noundef null, ptr noundef nonnull %5)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(72) %6, ptr noundef nonnull align 16 dereferenceable(72) @__const._Z13createContextPP11_cl_context.devices, i64 72, i1 false)
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.47)
  %29 = load ptr, ptr %4, align 8, !tbaa !9
  %30 = load i64, ptr %6, align 16, !tbaa !11
  %31 = getelementptr inbounds i8, ptr %6, i64 16
  %32 = call i32 @clGetDeviceIDs(ptr noundef %29, i64 noundef %30, i32 noundef 0, ptr noundef null, ptr noundef nonnull %31)
  %33 = icmp eq i32 %32, -1
  br i1 %33, label %34, label %._crit_edge

._crit_edge:                                      ; preds = %25
  %.pre = load i32, ptr %31, align 16, !tbaa !14
  br label %35

34:                                               ; preds = %25
  store i32 0, ptr %31, align 16, !tbaa !14
  br label %35

35:                                               ; preds = %._crit_edge, %34
  %36 = phi i32 [ %.pre, %._crit_edge ], [ 0, %34 ]
  %37 = getelementptr inbounds i8, ptr %6, i64 8
  %38 = load ptr, ptr %37, align 8, !tbaa !15
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.48, ptr noundef %38, i32 noundef %36)
  %40 = load ptr, ptr %4, align 8, !tbaa !9
  %41 = getelementptr inbounds i8, ptr %6, i64 24
  %42 = load i64, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds i8, ptr %6, i64 40
  %44 = call i32 @clGetDeviceIDs(ptr noundef %40, i64 noundef %42, i32 noundef 0, ptr noundef null, ptr noundef nonnull %43)
  %45 = icmp eq i32 %44, -1
  br i1 %45, label %46, label %._crit_edge14

._crit_edge14:                                    ; preds = %35
  %.pre15 = load i32, ptr %43, align 8, !tbaa !14
  br label %47

46:                                               ; preds = %35
  store i32 0, ptr %43, align 8, !tbaa !14
  br label %47

47:                                               ; preds = %._crit_edge14, %46
  %48 = phi i32 [ %.pre15, %._crit_edge14 ], [ 0, %46 ]
  %49 = getelementptr inbounds i8, ptr %6, i64 32
  %50 = load ptr, ptr %49, align 16, !tbaa !15
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.48, ptr noundef %50, i32 noundef %48)
  %52 = load ptr, ptr %4, align 8, !tbaa !9
  %53 = getelementptr inbounds i8, ptr %6, i64 48
  %54 = load i64, ptr %53, align 16, !tbaa !11
  %55 = getelementptr inbounds i8, ptr %6, i64 64
  %56 = call i32 @clGetDeviceIDs(ptr noundef %52, i64 noundef %54, i32 noundef 0, ptr noundef null, ptr noundef nonnull %55)
  store i32 %56, ptr %2, align 4, !tbaa !5
  %57 = icmp eq i32 %56, -1
  br i1 %57, label %58, label %._crit_edge16

._crit_edge16:                                    ; preds = %47
  %.pre17 = load i32, ptr %55, align 16, !tbaa !14
  br label %59

58:                                               ; preds = %47
  store i32 0, ptr %55, align 16, !tbaa !14
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %._crit_edge16, %58
  %60 = phi i32 [ %.pre17, %._crit_edge16 ], [ 0, %58 ]
  %61 = getelementptr inbounds i8, ptr %6, i64 56
  %62 = load ptr, ptr %61, align 8, !tbaa !15
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.48, ptr noundef %62, i32 noundef %60)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  store i64 4228, ptr %7, align 16, !tbaa !16
  %64 = getelementptr inbounds i8, ptr %7, i64 8
  %65 = load ptr, ptr %4, align 8, !tbaa !9
  %66 = ptrtoint ptr %65 to i64
  store i64 %66, ptr %64, align 8, !tbaa !16
  %67 = getelementptr inbounds i8, ptr %7, i64 16
  store i64 0, ptr %67, align 16, !tbaa !16
  %68 = getelementptr inbounds i8, ptr %6, i64 64
  %69 = load i32, ptr %68, align 16, !tbaa !14
  %.not = icmp eq i32 %69, 0
  %70 = getelementptr inbounds i8, ptr %6, i64 40
  %71 = load i32, ptr %70, align 8
  %.not11 = icmp eq i32 %71, 0
  %. = select i1 %.not11, i64 2, i64 4
  %.sink18 = select i1 %.not, i64 %., i64 8
  %72 = call ptr @clCreateContextFromType(ptr noundef nonnull %7, i64 noundef %.sink18, ptr noundef nonnull @_Z14context_notifyPKcPKvmPv, ptr noundef null, ptr noundef nonnull %2)
  store ptr %72, ptr %0, align 8, !tbaa !9
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = call noundef zeroext i1 @_Z12checkSuccessi(i32 noundef %73)
  br i1 %74, label %81, label %75

75:                                               ; preds = %59
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.49)
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @.str.20)
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef nonnull @.str.21)
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %78, i32 noundef 323)
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %81

81:                                               ; preds = %59, %75
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %82

82:                                               ; preds = %81, %19, %10
  %.1 = phi i1 [ false, %19 ], [ %74, %81 ], [ false, %10 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  ret i1 %.1
}

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

declare ptr @clCreateContextFromType(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z14context_notifyPKcPKvmPv(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #4

attributes #0 = { 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 #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 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }

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

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


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass