; LLVM IR from chrismile/cfd3d :: src/CfdSolver/Opencl/ClInterface.ll (ZN11ClInterface10initializeE13CLContextInfo)

; 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.CLContextInfo = type <{ i64, i8, [7 x i8] }>
%"class.std::initializer_list" = type { ptr, i64 }
%"class.cl::Device" = type { %"class.cl::detail::Wrapper.base", [7 x i8] }
%"class.cl::detail::Wrapper.base" = type <{ ptr, i8 }>
%"class.cl::Context" = type { %"class.cl::detail::Wrapper.5" }
%"class.cl::detail::Wrapper.5" = type { ptr }
%class.ClInterface = type { %class.Singleton, %"class.std::vector", %"class.std::vector.0", %"class.cl::Platform", %"class.std::vector.0", %"class.cl::Context", %"class.std::__cxx11::basic_string" }
%class.Singleton = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<cl::Platform, std::allocator<cl::Platform>>::_Vector_impl" }
%"struct.std::_Vector_base<cl::Platform, std::allocator<cl::Platform>>::_Vector_impl" = type { %"struct.std::_Vector_base<cl::Platform, std::allocator<cl::Platform>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cl::Platform, std::allocator<cl::Platform>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.cl::Platform" = type { %"class.cl::detail::Wrapper" }
%"class.cl::detail::Wrapper" = type { ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<cl::Device, std::allocator<cl::Device>>::_Vector_impl" }
%"struct.std::_Vector_base<cl::Device, std::allocator<cl::Device>>::_Vector_impl" = type { %"struct.std::_Vector_base<cl::Device, std::allocator<cl::Device>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cl::Device, std::allocator<cl::Device>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [57 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [57 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2cl6detail7WrapperIP11_cl_contextED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11ClInterface10initializeE13CLContextInfo(ptr noundef nonnull align 8 dereferenceable(128) %0, i64 %1, i8 %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.CLContextInfo, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::initializer_list", align 8
  %7 = alloca [1 x %"class.cl::Device"], align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.cl::Context", align 8
  %12 = getelementptr inbounds { i64, i8 }, ptr %4, i32 0, i32 0
  store i64 %1, ptr %12, align 8
  %13 = getelementptr inbounds { i64, i8 }, ptr %4, i32 0, i32 1
  store i8 %2, ptr %13, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8
  %15 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 1
  %16 = call noundef i32 @_ZN2cl8Platform3getEPSt6vectorIS0_SaIS0_EE(ptr noundef %15)
  %17 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 1
  %18 = call noundef i64 @_ZNKSt6vectorIN2cl8PlatformESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  %19 = getelementptr inbounds %struct.CLContextInfo, ptr %4, i32 0, i32 0
  %20 = load i64, ptr %19, align 8, !tbaa !9
  %21 = icmp ule i64 %18, %20
  br i1 %21, label %22, label %25

22:                                               ; preds = %3
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 1) #6
  unreachable

25:                                               ; preds = %3
  %26 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 1
  %27 = getelementptr inbounds %struct.CLContextInfo, ptr %4, i32 0, i32 0
  %28 = load i64, ptr %27, align 8, !tbaa !9
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIN2cl8PlatformESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %28)
  %30 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 3
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2cl8PlatformaSERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %32 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 3
  %33 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 2
  %34 = call noundef i32 @_ZNK2cl8Platform10getDevicesEmPSt6vectorINS_6DeviceESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %32, i64 noundef 4294967295, ptr noundef %33)
  %35 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 2
  %36 = call noundef zeroext i1 @_ZNKSt6vectorIN2cl6DeviceESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #5
  br i1 %36, label %37, label %40

37:                                               ; preds = %25
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 1) #6
  unreachable

40:                                               ; preds = %25
  %41 = getelementptr inbounds %struct.CLContextInfo, ptr %4, i32 0, i32 1
  %42 = load i8, ptr %41, align 8, !tbaa !13, !range !14, !noundef !15
  %43 = trunc i8 %42 to i1
  br i1 %43, label %44, label %48

44:                                               ; preds = %40
  %45 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 2
  %46 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 4
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 8 dereferenceable(24) %45)
  br label %92

48:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  store ptr %7, ptr %8, align 8
  %49 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 2
  %50 = invoke noundef nonnull align 8 dereferenceable(9) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef 0)
          to label %51 unwind label %69

51:                                               ; preds = %48
  invoke void @_ZN2cl6DeviceC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(9) %7, ptr noundef nonnull align 8 dereferenceable(9) %50)
          to label %52 unwind label %69

52:                                               ; preds = %51
  %53 = getelementptr inbounds %"class.std::initializer_list", ptr %6, i32 0, i32 0
  store ptr %7, ptr %53, align 8, !tbaa !16
  %54 = getelementptr inbounds %"class.std::initializer_list", ptr %6, i32 0, i32 1
  store i64 1, ptr %54, align 8, !tbaa !18
  %55 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 4
  %56 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8
  %58 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 1
  %59 = load i64, ptr %58, align 8
  %60 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EEaSESt16initializer_listIS1_E(ptr noundef nonnull align 8 dereferenceable(24) %55, ptr %57, i64 %59)
          to label %61 unwind label %80

61:                                               ; preds = %52
  %62 = getelementptr inbounds [1 x %"class.cl::Device"], ptr %7, i32 0, i32 0
  %63 = getelementptr inbounds %"class.cl::Device", ptr %62, i64 1
  br label %64

64:                                               ; preds = %64, %61
  %65 = phi ptr [ %63, %61 ], [ %66, %64 ]
  %66 = getelementptr inbounds %"class.cl::Device", ptr %65, i64 -1
  call void @_ZN2cl6detail7WrapperIP13_cl_device_idED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %66) #5
  %67 = icmp eq ptr %66, %62
  br i1 %67, label %68, label %64

68:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  br label %92

69:                                               ; preds = %51, %48
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %9, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %10, align 4
  %73 = load ptr, ptr %8, align 8
  %74 = icmp eq ptr %7, %73
  br i1 %74, label %79, label %75

75:                                               ; preds = %75, %69
  %76 = phi ptr [ %73, %69 ], [ %77, %75 ]
  %77 = getelementptr inbounds %"class.cl::Device", ptr %76, i64 -1
  call void @_ZN2cl6detail7WrapperIP13_cl_device_idED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %77) #5
  %78 = icmp eq ptr %77, %7
  br i1 %78, label %79, label %75

79:                                               ; preds = %75, %69
  br label %91

80:                                               ; preds = %52
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %9, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %10, align 4
  %84 = getelementptr inbounds [1 x %"class.cl::Device"], ptr %7, i32 0, i32 0
  %85 = getelementptr inbounds %"class.cl::Device", ptr %84, i64 1
  br label %86

86:                                               ; preds = %86, %80
  %87 = phi ptr [ %85, %80 ], [ %88, %86 ]
  %88 = getelementptr inbounds %"class.cl::Device", ptr %87, i64 -1
  call void @_ZN2cl6detail7WrapperIP13_cl_device_idED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %88) #5
  %89 = icmp eq ptr %88, %84
  br i1 %89, label %90, label %86

90:                                               ; preds = %86
  br label %91

91:                                               ; preds = %90, %79
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  br label %101

92:                                               ; preds = %68, %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %93 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 4
  call void @_ZN2cl7ContextC2ERKSt6vectorINS_6DeviceESaIS2_EEPKlPFvPKcPKvmPvESD_Pi(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(24) %93, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef null)
  %94 = getelementptr inbounds %class.ClInterface, ptr %14, i32 0, i32 5
  %95 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN2cl7ContextaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %96 unwind label %97

96:                                               ; preds = %92
  call void @_ZN2cl6detail7WrapperIP11_cl_contextED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret void

97:                                               ; preds = %92
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %9, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %10, align 4
  call void @_ZN2cl6detail7WrapperIP11_cl_contextED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %101

101:                                              ; preds = %97, %91
  %102 = load ptr, ptr %9, align 8
  %103 = load i32, ptr %10, align 4
  %104 = insertvalue { ptr, i32 } poison, ptr %102, 0
  %105 = insertvalue { ptr, i32 } %104, i32 %103, 1
  resume { ptr, i32 } %105
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2cl8Platform3getEPSt6vectorIS0_SaIS0_EE(ptr noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN2cl8PlatformESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIN2cl8PlatformESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN2cl8PlatformaSERKS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK2cl8Platform10getDevicesEmPSt6vectorINS_6DeviceESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIN2cl6DeviceESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(9) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2cl6DeviceC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2cl6detail7WrapperIP13_cl_device_idED2Ev(ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EEaSESt16initializer_listIS1_E(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2cl7ContextC2ERKSt6vectorINS_6DeviceESaIS2_EEPKlPFvPKcPKvmPvESD_Pi(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef, ptr noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN2cl7ContextaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

attributes #0 = { mustprogress 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 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 #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 = { noreturn 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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, !11, i64 0}
!10 = !{!"_ZTS13CLContextInfo", !11, i64 0, !12, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!10, !12, i64 8}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSSt16initializer_listIN2cl6DeviceEE", !6, i64 0, !11, i64 8}
!18 = !{!17, !11, 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"

%"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 }
%"class.cl::Device" = type { %"class.cl::detail::Wrapper.base", [7 x i8] }
%"class.cl::detail::Wrapper.base" = type <{ ptr, i8 }>
%"class.cl::Context" = type { %"class.cl::detail::Wrapper.5" }
%"class.cl::detail::Wrapper.5" = type { ptr }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [57 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [57 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2cl6detail7WrapperIP11_cl_contextED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11ClInterface10initializeE13CLContextInfo(ptr noundef nonnull align 8 dereferenceable(128) %0, i64 %1, i8 %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca [1 x %"class.cl::Device"], align 8
  %5 = alloca %"class.cl::Context", align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = tail call noundef i32 @_ZN2cl8Platform3getEPSt6vectorIS0_SaIS0_EE(ptr noundef nonnull %6)
  %8 = tail call noundef i64 @_ZNKSt6vectorIN2cl8PlatformESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %.not = icmp ugt i64 %8, %1
  br i1 %.not, label %12, label %9

9:                                                ; preds = %3
  %10 = tail 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)
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  tail call void @exit(i32 noundef 1) #6
  unreachable

12:                                               ; preds = %3
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIN2cl8PlatformESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %1)
  %14 = getelementptr inbounds i8, ptr %0, i64 56
  %15 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2cl8PlatformaSERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  %17 = tail call noundef i32 @_ZNK2cl8Platform10getDevicesEmPSt6vectorINS_6DeviceESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %14, i64 noundef 4294967295, ptr noundef nonnull %16)
  %18 = tail call noundef zeroext i1 @_ZNKSt6vectorIN2cl6DeviceESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  br i1 %18, label %19, label %22

19:                                               ; preds = %12
  %20 = tail 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.2)
  %21 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  tail call void @exit(i32 noundef 1) #6
  unreachable

22:                                               ; preds = %12
  %23 = trunc i8 %2 to i1
  br i1 %23, label %24, label %27

24:                                               ; preds = %22
  %25 = getelementptr inbounds i8, ptr %0, i64 64
  %26 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(24) %16)
  br label %37

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %28 = invoke noundef nonnull align 8 dereferenceable(9) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0)
          to label %29 unwind label %34

29:                                               ; preds = %27
  invoke void @_ZN2cl6DeviceC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(9) %4, ptr noundef nonnull align 8 dereferenceable(9) %28)
          to label %30 unwind label %34

30:                                               ; preds = %29
  %31 = getelementptr inbounds i8, ptr %0, i64 64
  %32 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EEaSESt16initializer_listIS1_E(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr nonnull %4, i64 1)
          to label %33 unwind label %.loopexit.loopexit

33:                                               ; preds = %30
  call void @_ZN2cl6detail7WrapperIP13_cl_device_idED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %37

34:                                               ; preds = %29, %27
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit.loopexit:                               ; preds = %30
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2cl6detail7WrapperIP13_cl_device_idED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %4) #5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %34
  %.pn = phi { ptr, i32 } [ %35, %34 ], [ %36, %.loopexit.loopexit ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %44

37:                                               ; preds = %33, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %38 = getelementptr inbounds i8, ptr %0, i64 64
  call void @_ZN2cl7ContextC2ERKSt6vectorINS_6DeviceESaIS2_EEPKlPFvPKcPKvmPvESD_Pi(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef null)
  %39 = getelementptr inbounds i8, ptr %0, i64 88
  %40 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN2cl7ContextaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %41 unwind label %42

41:                                               ; preds = %37
  call void @_ZN2cl6detail7WrapperIP11_cl_contextED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret void

42:                                               ; preds = %37
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2cl6detail7WrapperIP11_cl_contextED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %44

44:                                               ; preds = %42, %.loopexit
  %.pn10 = phi { ptr, i32 } [ %43, %42 ], [ %.pn, %.loopexit ]
  resume { ptr, i32 } %.pn10
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2cl8Platform3getEPSt6vectorIS0_SaIS0_EE(ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN2cl8PlatformESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 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) 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 #1 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: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIN2cl8PlatformESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK2cl8Platform10getDevicesEmPSt6vectorINS_6DeviceESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIN2cl6DeviceESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(9) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2cl6DeviceC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2cl6detail7WrapperIP13_cl_device_idED2Ev(ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN2cl6DeviceESaIS1_EEaSESt16initializer_listIS1_E(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2cl7ContextC2ERKSt6vectorINS_6DeviceESaIS2_EEPKlPFvPKcPKvmPvESD_Pi(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef, ptr noundef) unnamed_addr #1 align 2

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass