; LLVM IR from XiaoMi/mace :: mace/runtimes/opencl/core (opencl_wrapper)

; 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::__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] }
%"class.mace::logging_internal::LatencyLogger" = type { i32, %"class.std::__cxx11::basic_string", i64 }
%"class.std::allocator.0" = type { i8 }
%"class.mace::port::Logger" = type { %"class.std::__cxx11::basic_ostringstream.base", ptr, i32, i32, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_ostringstream.base" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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.mace::runtime::OpenCLLibrary" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str.10 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [48 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4mace7runtime13OpenCLLibrary3GetEv() #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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

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

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

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

declare void @_ZN4mace4port6LoggerC1EPKciNS_8LogLevelE(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef, i32 noundef, i32 noundef) unnamed_addr #4

; Function Attrs: nounwind
declare void @_ZN4mace4port6LoggerD1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4mace10MakeStringB5cxx11EPKc(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4mace16logging_internal13LatencyLoggerC2EiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local ptr @clCreateCommandQueueWithProperties(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.mace::logging_internal::LatencyLogger", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator.0", align 1
  %14 = alloca i1, align 1
  %15 = alloca i1, align 1
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.mace::port::Logger", align 8
  %20 = alloca %"class.mace::port::Logger", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %21 = call noundef ptr @_ZN4mace7runtime13OpenCLLibrary3GetEv()
  %22 = getelementptr inbounds %"class.mace::runtime::OpenCLLibrary", ptr %21, i32 0, i32 21
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  store ptr %23, ptr %10, align 8, !tbaa !5
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %66

26:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  %27 = call noundef zeroext i1 @_ZN4mace25ShouldGenerateVLogMessageEi(i32 noundef 3)
  store i1 false, ptr %14, align 1
  store i1 false, ptr %15, align 1
  br i1 %27, label %28, label %29

28:                                               ; preds = %26
  call void @_ZN4mace10MakeStringB5cxx11EPKc(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %12, ptr noundef @.str.39)
  br label %31

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  store i1 true, ptr %14, align 1
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  store i1 true, ptr %15, align 1
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.67, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %30 unwind label %46

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30, %28
  invoke void @_ZN4mace16logging_internal13LatencyLoggerC2EiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48) %11, i32 noundef 3, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %32 unwind label %50

32:                                               ; preds = %31
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  %33 = load i1, ptr %15, align 1
  br i1 %33, label %34, label %35

34:                                               ; preds = %32
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  br label %35

35:                                               ; preds = %34, %32
  %36 = load i1, ptr %14, align 1
  br i1 %36, label %37, label %38

37:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  br label %38

38:                                               ; preds = %37, %35
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = invoke noundef ptr %39(ptr noundef %40, ptr noundef %41, ptr noundef %42, ptr noundef %43)
          to label %45 unwind label %61

45:                                               ; preds = %38
  store ptr %44, ptr %5, align 8
  store i32 1, ptr %18, align 4
  call void @_ZN4mace16logging_internal13LatencyLoggerD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #6
  br label %100

46:                                               ; preds = %29
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %16, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %17, align 4
  br label %54

50:                                               ; preds = %31
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %16, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %17, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  br label %54

54:                                               ; preds = %50, %46
  %55 = load i1, ptr %15, align 1
  br i1 %55, label %56, label %57

56:                                               ; preds = %54
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  br label %57

57:                                               ; preds = %56, %54
  %58 = load i1, ptr %14, align 1
  br i1 %58, label %59, label %60

59:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  br label %60

60:                                               ; preds = %59, %57
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  br label %65

61:                                               ; preds = %38
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %16, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %17, align 4
  call void @_ZN4mace16logging_internal13LatencyLoggerD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  br label %65

65:                                               ; preds = %61, %60
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #6
  br label %102

66:                                               ; preds = %4
  %67 = call noundef zeroext i1 @_ZN4mace25ShouldGenerateVLogMessageEi(i32 noundef 2)
  br i1 %67, label %68, label %75

68:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 392, ptr %19) #6
  call void @_ZN4mace4port6LoggerC1EPKciNS_8LogLevelE(ptr noundef nonnull align 8 dereferenceable(128) %19, ptr noundef @.str.10, i32 noundef 872, i32 noundef 1)
  %69 = invoke noundef nonnull align 8 dereferenceable(128) ptr @_ZStlsIN4mace4port6LoggerEA33_cEOT_S5_RKT0_(ptr noundef nonnull align 8 dereferenceable(128) %19, ptr noundef nonnull align 1 dereferenceable(33) @.str.68)
          to label %70 unwind label %71

70:                                               ; preds = %68
  call void @_ZN4mace4port6LoggerD1Ev(ptr noundef nonnull align 8 dereferenceable(128) %19) #6
  call void @llvm.lifetime.end.p0(i64 392, ptr %19) #6
  br label %75

71:                                               ; preds = %68
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %16, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %17, align 4
  call void @_ZN4mace4port6LoggerD1Ev(ptr noundef nonnull align 8 dereferenceable(128) %19) #6
  call void @llvm.lifetime.end.p0(i64 392, ptr %19) #6
  br label %102

75:                                               ; preds = %70, %66
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds i64, ptr %76, i64 0
  %78 = load i64, ptr %77, align 8, !tbaa !11
  %79 = icmp eq i64 %78, 4243
  br i1 %79, label %80, label %88

80:                                               ; preds = %75
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds i64, ptr %83, i64 1
  %85 = load i64, ptr %84, align 8, !tbaa !11
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = call ptr @clCreateCommandQueue(ptr noundef %81, ptr noundef %82, i64 noundef %85, ptr noundef %86)
  store ptr %87, ptr %5, align 8
  store i32 1, ptr %18, align 4
  br label %100

88:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 392, ptr %20) #6
  call void @_ZN4mace4port6LoggerC1EPKciNS_8LogLevelE(ptr noundef nonnull align 8 dereferenceable(128) %20, ptr noundef @.str.10, i32 noundef 880, i32 noundef 4)
  %89 = invoke noundef nonnull align 8 dereferenceable(128) ptr @_ZStlsIN4mace4port6LoggerEA48_cEOT_S5_RKT0_(ptr noundef nonnull align 8 dereferenceable(128) %20, ptr noundef nonnull align 1 dereferenceable(48) @.str.69)
          to label %90 unwind label %95

90:                                               ; preds = %88
  call void @_ZN4mace4port6LoggerD1Ev(ptr noundef nonnull align 8 dereferenceable(128) %20) #6
  call void @llvm.lifetime.end.p0(i64 392, ptr %20) #6
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %99

93:                                               ; preds = %90
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 -32, ptr %94, align 4, !tbaa !13
  br label %99

95:                                               ; preds = %88
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %16, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %17, align 4
  call void @_ZN4mace4port6LoggerD1Ev(ptr noundef nonnull align 8 dereferenceable(128) %20) #6
  call void @llvm.lifetime.end.p0(i64 392, ptr %20) #6
  br label %102

99:                                               ; preds = %93, %90
  store ptr null, ptr %5, align 8
  store i32 1, ptr %18, align 4
  br label %100

100:                                              ; preds = %99, %80, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %101 = load ptr, ptr %5, align 8
  ret ptr %101

102:                                              ; preds = %95, %71, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %16, align 8
  %105 = load i32, ptr %17, align 4
  %106 = insertvalue { ptr, i32 } poison, ptr %104, 0
  %107 = insertvalue { ptr, i32 } %106, i32 %105, 1
  resume { ptr, i32 } %107
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(128) ptr @_ZStlsIN4mace4port6LoggerEA33_cEOT_S5_RKT0_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 1 dereferenceable(33)) #3

; Function Attrs: mustprogress uwtable
declare dso_local ptr @clCreateCommandQueue(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(128) ptr @_ZStlsIN4mace4port6LoggerEA48_cEOT_S5_RKT0_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 1 dereferenceable(48)) #3

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

!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, !6, i64 168}
!10 = !{!"_ZTSN4mace7runtime13OpenCLLibraryE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, 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::__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] }
%"class.mace::logging_internal::LatencyLogger" = type { i32, %"class.std::__cxx11::basic_string", i64 }
%"class.std::allocator.0" = type { i8 }
%"class.mace::port::Logger" = type { %"class.std::__cxx11::basic_ostringstream.base", ptr, i32, i32, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_ostringstream.base" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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 }

@.str.10 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [48 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4mace7runtime13OpenCLLibrary3GetEv() local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 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: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4mace25ShouldGenerateVLogMessageEi(i32 noundef) local_unnamed_addr #3

declare void @_ZN4mace4port6LoggerC1EPKciNS_8LogLevelE(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef, i32 noundef, i32 noundef) unnamed_addr #4

; Function Attrs: nounwind
declare void @_ZN4mace4port6LoggerD1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4mace10MakeStringB5cxx11EPKc(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4mace16logging_internal13LatencyLoggerC2EiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local ptr @clCreateCommandQueueWithProperties(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.mace::logging_internal::LatencyLogger", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator.0", align 1
  %8 = alloca %"class.mace::port::Logger", align 8
  %9 = alloca %"class.mace::port::Logger", align 8
  %10 = tail call noundef ptr @_ZN4mace7runtime13OpenCLLibrary3GetEv()
  %11 = getelementptr inbounds i8, ptr %10, i64 168
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %29, label %13

13:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  %14 = tail call noundef zeroext i1 @_ZN4mace25ShouldGenerateVLogMessageEi(i32 noundef 3)
  br i1 %14, label %15, label %16

15:                                               ; preds = %13
  call void @_ZN4mace10MakeStringB5cxx11EPKc(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull @.str.39)
  br label %17

16:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.67, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %17 unwind label %.thread

17:                                               ; preds = %16, %15
  invoke void @_ZN4mace16logging_internal13LatencyLoggerC2EiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48) %5, i32 noundef 3, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %18 unwind label %23

18:                                               ; preds = %17
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  br i1 %14, label %.critedge, label %19

19:                                               ; preds = %18
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  br label %.critedge

.critedge:                                        ; preds = %18, %19
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  %20 = invoke noundef ptr %12(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3)
          to label %21 unwind label %26

21:                                               ; preds = %.critedge
  call void @_ZN4mace16logging_internal13LatencyLoggerD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  br label %49

.thread:                                          ; preds = %16
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %25

23:                                               ; preds = %17
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  br i1 %14, label %.critedge35, label %25

25:                                               ; preds = %.thread, %23
  %.pn39 = phi { ptr, i32 } [ %22, %.thread ], [ %24, %23 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  br label %.critedge35

.critedge35:                                      ; preds = %23, %25
  %.pn38 = phi { ptr, i32 } [ %24, %23 ], [ %.pn39, %25 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  br label %28

26:                                               ; preds = %.critedge
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4mace16logging_internal13LatencyLoggerD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  br label %28

28:                                               ; preds = %26, %.critedge35
  %.pn31 = phi { ptr, i32 } [ %27, %26 ], [ %.pn38, %.critedge35 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  br label %50

29:                                               ; preds = %4
  %30 = tail call noundef zeroext i1 @_ZN4mace25ShouldGenerateVLogMessageEi(i32 noundef 2)
  br i1 %30, label %31, label %36

31:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 392, ptr nonnull %8) #6
  call void @_ZN4mace4port6LoggerC1EPKciNS_8LogLevelE(ptr noundef nonnull align 8 dereferenceable(128) %8, ptr noundef nonnull @.str.10, i32 noundef 872, i32 noundef 1)
  %32 = invoke noundef nonnull align 8 dereferenceable(128) ptr @_ZStlsIN4mace4port6LoggerEA33_cEOT_S5_RKT0_(ptr noundef nonnull align 8 dereferenceable(128) %8, ptr noundef nonnull align 1 dereferenceable(33) @.str.68)
          to label %33 unwind label %34

33:                                               ; preds = %31
  call void @_ZN4mace4port6LoggerD1Ev(ptr noundef nonnull align 8 dereferenceable(128) %8) #6
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %8) #6
  br label %36

34:                                               ; preds = %31
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4mace4port6LoggerD1Ev(ptr noundef nonnull align 8 dereferenceable(128) %8) #6
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %8) #6
  br label %50

36:                                               ; preds = %33, %29
  %37 = load i64, ptr %2, align 8, !tbaa !10
  %38 = icmp eq i64 %37, 4243
  br i1 %38, label %39, label %43

39:                                               ; preds = %36
  %40 = getelementptr inbounds i8, ptr %2, i64 8
  %41 = load i64, ptr %40, align 8, !tbaa !10
  %42 = call ptr @clCreateCommandQueue(ptr noundef %0, ptr noundef %1, i64 noundef %41, ptr noundef %3)
  br label %49

43:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 392, ptr nonnull %9) #6
  call void @_ZN4mace4port6LoggerC1EPKciNS_8LogLevelE(ptr noundef nonnull align 8 dereferenceable(128) %9, ptr noundef nonnull @.str.10, i32 noundef 880, i32 noundef 4)
  %44 = invoke noundef nonnull align 8 dereferenceable(128) ptr @_ZStlsIN4mace4port6LoggerEA48_cEOT_S5_RKT0_(ptr noundef nonnull align 8 dereferenceable(128) %9, ptr noundef nonnull align 1 dereferenceable(48) @.str.69)
          to label %45 unwind label %47

45:                                               ; preds = %43
  call void @_ZN4mace4port6LoggerD1Ev(ptr noundef nonnull align 8 dereferenceable(128) %9) #6
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %9) #6
  %.not29 = icmp eq ptr %3, null
  br i1 %.not29, label %49, label %46

46:                                               ; preds = %45
  store i32 -32, ptr %3, align 4, !tbaa !12
  br label %49

47:                                               ; preds = %43
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4mace4port6LoggerD1Ev(ptr noundef nonnull align 8 dereferenceable(128) %9) #6
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %9) #6
  br label %50

49:                                               ; preds = %45, %46, %39, %21
  %.026 = phi ptr [ %20, %21 ], [ %42, %39 ], [ null, %46 ], [ null, %45 ]
  ret ptr %.026

50:                                               ; preds = %47, %34, %28
  %.pn31.pn = phi { ptr, i32 } [ %.pn31, %28 ], [ %48, %47 ], [ %35, %34 ]
  resume { ptr, i32 } %.pn31.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(128) ptr @_ZStlsIN4mace4port6LoggerEA33_cEOT_S5_RKT0_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 1 dereferenceable(33)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local ptr @clCreateCommandQueue(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(128) ptr @_ZStlsIN4mace4port6LoggerEA48_cEOT_S5_RKT0_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 1 dereferenceable(48)) local_unnamed_addr #3

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

!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, !7, i64 168}
!6 = !{!"_ZTSN4mace7runtime13OpenCLLibraryE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !7, i64 392}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass