; LLVM IR from ggml-org/ggml :: tests (test-opt)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ggml_backend_device *, std::allocator<ggml_backend_device *>>::_Vector_impl" }
%"struct.std::_Vector_base<ggml_backend_device *, std::allocator<ggml_backend_device *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ggml_backend_device *, std::allocator<ggml_backend_device *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ggml_backend_device *, std::allocator<ggml_backend_device *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_Vector_impl" }
%"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"class.std::allocator.2" = type { i8 }
%"class.__gnu_cxx::__normal_iterator.5" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@.str = external hidden unnamed_addr constant [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::vector.0", align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::vector.0", align 8
  %13 = alloca %"class.std::initializer_list", align 8
  %14 = alloca [1 x ptr], align 8
  %15 = alloca %"class.std::allocator.2", align 1
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca %"struct.std::pair", align 4
  %25 = alloca ptr, align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  %30 = call i64 @ggml_backend_dev_count()
  store i64 %30, ptr %2, align 8, !tbaa !5
  %31 = load i64, ptr %2, align 8, !tbaa !5
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str, i64 noundef %31)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #8
  call void @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #8
  call void @_ZNSt6vectorIP12ggml_backendSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  store i64 0, ptr %6, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %71, %0
  %34 = load i64, ptr %6, align 8, !tbaa !5
  %35 = load i64, ptr %2, align 8, !tbaa !5
  %36 = icmp ult i64 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %75

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %39 = load i64, ptr %6, align 8, !tbaa !5
  %40 = invoke ptr @ggml_backend_dev_get(i64 noundef %39)
          to label %41 unwind label %52

41:                                               ; preds = %38
  store ptr %40, ptr %7, align 8, !tbaa !9
  invoke void @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %42 unwind label %52

42:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %43 = load i64, ptr %6, align 8, !tbaa !5
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %43) #8
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = invoke ptr @ggml_backend_dev_init(ptr noundef %45, ptr noundef null)
          to label %47 unwind label %56

47:                                               ; preds = %42
  store ptr %46, ptr %10, align 8, !tbaa !9
  %48 = load ptr, ptr %10, align 8, !tbaa !9
  %49 = icmp ne ptr %48, null
  br i1 %49, label %60, label %50

50:                                               ; preds = %47
  invoke void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.1, i32 noundef 841, ptr noundef @.str.2, ptr noundef @.str.3) #9
          to label %51 unwind label %56

51:                                               ; preds = %50
  unreachable

52:                                               ; preds = %41, %38
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %8, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %74

56:                                               ; preds = %69, %64, %60, %50, %42
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %8, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %74

60:                                               ; preds = %47
  %61 = load ptr, ptr %10, align 8, !tbaa !9
  %62 = invoke zeroext i1 @ggml_backend_is_cpu(ptr noundef %61)
          to label %63 unwind label %56

63:                                               ; preds = %60
  br i1 %62, label %64, label %69

64:                                               ; preds = %63
  %65 = load ptr, ptr %10, align 8, !tbaa !9
  %66 = call noundef i32 @_ZNSt6thread20hardware_concurrencyEv() #8
  %67 = udiv i32 %66, 2
  invoke void @ggml_backend_cpu_set_n_threads(ptr noundef %65, i32 noundef %67)
          to label %68 unwind label %56

68:                                               ; preds = %64
  br label %69

69:                                               ; preds = %68, %63
  invoke void @_ZNSt6vectorIP12ggml_backendSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %70 unwind label %56

70:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %71

71:                                               ; preds = %70
  %72 = load i64, ptr %6, align 8, !tbaa !5
  %73 = add i64 %72, 1
  store i64 %73, ptr %6, align 8, !tbaa !5
  br label %33, !llvm.loop !11

74:                                               ; preds = %56, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %248

75:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store i64 0, ptr %11, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %200, %75
  %77 = load i64, ptr %11, align 8, !tbaa !5
  %78 = load i64, ptr %2, align 8, !tbaa !5
  %79 = icmp ult i64 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %207

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %82 = load i64, ptr %11, align 8, !tbaa !5
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %82) #8
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  store ptr %84, ptr %14, align 8, !tbaa !9
  %85 = getelementptr inbounds %"class.std::initializer_list", ptr %13, i32 0, i32 0
  store ptr %14, ptr %85, align 8, !tbaa !13
  %86 = getelementptr inbounds %"class.std::initializer_list", ptr %13, i32 0, i32 1
  store i64 1, ptr %86, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #8
  call void @_ZNSaIP12ggml_backendEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  %87 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8
  %89 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 1
  %90 = load i64, ptr %89, align 8
  invoke void @_ZNSt6vectorIP12ggml_backendSaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr %88, i64 %90, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %91 unwind label %172

91:                                               ; preds = %81
  call void @_ZNSt15__new_allocatorIP12ggml_backendED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %92 = call ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  %93 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKP12ggml_backendSt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  %94 = call ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  %95 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  %96 = call ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  %97 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %96, ptr %97, align 8
  %98 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %16, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8
  %100 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8
  %102 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8
  %104 = invoke ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE6insertIN9__gnu_cxx17__normal_iteratorIPS1_S3_EEvEES8_NS6_IPKS1_S3_EET_SC_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr %99, ptr %101, ptr %103)
          to label %105 unwind label %176

105:                                              ; preds = %91
  %106 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %104, ptr %106, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %107 = call noundef ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  %108 = call noundef i64 @_ZNKSt6vectorIP12ggml_backendSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  %109 = trunc i64 %108 to i32
  %110 = invoke ptr @ggml_backend_sched_new(ptr noundef %107, ptr noundef null, i32 noundef %109, i64 noundef 2048, i1 noundef zeroext false)
          to label %111 unwind label %180

111:                                              ; preds = %105
  store ptr %110, ptr %21, align 8, !tbaa !9
  %112 = load i64, ptr %11, align 8, !tbaa !5
  %113 = add i64 %112, 1
  %114 = load i64, ptr %2, align 8, !tbaa !5
  %115 = load i64, ptr %11, align 8, !tbaa !5
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %115) #8
  %117 = load ptr, ptr %116, align 8, !tbaa !9
  %118 = invoke ptr @ggml_backend_dev_name(ptr noundef %117)
          to label %119 unwind label %180

119:                                              ; preds = %111
  %120 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %113, i64 noundef %114, ptr noundef %118)
          to label %121 unwind label %180

121:                                              ; preds = %119
  %122 = load i64, ptr %11, align 8, !tbaa !5
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %122) #8
  %124 = load ptr, ptr %123, align 8, !tbaa !9
  %125 = invoke ptr @ggml_backend_dev_description(ptr noundef %124)
          to label %126 unwind label %180

126:                                              ; preds = %121
  %127 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef %125)
          to label %128 unwind label %180

128:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %129 = load i64, ptr %11, align 8, !tbaa !5
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %129) #8
  %131 = load ptr, ptr %130, align 8, !tbaa !9
  invoke void @ggml_backend_dev_memory(ptr noundef %131, ptr noundef %22, ptr noundef %23)
          to label %132 unwind label %184

132:                                              ; preds = %128
  %133 = load i64, ptr %23, align 8, !tbaa !5
  %134 = udiv i64 %133, 1024
  %135 = udiv i64 %134, 1024
  %136 = load i64, ptr %22, align 8, !tbaa !5
  %137 = udiv i64 %136, 1024
  %138 = udiv i64 %137, 1024
  %139 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.6, i64 noundef %135, i64 noundef %138)
          to label %140 unwind label %184

140:                                              ; preds = %132
  %141 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.7)
          to label %142 unwind label %184

142:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %143 = load ptr, ptr %21, align 8, !tbaa !9
  %144 = load i64, ptr %11, align 8, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %144) #8
  %146 = load ptr, ptr %145, align 8, !tbaa !9
  %147 = invoke i64 @_ZL12test_backendP18ggml_backend_schedP12ggml_backend(ptr noundef %143, ptr noundef %146)
          to label %148 unwind label %188

148:                                              ; preds = %142
  store i64 %147, ptr %24, align 4
  %149 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 0
  %150 = load i32, ptr %149, align 4, !tbaa !16
  %151 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 1
  %152 = load i32, ptr %151, align 4, !tbaa !19
  %153 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %150, i32 noundef %152)
          to label %154 unwind label %188

154:                                              ; preds = %148
  %155 = load i64, ptr %11, align 8, !tbaa !5
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %155) #8
  %157 = load ptr, ptr %156, align 8, !tbaa !9
  %158 = invoke ptr @ggml_backend_name(ptr noundef %157)
          to label %159 unwind label %188

159:                                              ; preds = %154
  %160 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %158)
          to label %161 unwind label %188

161:                                              ; preds = %159
  %162 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 0
  %163 = load i32, ptr %162, align 4, !tbaa !16
  %164 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 1
  %165 = load i32, ptr %164, align 4, !tbaa !19
  %166 = icmp eq i32 %163, %165
  br i1 %166, label %167, label %192

167:                                              ; preds = %161
  %168 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.10)
          to label %169 unwind label %188

169:                                              ; preds = %167
  %170 = load i64, ptr %3, align 8, !tbaa !5
  %171 = add i64 %170, 1
  store i64 %171, ptr %3, align 8, !tbaa !5
  br label %195

172:                                              ; preds = %81
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %8, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %9, align 4
  call void @_ZNSt15__new_allocatorIP12ggml_backendED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %206

176:                                              ; preds = %91
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %8, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %205

180:                                              ; preds = %126, %121, %119, %111, %105
  %181 = landingpad { ptr, i32 }
          cleanup
  %182 = extractvalue { ptr, i32 } %181, 0
  store ptr %182, ptr %8, align 8
  %183 = extractvalue { ptr, i32 } %181, 1
  store i32 %183, ptr %9, align 4
  br label %204

184:                                              ; preds = %140, %132, %128
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %8, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %9, align 4
  br label %203

188:                                              ; preds = %197, %195, %192, %167, %159, %154, %148, %142
  %189 = landingpad { ptr, i32 }
          cleanup
  %190 = extractvalue { ptr, i32 } %189, 0
  store ptr %190, ptr %8, align 8
  %191 = extractvalue { ptr, i32 } %189, 1
  store i32 %191, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  br label %203

192:                                              ; preds = %161
  %193 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.11)
          to label %194 unwind label %188

194:                                              ; preds = %192
  br label %195

195:                                              ; preds = %194, %169
  %196 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.7)
          to label %197 unwind label %188

197:                                              ; preds = %195
  %198 = load ptr, ptr %21, align 8, !tbaa !9
  invoke void @ggml_backend_sched_free(ptr noundef %198)
          to label %199 unwind label %188

199:                                              ; preds = %197
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @_ZNSt6vectorIP12ggml_backendSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #8
  br label %200

200:                                              ; preds = %199
  %201 = load i64, ptr %11, align 8, !tbaa !5
  %202 = add i64 %201, 1
  store i64 %202, ptr %11, align 8, !tbaa !5
  br label %76, !llvm.loop !20

203:                                              ; preds = %188, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %204

204:                                              ; preds = %203, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  br label %205

205:                                              ; preds = %204, %176
  call void @_ZNSt6vectorIP12ggml_backendSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  br label %206

206:                                              ; preds = %205, %172
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %248

207:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  store ptr %5, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %208 = load ptr, ptr %25, align 8, !tbaa !9
  %209 = call ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %208) #8
  %210 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %209, ptr %210, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %211 = load ptr, ptr %25, align 8, !tbaa !9
  %212 = call ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %211) #8
  %213 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  store ptr %212, ptr %213, align 8
  br label %214

214:                                              ; preds = %222, %207
  %215 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ggml_backendSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  br i1 %215, label %217, label %216

216:                                              ; preds = %214
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %228

217:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %218 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP12ggml_backendSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  %219 = load ptr, ptr %218, align 8, !tbaa !9
  store ptr %219, ptr %28, align 8, !tbaa !9
  %220 = load ptr, ptr %28, align 8, !tbaa !9
  invoke void @ggml_backend_free(ptr noundef %220)
          to label %221 unwind label %224

221:                                              ; preds = %217
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  br label %222

222:                                              ; preds = %221
  %223 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP12ggml_backendSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  br label %214

224:                                              ; preds = %217
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %8, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %248

228:                                              ; preds = %216
  %229 = load i64, ptr %3, align 8, !tbaa !5
  %230 = load i64, ptr %2, align 8, !tbaa !5
  %231 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.12, i64 noundef %229, i64 noundef %230)
          to label %232 unwind label %239

232:                                              ; preds = %228
  %233 = load i64, ptr %3, align 8, !tbaa !5
  %234 = load i64, ptr %2, align 8, !tbaa !5
  %235 = icmp ne i64 %233, %234
  br i1 %235, label %236, label %243

236:                                              ; preds = %232
  %237 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.11)
          to label %238 unwind label %239

238:                                              ; preds = %236
  store i32 1, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %246

239:                                              ; preds = %243, %236, %228
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %8, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %9, align 4
  br label %248

243:                                              ; preds = %232
  %244 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.10)
          to label %245 unwind label %239

245:                                              ; preds = %243
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %246

246:                                              ; preds = %245, %238
  call void @_ZNSt6vectorIP12ggml_backendSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #8
  call void @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  %247 = load i32, ptr %1, align 4
  ret i32 %247

248:                                              ; preds = %239, %224, %206, %74
  call void @_ZNSt6vectorIP12ggml_backendSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #8
  call void @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %249

249:                                              ; preds = %248
  %250 = load ptr, ptr %8, align 8
  %251 = load i32, ptr %9, align 4
  %252 = insertvalue { ptr, i32 } poison, ptr %250, 0
  %253 = insertvalue { ptr, i32 } %252, i32 %251, 1
  resume { ptr, i32 } %253
}

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

declare i64 @ggml_backend_dev_count() #2

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

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

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

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

declare ptr @ggml_backend_dev_get(i64 noundef) #2

declare i32 @__gxx_personality_v0(...)

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

declare ptr @ggml_backend_dev_init(ptr noundef, ptr noundef) #2

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

; Function Attrs: noreturn
declare void @ggml_abort(ptr noundef, i32 noundef, ptr noundef, ...) #5

declare zeroext i1 @ggml_backend_is_cpu(ptr noundef) #2

declare void @ggml_backend_cpu_set_n_threads(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind
declare noundef i32 @_ZNSt6thread20hardware_concurrencyEv() #6

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

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

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

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

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

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

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

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

declare ptr @ggml_backend_sched_new(ptr noundef, ptr noundef, i32 noundef, i64 noundef, i1 noundef zeroext) #2

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

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

declare ptr @ggml_backend_dev_name(ptr noundef) #2

declare ptr @ggml_backend_dev_description(ptr noundef) #2

declare void @ggml_backend_dev_memory(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden i64 @_ZL12test_backendP18ggml_backend_schedP12ggml_backend(ptr noundef, ptr noundef) #4

declare ptr @ggml_backend_name(ptr noundef) #2

declare void @ggml_backend_sched_free(ptr noundef) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ggml_backendSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #7

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

declare void @ggml_backend_free(ptr noundef) #2

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint 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 #8 = { nounwind }
attributes #9 = { noreturn }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSSt16initializer_listIP12ggml_backendE", !10, i64 0, !6, i64 8}
!15 = !{!14, !6, i64 8}
!16 = !{!17, !18, i64 0}
!17 = !{!"_ZTSSt4pairIiiE", !18, i64 0, !18, i64 4}
!18 = !{!"int", !7, i64 0}
!19 = !{!17, !18, i64 4}
!20 = distinct !{!20, !12}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ggml_backend_device *, std::allocator<ggml_backend_device *>>::_Vector_impl" }
%"struct.std::_Vector_base<ggml_backend_device *, std::allocator<ggml_backend_device *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ggml_backend_device *, std::allocator<ggml_backend_device *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ggml_backend_device *, std::allocator<ggml_backend_device *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_Vector_impl" }
%"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.2" = type { i8 }
%"class.__gnu_cxx::__normal_iterator.5" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca %"class.std::vector.0", align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::vector.0", align 8
  %6 = alloca [1 x ptr], align 8
  %7 = alloca %"class.std::allocator.2", align 1
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = tail call i64 @ggml_backend_dev_count()
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %14)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #9
  call void @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #9
  call void @_ZNSt6vectorIP12ggml_backendSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  %.not68 = icmp eq i64 %14, 0
  br i1 %.not68, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %36
  %.03661 = phi i64 [ %37, %36 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  %16 = invoke ptr @ggml_backend_dev_get(i64 noundef %.03661)
          to label %17 unwind label %25

17:                                               ; preds = %.lr.ph
  store ptr %16, ptr %3, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %18 unwind label %25

18:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.03661) #9
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = invoke ptr @ggml_backend_dev_init(ptr noundef %20, ptr noundef null)
          to label %22 unwind label %.loopexit

22:                                               ; preds = %18
  store ptr %21, ptr %4, align 8, !tbaa !5
  %.not52 = icmp eq ptr %21, null
  br i1 %.not52, label %23, label %28

23:                                               ; preds = %22
  invoke void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.1, i32 noundef 841, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3) #10
          to label %24 unwind label %.loopexit.split-lp

24:                                               ; preds = %23
  unreachable

25:                                               ; preds = %17, %.lr.ph
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  br label %116

.loopexit:                                        ; preds = %18, %28, %31, %35
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %27

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

27:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  br label %116

28:                                               ; preds = %22
  %29 = invoke zeroext i1 @ggml_backend_is_cpu(ptr noundef nonnull %21)
          to label %30 unwind label %.loopexit

30:                                               ; preds = %28
  br i1 %29, label %31, label %35

31:                                               ; preds = %30
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = call noundef i32 @_ZNSt6thread20hardware_concurrencyEv() #9
  %34 = lshr i32 %33, 1
  invoke void @ggml_backend_cpu_set_n_threads(ptr noundef %32, i32 noundef %34)
          to label %35 unwind label %.loopexit

35:                                               ; preds = %31, %30
  invoke void @_ZNSt6vectorIP12ggml_backendSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %36 unwind label %.loopexit

36:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  %37 = add nuw i64 %.03661, 1
  %exitcond.not = icmp eq i64 %37, %14
  br i1 %exitcond.not, label %.lr.ph64, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %103, %0
  %.035.lcssa = phi i64 [ 0, %0 ], [ %.1, %103 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  %38 = call ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  store ptr %38, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  %39 = call ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  store ptr %39, ptr %13, align 8
  %40 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ggml_backendSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #9
  br i1 %40, label %.lr.ph66, label %._crit_edge67

.lr.ph64:                                         ; preds = %36, %103
  %.03563 = phi i64 [ %.1, %103 ], [ 0, %36 ]
  %.04562 = phi i64 [ %55, %103 ], [ 0, %36 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04562) #9
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  store ptr %42, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #9
  call void @_ZNSaIP12ggml_backendEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #9
  invoke void @_ZNSt6vectorIP12ggml_backendSaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr nonnull %6, i64 1, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %43 unwind label %89

43:                                               ; preds = %.lr.ph64
  call void @_ZNSt15__new_allocatorIP12ggml_backendED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %44 = call ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  store ptr %44, ptr %9, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKP12ggml_backendSt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  %45 = call ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  %46 = call ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  %47 = load ptr, ptr %8, align 8
  %48 = invoke ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE6insertIN9__gnu_cxx17__normal_iteratorIPS1_S3_EEvEES8_NS6_IPKS1_S3_EET_SC_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr %47, ptr %45, ptr %46)
          to label %49 unwind label %91

49:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  %50 = call noundef ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  %51 = call noundef i64 @_ZNKSt6vectorIP12ggml_backendSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  %52 = trunc i64 %51 to i32
  %53 = invoke ptr @ggml_backend_sched_new(ptr noundef %50, ptr noundef null, i32 noundef %52, i64 noundef 2048, i1 noundef zeroext false)
          to label %54 unwind label %93

54:                                               ; preds = %49
  %55 = add nuw i64 %.04562, 1
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.04562) #9
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = invoke ptr @ggml_backend_dev_name(ptr noundef %57)
          to label %59 unwind label %93

59:                                               ; preds = %54
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %55, i64 noundef %14, ptr noundef %58)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.04562) #9
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = invoke ptr @ggml_backend_dev_description(ptr noundef %62)
          to label %64 unwind label %93

64:                                               ; preds = %59
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef %63)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.04562) #9
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  invoke void @ggml_backend_dev_memory(ptr noundef %67, ptr noundef nonnull %10, ptr noundef nonnull %11)
          to label %68 unwind label %95

68:                                               ; preds = %64
  %69 = load i64, ptr %11, align 8, !tbaa !11
  %70 = lshr i64 %69, 20
  %71 = load i64, ptr %10, align 8, !tbaa !11
  %72 = lshr i64 %71, 20
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %70, i64 noundef %72)
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04562) #9
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  %77 = invoke i64 @_ZL12test_backendP18ggml_backend_schedP12ggml_backend(ptr noundef %53, ptr noundef %76)
          to label %78 unwind label %97

78:                                               ; preds = %68
  %.sroa.0.0.extract.trunc = trunc i64 %77 to i32
  %.sroa.6.0.extract.shift = lshr i64 %77, 32
  %.sroa.6.0.extract.trunc = trunc nuw i64 %.sroa.6.0.extract.shift to i32
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %.sroa.0.0.extract.trunc, i32 noundef %.sroa.6.0.extract.trunc)
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP12ggml_backendSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04562) #9
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = invoke ptr @ggml_backend_name(ptr noundef %81)
          to label %83 unwind label %97

83:                                               ; preds = %78
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef %82)
  %85 = icmp eq i32 %.sroa.0.0.extract.trunc, %.sroa.6.0.extract.trunc
  br i1 %85, label %86, label %99

86:                                               ; preds = %83
  %87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %88 = add i64 %.03563, 1
  br label %101

89:                                               ; preds = %.lr.ph64
  %90 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIP12ggml_backendED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  br label %106

91:                                               ; preds = %43
  %92 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %105

93:                                               ; preds = %59, %54, %49
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %105

95:                                               ; preds = %64
  %96 = landingpad { ptr, i32 }
          cleanup
  br label %104

97:                                               ; preds = %101, %78, %68
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %104

99:                                               ; preds = %83
  %100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  br label %101

101:                                              ; preds = %99, %86
  %.1 = phi i64 [ %88, %86 ], [ %.03563, %99 ]
  %102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  invoke void @ggml_backend_sched_free(ptr noundef %53)
          to label %103 unwind label %97

103:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @_ZNSt6vectorIP12ggml_backendSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  %exitcond70.not = icmp eq i64 %55, %14
  br i1 %exitcond70.not, label %._crit_edge, label %.lr.ph64, !llvm.loop !13

104:                                              ; preds = %97, %95
  %.pn = phi { ptr, i32 } [ %98, %97 ], [ %96, %95 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  br label %105

105:                                              ; preds = %93, %104, %91
  %.pn.pn.pn = phi { ptr, i32 } [ %92, %91 ], [ %.pn, %104 ], [ %94, %93 ]
  call void @_ZNSt6vectorIP12ggml_backendSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  br label %106

106:                                              ; preds = %105, %89
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %105 ], [ %90, %89 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  br label %116

._crit_edge67:                                    ; preds = %111, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  %107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i64 noundef %.035.lcssa, i64 noundef %14)
  %.not = icmp ne i64 %.035.lcssa, %14
  %.str.10..str.11 = select i1 %.not, ptr @.str.11, ptr @.str.10
  %. = zext i1 %.not to i32
  %108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.10..str.11)
  call void @_ZNSt6vectorIP12ggml_backendSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #9
  call void @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #9
  ret i32 %.

.lr.ph66:                                         ; preds = %._crit_edge, %111
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP12ggml_backendSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #9
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  invoke void @ggml_backend_free(ptr noundef %110)
          to label %111 unwind label %114

111:                                              ; preds = %.lr.ph66
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP12ggml_backendSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #9
  %113 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ggml_backendSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #9
  br i1 %113, label %.lr.ph66, label %._crit_edge67

114:                                              ; preds = %.lr.ph66
  %115 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  br label %116

116:                                              ; preds = %25, %27, %114, %106
  %.pn53.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %106 ], [ %115, %114 ], [ %lpad.phi, %27 ], [ %26, %25 ]
  call void @_ZNSt6vectorIP12ggml_backendSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #9
  call void @_ZNSt6vectorIP19ggml_backend_deviceSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn53.pn
}

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

declare i64 @ggml_backend_dev_count() local_unnamed_addr #2

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

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

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

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

declare ptr @ggml_backend_dev_get(i64 noundef) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

declare ptr @ggml_backend_dev_init(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: noreturn
declare void @ggml_abort(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #6

declare zeroext i1 @ggml_backend_is_cpu(ptr noundef) local_unnamed_addr #2

declare void @ggml_backend_cpu_set_n_threads(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare noundef i32 @_ZNSt6thread20hardware_concurrencyEv() local_unnamed_addr #7

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

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

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

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

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

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

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

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

declare ptr @ggml_backend_sched_new(ptr noundef, ptr noundef, i32 noundef, i64 noundef, i1 noundef zeroext) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIP12ggml_backendSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

declare ptr @ggml_backend_dev_name(ptr noundef) local_unnamed_addr #2

declare ptr @ggml_backend_dev_description(ptr noundef) local_unnamed_addr #2

declare void @ggml_backend_dev_memory(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden i64 @_ZL12test_backendP18ggml_backend_schedP12ggml_backend(ptr noundef, ptr noundef) local_unnamed_addr #5

declare ptr @ggml_backend_name(ptr noundef) local_unnamed_addr #2

declare void @ggml_backend_sched_free(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ggml_backendSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #8

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

declare void @ggml_backend_free(ptr noundef) local_unnamed_addr #2

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { inlinehint 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 #9 = { nounwind }
attributes #10 = { noreturn }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass