; LLVM IR from GPUOpen-LibrariesAndSDKs/TAN :: tan/samples/src/GPUUtilities (GPUUtilities)

; 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.AMFFactoryHelper = type { ptr, ptr, ptr, ptr, ptr, i64, i64, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl" }
%"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl" = type { %"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl_data" }
%"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.amf::AMFInterfacePtr_T" = type { ptr }
%"class.amf::AMFInterfacePtr_T.1" = type { ptr }
%"class.amf::AMFInterfacePtr_T.2" = type { ptr }

@g_AMFFactory = external global %class.AMFFactoryHelper, align 8
@.str.18 = external hidden unnamed_addr constant [24 x i32], align 4

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z22getAMFdevicePropertiesP17_cl_command_queuePi(ptr noundef %0, ptr noundef %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.amf::AMFInterfacePtr_T", align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.amf::AMFInterfacePtr_T.1", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.amf::AMFInterfacePtr_T.2", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @_ZN3amf17AMFInterfacePtr_TINS_10AMFContextEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !11
  %16 = invoke noundef i32 @_ZN16AMFFactoryHelper4InitEv(ptr noundef nonnull align 8 dereferenceable(80) @g_AMFFactory)
          to label %17 unwind label %31

17:                                               ; preds = %2
  %18 = invoke noundef ptr @_ZN16AMFFactoryHelper10GetFactoryEv(ptr noundef nonnull align 8 dereferenceable(80) @g_AMFFactory)
          to label %19 unwind label %31

19:                                               ; preds = %17
  %20 = icmp ne ptr %18, null
  br i1 %20, label %21, label %35

21:                                               ; preds = %19
  %22 = invoke noundef ptr @_ZN16AMFFactoryHelper10GetFactoryEv(ptr noundef nonnull align 8 dereferenceable(80) @g_AMFFactory)
          to label %23 unwind label %31

23:                                               ; preds = %21
  %24 = invoke noundef ptr @_ZN3amf17AMFInterfacePtr_TINS_10AMFContextEEadEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %25 unwind label %31

25:                                               ; preds = %23
  %26 = load ptr, ptr %22, align 8, !tbaa !13
  %27 = getelementptr inbounds ptr, ptr %26, i64 0
  %28 = load ptr, ptr %27, align 8
  %29 = invoke noundef i32 %28(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef %24)
          to label %30 unwind label %31

30:                                               ; preds = %25
  store i32 %29, ptr %6, align 4, !tbaa !9
  br label %35

31:                                               ; preds = %46, %44, %38, %25, %23, %21, %17, %2
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %9, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %10, align 4
  br label %154

35:                                               ; preds = %30, %19
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %151

38:                                               ; preds = %35
  %39 = invoke noundef zeroext i1 @_ZN3amf17AMFInterfacePtr_TINS_10AMFContextEEneEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef null)
          to label %40 unwind label %31

40:                                               ; preds = %38
  br i1 %39, label %41, label %151

41:                                               ; preds = %40
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %148

44:                                               ; preds = %41
  %45 = invoke noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_10AMFContextEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %46 unwind label %31

46:                                               ; preds = %44
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = load ptr, ptr %45, align 8, !tbaa !13
  %49 = getelementptr inbounds ptr, ptr %48, i64 22
  %50 = load ptr, ptr %49, align 8
  %51 = invoke noundef i32 %50(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef %47)
          to label %52 unwind label %31

52:                                               ; preds = %46
  store i32 %51, ptr %6, align 4, !tbaa !9
  %53 = load i32, ptr %6, align 4, !tbaa !9
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %147

55:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  invoke void @_ZN3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %56 unwind label %81

56:                                               ; preds = %55
  %57 = invoke noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_10AMFContextEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %58 unwind label %85

58:                                               ; preds = %56
  %59 = invoke noundef ptr @_ZN3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEEadEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %60 unwind label %85

60:                                               ; preds = %58
  %61 = load ptr, ptr %57, align 8, !tbaa !13
  %62 = getelementptr inbounds ptr, ptr %61, i64 26
  %63 = load ptr, ptr %62, align 8
  %64 = invoke noundef i32 %63(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef %59)
          to label %65 unwind label %85

65:                                               ; preds = %60
  store i32 %64, ptr %6, align 4, !tbaa !9
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %68, label %144

68:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %69 = invoke noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %70 unwind label %89

70:                                               ; preds = %68
  %71 = load ptr, ptr %69, align 8, !tbaa !13
  %72 = getelementptr inbounds ptr, ptr %71, i64 3
  %73 = load ptr, ptr %72, align 8
  %74 = invoke noundef i32 %73(ptr noundef nonnull align 8 dereferenceable(8) %69)
          to label %75 unwind label %89

75:                                               ; preds = %70
  store i32 %74, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %76

76:                                               ; preds = %137, %75
  %77 = load i32, ptr %13, align 4, !tbaa !11
  %78 = load i32, ptr %12, align 4, !tbaa !11
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %93, label %80

80:                                               ; preds = %76
  store i32 2, ptr %14, align 4
  br label %141

81:                                               ; preds = %55
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %9, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %10, align 4
  br label %146

85:                                               ; preds = %60, %58, %56
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %9, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %10, align 4
  br label %145

89:                                               ; preds = %70, %68
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %9, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %10, align 4
  br label %143

93:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  invoke void @_ZN3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %94 unwind label %125

94:                                               ; preds = %93
  %95 = invoke noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %96 unwind label %129

96:                                               ; preds = %94
  %97 = load i32, ptr %13, align 4, !tbaa !11
  %98 = invoke noundef ptr @_ZN3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEEadEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %99 unwind label %129

99:                                               ; preds = %96
  %100 = load ptr, ptr %95, align 8, !tbaa !13
  %101 = getelementptr inbounds ptr, ptr %100, i64 4
  %102 = load ptr, ptr %101, align 8
  %103 = invoke noundef i32 %102(ptr noundef nonnull align 8 dereferenceable(8) %95, i32 noundef %97, ptr noundef %98)
          to label %104 unwind label %129

104:                                              ; preds = %99
  store i32 %103, ptr %6, align 4, !tbaa !9
  %105 = invoke noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_10AMFContextEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %106 unwind label %129

106:                                              ; preds = %104
  %107 = load ptr, ptr %105, align 8, !tbaa !13
  %108 = getelementptr inbounds ptr, ptr %107, i64 25
  %109 = load ptr, ptr %108, align 8
  %110 = invoke noundef ptr %109(ptr noundef nonnull align 8 dereferenceable(8) %105)
          to label %111 unwind label %129

111:                                              ; preds = %106
  %112 = invoke noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %113 unwind label %129

113:                                              ; preds = %111
  %114 = load ptr, ptr %112, align 8, !tbaa !13
  %115 = getelementptr inbounds ptr, ptr %114, i64 14
  %116 = load ptr, ptr %115, align 8
  %117 = invoke noundef ptr %116(ptr noundef nonnull align 8 dereferenceable(8) %112)
          to label %118 unwind label %129

118:                                              ; preds = %113
  %119 = icmp eq ptr %110, %117
  br i1 %119, label %120, label %133

120:                                              ; preds = %118
  %121 = invoke noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %122 unwind label %129

122:                                              ; preds = %120
  %123 = invoke noundef i32 @_ZNK3amf18AMFPropertyStorage11GetPropertyIiEE10AMF_RESULTPKwPT_(ptr noundef nonnull align 8 dereferenceable(8) %121, ptr noundef @.str.18, ptr noundef %8)
          to label %124 unwind label %129

124:                                              ; preds = %122
  store i32 2, ptr %14, align 4
  br label %134

125:                                              ; preds = %93
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %9, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %10, align 4
  br label %140

129:                                              ; preds = %122, %120, %113, %111, %106, %104, %99, %96, %94
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %9, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %10, align 4
  call void @_ZN3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  br label %140

133:                                              ; preds = %118
  store i32 0, ptr %14, align 4
  br label %134

134:                                              ; preds = %133, %124
  call void @_ZN3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  %135 = load i32, ptr %14, align 4
  switch i32 %135, label %141 [
    i32 0, label %136
  ]

136:                                              ; preds = %134
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %13, align 4, !tbaa !11
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %13, align 4, !tbaa !11
  br label %76, !llvm.loop !15

140:                                              ; preds = %129, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %143

141:                                              ; preds = %134, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %142

142:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %144

143:                                              ; preds = %140, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %145

144:                                              ; preds = %142, %65
  call void @_ZN3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %147

145:                                              ; preds = %143, %85
  call void @_ZN3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br label %146

146:                                              ; preds = %145, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %154

147:                                              ; preds = %144, %52
  br label %148

148:                                              ; preds = %147, %41
  %149 = load i32, ptr %8, align 4, !tbaa !11
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 %149, ptr %150, align 4, !tbaa !11
  store i1 true, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %152

151:                                              ; preds = %40, %35
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %152

152:                                              ; preds = %151, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @_ZN3amf17AMFInterfacePtr_TINS_10AMFContextEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %153 = load i1, ptr %3, align 1
  ret i1 %153

154:                                              ; preds = %146, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @_ZN3amf17AMFInterfacePtr_TINS_10AMFContextEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %155

155:                                              ; preds = %154
  %156 = load ptr, ptr %9, align 8
  %157 = load i32, ptr %10, align 4
  %158 = insertvalue { ptr, i32 } poison, ptr %156, 0
  %159 = insertvalue { ptr, i32 } %158, i32 %157, 1
  resume { ptr, i32 } %159
}

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

declare noundef i32 @_ZN16AMFFactoryHelper4InitEv(ptr noundef nonnull align 8 dereferenceable(80)) #2

declare i32 @__gxx_personality_v0(...)

declare noundef ptr @_ZN16AMFFactoryHelper10GetFactoryEv(ptr noundef nonnull align 8 dereferenceable(80)) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_10AMFContextEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 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 #4 = { 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 #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 = !{!"_ZTS10AMF_RESULT", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; 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.AMFFactoryHelper = type { ptr, ptr, ptr, ptr, ptr, i64, i64, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl" }
%"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl" = type { %"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl_data" }
%"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.amf::AMFInterfacePtr_T" = type { ptr }
%"class.amf::AMFInterfacePtr_T.1" = type { ptr }
%"class.amf::AMFInterfacePtr_T.2" = type { ptr }

@g_AMFFactory = external global %class.AMFFactoryHelper, align 8
@.str.18 = external hidden unnamed_addr constant [24 x i32], align 4

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z22getAMFdevicePropertiesP17_cl_command_queuePi(ptr noundef %0, ptr nocapture noundef writeonly %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.amf::AMFInterfacePtr_T", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.amf::AMFInterfacePtr_T.1", align 8
  %6 = alloca %"class.amf::AMFInterfacePtr_T.2", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @_ZN3amf17AMFInterfacePtr_TINS_10AMFContextEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  %7 = invoke noundef i32 @_ZN16AMFFactoryHelper4InitEv(ptr noundef nonnull align 8 dereferenceable(80) @g_AMFFactory)
          to label %8 unwind label %19

8:                                                ; preds = %2
  %9 = invoke noundef ptr @_ZN16AMFFactoryHelper10GetFactoryEv(ptr noundef nonnull align 8 dereferenceable(80) @g_AMFFactory)
          to label %10 unwind label %19

10:                                               ; preds = %8
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %.thread, label %11

11:                                               ; preds = %10
  %12 = invoke noundef ptr @_ZN16AMFFactoryHelper10GetFactoryEv(ptr noundef nonnull align 8 dereferenceable(80) @g_AMFFactory)
          to label %13 unwind label %19

13:                                               ; preds = %11
  %14 = invoke noundef ptr @_ZN3amf17AMFInterfacePtr_TINS_10AMFContextEEadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %15 unwind label %19

15:                                               ; preds = %13
  %16 = load ptr, ptr %12, align 8, !tbaa !9
  %17 = load ptr, ptr %16, align 8
  %18 = invoke noundef i32 %17(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %14)
          to label %21 unwind label %19

19:                                               ; preds = %26, %.thread, %15, %13, %11, %8, %2
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %86

21:                                               ; preds = %15
  %22 = icmp eq i32 %18, 0
  br i1 %22, label %.thread, label %85

.thread:                                          ; preds = %10, %21
  %23 = invoke noundef zeroext i1 @_ZN3amf17AMFInterfacePtr_TINS_10AMFContextEEneEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef null)
          to label %24 unwind label %19

24:                                               ; preds = %.thread
  br i1 %23, label %25, label %85

25:                                               ; preds = %24
  %.not21 = icmp eq ptr %0, null
  br i1 %.not21, label %83, label %26

26:                                               ; preds = %25
  %27 = call noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_10AMFContextEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %28, i64 176
  %30 = load ptr, ptr %29, align 8
  %31 = invoke noundef i32 %30(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull %0)
          to label %32 unwind label %19

32:                                               ; preds = %26
  %33 = icmp eq i32 %31, 0
  br i1 %33, label %34, label %83

34:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @_ZN3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %35 = call noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_10AMFContextEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %36 = invoke noundef ptr @_ZN3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEEadEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %37 unwind label %51

37:                                               ; preds = %34
  %38 = load ptr, ptr %35, align 8, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %38, i64 208
  %40 = load ptr, ptr %39, align 8
  %41 = invoke noundef i32 %40(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef %36)
          to label %42 unwind label %51

42:                                               ; preds = %37
  %43 = icmp eq i32 %41, 0
  br i1 %43, label %44, label %.loopexit

44:                                               ; preds = %42
  %45 = call noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds i8, ptr %46, i64 24
  %48 = load ptr, ptr %47, align 8
  %49 = invoke noundef i32 %48(ptr noundef nonnull align 8 dereferenceable(8) %45)
          to label %.preheader unwind label %53

.preheader:                                       ; preds = %44
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph, label %.loopexit

51:                                               ; preds = %37, %34
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %82

53:                                               ; preds = %44
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %82

.lr.ph:                                           ; preds = %.preheader, %80
  %.01328 = phi i32 [ %81, %80 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %55 = call noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %56 = invoke noundef ptr @_ZN3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEEadEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %57 unwind label %.loopexit27

57:                                               ; preds = %.lr.ph
  %58 = load ptr, ptr %55, align 8, !tbaa !9
  %59 = getelementptr inbounds i8, ptr %58, i64 32
  %60 = load ptr, ptr %59, align 8
  %61 = invoke noundef i32 %60(ptr noundef nonnull align 8 dereferenceable(8) %55, i32 noundef %.01328, ptr noundef %56)
          to label %62 unwind label %.loopexit27

62:                                               ; preds = %57
  %63 = call noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_10AMFContextEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = getelementptr inbounds i8, ptr %64, i64 200
  %66 = load ptr, ptr %65, align 8
  %67 = invoke noundef ptr %66(ptr noundef nonnull align 8 dereferenceable(8) %63)
          to label %68 unwind label %.loopexit27

68:                                               ; preds = %62
  %69 = call noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  %71 = getelementptr inbounds i8, ptr %70, i64 112
  %72 = load ptr, ptr %71, align 8
  %73 = invoke noundef ptr %72(ptr noundef nonnull align 8 dereferenceable(8) %69)
          to label %74 unwind label %.loopexit27

74:                                               ; preds = %68
  %.not25 = icmp eq ptr %67, %73
  br i1 %.not25, label %75, label %80

75:                                               ; preds = %74
  %76 = call noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %77 = invoke noundef i32 @_ZNK3amf18AMFPropertyStorage11GetPropertyIiEE10AMF_RESULTPKwPT_(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @.str.18, ptr noundef nonnull %4)
          to label %79 unwind label %.loopexit.split-lp

.loopexit27:                                      ; preds = %.lr.ph, %57, %62, %68
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %78

.loopexit.split-lp:                               ; preds = %75
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %78

78:                                               ; preds = %.loopexit.split-lp, %.loopexit27
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit27 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %82

79:                                               ; preds = %75
  call void @_ZN3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %.loopexit

80:                                               ; preds = %74
  call void @_ZN3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %81 = add nuw nsw i32 %.01328, 1
  %exitcond.not = icmp eq i32 %81, %49
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !11

.loopexit:                                        ; preds = %80, %.preheader, %79, %42
  call void @_ZN3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %.pre = load i32, ptr %4, align 4, !tbaa !5
  br label %83

82:                                               ; preds = %53, %78, %51
  %.pn.pn = phi { ptr, i32 } [ %52, %51 ], [ %lpad.phi, %78 ], [ %54, %53 ]
  call void @_ZN3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %86

83:                                               ; preds = %32, %.loopexit, %25
  %84 = phi i32 [ 0, %32 ], [ %.pre, %.loopexit ], [ 0, %25 ]
  store i32 %84, ptr %1, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %21, %24, %83
  %.014 = phi i1 [ true, %83 ], [ false, %24 ], [ false, %21 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @_ZN3amf17AMFInterfacePtr_TINS_10AMFContextEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret i1 %.014

86:                                               ; preds = %82, %19
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %82 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @_ZN3amf17AMFInterfacePtr_TINS_10AMFContextEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn.pn.pn
}

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

declare noundef i32 @_ZN16AMFFactoryHelper4InitEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

declare noundef ptr @_ZN16AMFFactoryHelper10GetFactoryEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_10AMFContextEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_17AMFComputeFactoryEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3amf17AMFInterfacePtr_TINS_16AMFComputeDeviceEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 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 #4 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass