; LLVM IR from ggml-org/ggml :: examples/yolo (yolov3-tiny)

; 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"

%struct.yolo_model = type { i32, i32, %"class.std::vector.5", ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<conv2d_layer, std::allocator<conv2d_layer>>::_Vector_impl" }
%"struct.std::_Vector_base<conv2d_layer, std::allocator<conv2d_layer>>::_Vector_impl" = type { %"struct.std::_Vector_base<conv2d_layer, std::allocator<conv2d_layer>>::_Vector_impl_data" }
%"struct.std::_Vector_base<conv2d_layer, std::allocator<conv2d_layer>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.yolo_params = type { float, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.yolo_image = type { i32, i32, i32, %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.16" = type { %"struct.std::_Vector_base.17" }
%"struct.std::_Vector_base.17" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.21" = type { %"struct.std::_Vector_base.22" }
%"struct.std::_Vector_base.22" = type { %"struct.std::_Vector_base<yolo_image, std::allocator<yolo_image>>::_Vector_impl" }
%"struct.std::_Vector_base<yolo_image, std::allocator<yolo_image>>::_Vector_impl" = type { %"struct.std::_Vector_base<yolo_image, std::allocator<yolo_image>>::_Vector_impl_data" }
%"struct.std::_Vector_base<yolo_image, std::allocator<yolo_image>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.ggml_init_params = type { i64, ptr, i8 }

@stderr = external global ptr, align 8
@.str.27 = external hidden unnamed_addr constant [36 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [48 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6detectR10yolo_imageP11ggml_cgraphRK10yolo_modelfRKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISC_EERKS6_IS_SaIS_EE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, ptr noundef nonnull align 8 dereferenceable(56), float noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z17yolo_params_parseiPPcR11yolo_params(i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(104)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #6 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.yolo_model, align 8
  %7 = alloca %struct.yolo_params, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.yolo_image, align 8
  %12 = alloca %"class.std::vector.16", align 8
  %13 = alloca %"class.std::vector.21", align 8
  %14 = alloca %struct.ggml_init_params, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %struct.ggml_init_params, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @ggml_time_init()
  call void @llvm.lifetime.start.p0(i64 56, ptr %6) #9
  call void @_ZN10yolo_modelC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #9
  call void @llvm.lifetime.start.p0(i64 104, ptr %7) #9
  invoke void @_ZN11yolo_paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(104) %7)
          to label %21 unwind label %27

21:                                               ; preds = %2
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = invoke noundef zeroext i1 @_Z17yolo_params_parseiPPcR11yolo_params(i32 noundef %22, ptr noundef %23, ptr noundef nonnull align 8 dereferenceable(104) %7)
          to label %25 unwind label %31

25:                                               ; preds = %21
  br i1 %24, label %35, label %26

26:                                               ; preds = %25
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %186

27:                                               ; preds = %2
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %8, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %9, align 4
  br label %189

31:                                               ; preds = %35, %21
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %8, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %9, align 4
  br label %188

35:                                               ; preds = %25
  %36 = getelementptr inbounds %struct.yolo_params, ptr %7, i32 0, i32 1
  %37 = invoke noundef zeroext i1 @_ZL10load_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10yolo_model(ptr noundef nonnull align 8 dereferenceable(32) %36, ptr noundef nonnull align 8 dereferenceable(56) %6)
          to label %38 unwind label %31

38:                                               ; preds = %35
  br i1 %37, label %44, label %39

39:                                               ; preds = %38
  %40 = load ptr, ptr @stderr, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct.yolo_params, ptr %7, i32 0, i32 1
  %42 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %41) #9
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str.27, ptr noundef @__func__.main, ptr noundef %42) #9
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %186

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 40, ptr %11) #9
  invoke void @_ZN10yolo_imageC2Eiii(ptr noundef nonnull align 8 dereferenceable(40) %11, i32 noundef 0, i32 noundef 0, i32 noundef 0)
          to label %45 unwind label %55

45:                                               ; preds = %44
  %46 = getelementptr inbounds %struct.yolo_params, ptr %7, i32 0, i32 2
  %47 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %46) #9
  %48 = invoke noundef zeroext i1 @_Z10load_imagePKcR10yolo_image(ptr noundef %47, ptr noundef nonnull align 8 dereferenceable(40) %11)
          to label %49 unwind label %59

49:                                               ; preds = %45
  br i1 %48, label %63, label %50

50:                                               ; preds = %49
  %51 = load ptr, ptr @stderr, align 8, !tbaa !9
  %52 = getelementptr inbounds %struct.yolo_params, ptr %7, i32 0, i32 2
  %53 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %52) #9
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef @.str.28, ptr noundef @__func__.main, ptr noundef %53) #9
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %183

55:                                               ; preds = %44
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %8, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %9, align 4
  br label %185

59:                                               ; preds = %45
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %8, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %9, align 4
  br label %184

63:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #9
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #9
  %64 = invoke noundef zeroext i1 @_ZL11load_labelsPKcRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE(ptr noundef @.str.29, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %65 unwind label %69

65:                                               ; preds = %63
  br i1 %64, label %73, label %66

66:                                               ; preds = %65
  %67 = load ptr, ptr @stderr, align 8, !tbaa !9
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef @.str.30, ptr noundef @__func__.main) #9
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %181

69:                                               ; preds = %63
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %8, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %9, align 4
  br label %182

73:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #9
  call void @_ZNSt6vectorI10yolo_imageSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  %74 = invoke noundef zeroext i1 @_ZL13load_alphabetRSt6vectorI10yolo_imageSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %75 unwind label %79

75:                                               ; preds = %73
  br i1 %74, label %83, label %76

76:                                               ; preds = %75
  %77 = load ptr, ptr @stderr, align 8, !tbaa !9
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.31, ptr noundef @__func__.main) #9
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %179

79:                                               ; preds = %73
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %8, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %9, align 4
  br label %180

83:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #9
  %84 = getelementptr inbounds %struct.ggml_init_params, ptr %14, i32 0, i32 0
  %85 = invoke i64 @ggml_tensor_overhead()
          to label %86 unwind label %127

86:                                               ; preds = %83
  %87 = mul i64 %85, 2048
  %88 = invoke i64 @ggml_graph_overhead()
          to label %89 unwind label %127

89:                                               ; preds = %86
  %90 = add i64 %87, %88
  store i64 %90, ptr %84, align 8, !tbaa !11
  %91 = getelementptr inbounds %struct.ggml_init_params, ptr %14, i32 0, i32 1
  store ptr null, ptr %91, align 8, !tbaa !15
  %92 = getelementptr inbounds %struct.ggml_init_params, ptr %14, i32 0, i32 2
  store i8 1, ptr %92, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %14, i64 24, i1 false), !tbaa.struct !17
  %93 = invoke ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8 %16)
          to label %94 unwind label %131

94:                                               ; preds = %89
  store ptr %93, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  %95 = load ptr, ptr %15, align 8, !tbaa !9
  %96 = invoke noundef ptr @_ZL11build_graphP12ggml_contextRK10yolo_model(ptr noundef %95, ptr noundef nonnull align 8 dereferenceable(56) %6)
          to label %97 unwind label %135

97:                                               ; preds = %94
  store ptr %96, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %98 = getelementptr inbounds %struct.yolo_model, ptr %6, i32 0, i32 3
  %99 = load ptr, ptr %98, align 8, !tbaa !20
  %100 = invoke ptr @ggml_backend_get_default_buffer_type(ptr noundef %99)
          to label %101 unwind label %139

101:                                              ; preds = %97
  %102 = invoke ptr @ggml_gallocr_new(ptr noundef %100)
          to label %103 unwind label %139

103:                                              ; preds = %101
  store ptr %102, ptr %18, align 8, !tbaa !9
  %104 = load ptr, ptr %18, align 8, !tbaa !9
  %105 = load ptr, ptr %17, align 8, !tbaa !9
  %106 = invoke zeroext i1 @ggml_gallocr_alloc_graph(ptr noundef %104, ptr noundef %105)
          to label %107 unwind label %139

107:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %108 = invoke i64 @ggml_time_ms()
          to label %109 unwind label %143

109:                                              ; preds = %107
  store i64 %108, ptr %19, align 8, !tbaa !18
  %110 = load ptr, ptr %17, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.yolo_params, ptr %7, i32 0, i32 0
  %112 = load float, ptr %111, align 8, !tbaa !26
  invoke void @_Z6detectR10yolo_imageP11ggml_cgraphRK10yolo_modelfRKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISC_EERKS6_IS_SaIS_EE(ptr noundef nonnull align 8 dereferenceable(40) %11, ptr noundef %110, ptr noundef nonnull align 8 dereferenceable(56) %6, float noundef %112, ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %113 unwind label %143

113:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  %114 = invoke i64 @ggml_time_ms()
          to label %115 unwind label %147

115:                                              ; preds = %113
  %116 = load i64, ptr %19, align 8, !tbaa !18
  %117 = sub nsw i64 %114, %116
  store i64 %117, ptr %20, align 8, !tbaa !18
  %118 = getelementptr inbounds %struct.yolo_params, ptr %7, i32 0, i32 3
  %119 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %118) #9
  %120 = invoke noundef zeroext i1 @_Z10save_imageRK10yolo_imagePKci(ptr noundef nonnull align 8 dereferenceable(40) %11, ptr noundef %119, i32 noundef 80)
          to label %121 unwind label %147

121:                                              ; preds = %115
  br i1 %120, label %151, label %122

122:                                              ; preds = %121
  %123 = load ptr, ptr @stderr, align 8, !tbaa !9
  %124 = getelementptr inbounds %struct.yolo_params, ptr %7, i32 0, i32 3
  %125 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %124) #9
  %126 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef @.str.32, ptr noundef @__func__.main, ptr noundef %125) #9
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %173

127:                                              ; preds = %86, %83
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %8, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %9, align 4
  br label %178

131:                                              ; preds = %89
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %8, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %9, align 4
  br label %177

135:                                              ; preds = %94
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %8, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %9, align 4
  br label %176

139:                                              ; preds = %103, %101, %97
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %8, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %9, align 4
  br label %175

143:                                              ; preds = %109, %107
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %8, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %9, align 4
  br label %174

147:                                              ; preds = %169, %166, %163, %161, %159, %151, %115, %113
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %8, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  br label %174

151:                                              ; preds = %121
  %152 = getelementptr inbounds %struct.yolo_params, ptr %7, i32 0, i32 3
  %153 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %152) #9
  %154 = load i64, ptr %20, align 8, !tbaa !18
  %155 = sitofp i64 %154 to float
  %156 = fdiv float %155, 1.000000e+03
  %157 = fpext float %156 to double
  %158 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.33, ptr noundef %153, double noundef %157)
          to label %159 unwind label %147

159:                                              ; preds = %151
  %160 = load ptr, ptr %15, align 8, !tbaa !9
  invoke void @ggml_free(ptr noundef %160)
          to label %161 unwind label %147

161:                                              ; preds = %159
  %162 = load ptr, ptr %18, align 8, !tbaa !9
  invoke void @ggml_gallocr_free(ptr noundef %162)
          to label %163 unwind label %147

163:                                              ; preds = %161
  %164 = getelementptr inbounds %struct.yolo_model, ptr %6, i32 0, i32 5
  %165 = load ptr, ptr %164, align 8, !tbaa !31
  invoke void @ggml_free(ptr noundef %165)
          to label %166 unwind label %147

166:                                              ; preds = %163
  %167 = getelementptr inbounds %struct.yolo_model, ptr %6, i32 0, i32 4
  %168 = load ptr, ptr %167, align 8, !tbaa !32
  invoke void @ggml_backend_buffer_free(ptr noundef %168)
          to label %169 unwind label %147

169:                                              ; preds = %166
  %170 = getelementptr inbounds %struct.yolo_model, ptr %6, i32 0, i32 3
  %171 = load ptr, ptr %170, align 8, !tbaa !20
  invoke void @ggml_backend_free(ptr noundef %171)
          to label %172 unwind label %147

172:                                              ; preds = %169
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %173

173:                                              ; preds = %172, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #9
  br label %179

174:                                              ; preds = %147, %143
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  br label %175

175:                                              ; preds = %174, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  br label %176

176:                                              ; preds = %175, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %177

177:                                              ; preds = %176, %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  br label %178

178:                                              ; preds = %177, %127
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #9
  br label %180

179:                                              ; preds = %173, %76
  call void @_ZNSt6vectorI10yolo_imageSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #9
  br label %181

180:                                              ; preds = %178, %79
  call void @_ZNSt6vectorI10yolo_imageSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #9
  br label %182

181:                                              ; preds = %179, %66
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #9
  br label %183

182:                                              ; preds = %180, %69
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #9
  br label %184

183:                                              ; preds = %181, %50
  call void @_ZN10yolo_imageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #9
  br label %186

184:                                              ; preds = %182, %59
  call void @_ZN10yolo_imageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #9
  br label %185

185:                                              ; preds = %184, %55
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #9
  br label %188

186:                                              ; preds = %183, %39, %26
  call void @_ZN11yolo_paramsD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %7) #9
  call void @llvm.lifetime.end.p0(i64 104, ptr %7) #9
  call void @_ZN10yolo_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #9
  %187 = load i32, ptr %3, align 4
  ret i32 %187

188:                                              ; preds = %185, %31
  call void @_ZN11yolo_paramsD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %7) #9
  br label %189

189:                                              ; preds = %188, %27
  call void @llvm.lifetime.end.p0(i64 104, ptr %7) #9
  call void @_ZN10yolo_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #9
  br label %190

190:                                              ; preds = %189
  %191 = load ptr, ptr %8, align 8
  %192 = load i32, ptr %9, align 4
  %193 = insertvalue { ptr, i32 } poison, ptr %191, 0
  %194 = insertvalue { ptr, i32 } %193, i32 %192, 1
  resume { ptr, i32 } %194
}

declare void @ggml_time_init() #7

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN11yolo_paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(104)) unnamed_addr #8 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZL10load_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10yolo_model(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(56)) #0

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

declare noundef zeroext i1 @_Z10load_imagePKcR10yolo_image(ptr noundef, ptr noundef nonnull align 8 dereferenceable(40)) #7

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

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZL11load_labelsPKcRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) #0

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

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZL13load_alphabetRSt6vectorI10yolo_imageSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24)) #0

declare i64 @ggml_tensor_overhead() #7

declare i64 @ggml_graph_overhead() #7

declare ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8) #7

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL11build_graphP12ggml_contextRK10yolo_model(ptr noundef, ptr noundef nonnull align 8 dereferenceable(56)) #0

declare ptr @ggml_gallocr_new(ptr noundef) #7

declare ptr @ggml_backend_get_default_buffer_type(ptr noundef) #7

declare zeroext i1 @ggml_gallocr_alloc_graph(ptr noundef, ptr noundef) #7

declare i64 @ggml_time_ms() #7

declare noundef zeroext i1 @_Z10save_imageRK10yolo_imagePKci(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i32 noundef) #7

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

declare void @ggml_free(ptr noundef) #7

declare void @ggml_gallocr_free(ptr noundef) #7

declare void @ggml_backend_buffer_free(ptr noundef) #7

declare void @ggml_backend_free(ptr noundef) #7

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS16ggml_init_params", !13, i64 0, !10, i64 8, !14, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!12, !10, i64 8}
!16 = !{!12, !14, i64 16}
!17 = !{i64 0, i64 8, !18, i64 8, i64 8, !9, i64 16, i64 1, !19}
!18 = !{!13, !13, i64 0}
!19 = !{!14, !14, i64 0}
!20 = !{!21, !10, i64 32}
!21 = !{!"_ZTS10yolo_model", !6, i64 0, !6, i64 4, !22, i64 8, !10, i64 32, !10, i64 40, !10, i64 48}
!22 = !{!"_ZTSSt6vectorI12conv2d_layerSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseI12conv2d_layerSaIS0_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI12conv2d_layerSaIS0_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseI12conv2d_layerSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!26 = !{!27, !28, i64 0}
!27 = !{!"_ZTS11yolo_params", !28, i64 0, !29, i64 8, !29, i64 40, !29, i64 72}
!28 = !{!"float", !7, i64 0}
!29 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !30, i64 0, !13, i64 8, !7, i64 16}
!30 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !10, i64 0}
!31 = !{!21, !10, i64 48}
!32 = !{!21, !10, i64 40}


; 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"

%struct.yolo_model = type { i32, i32, %"class.std::vector.5", ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<conv2d_layer, std::allocator<conv2d_layer>>::_Vector_impl" }
%"struct.std::_Vector_base<conv2d_layer, std::allocator<conv2d_layer>>::_Vector_impl" = type { %"struct.std::_Vector_base<conv2d_layer, std::allocator<conv2d_layer>>::_Vector_impl_data" }
%"struct.std::_Vector_base<conv2d_layer, std::allocator<conv2d_layer>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.yolo_params = type { float, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.yolo_image = type { i32, i32, i32, %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.16" = type { %"struct.std::_Vector_base.17" }
%"struct.std::_Vector_base.17" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.21" = type { %"struct.std::_Vector_base.22" }
%"struct.std::_Vector_base.22" = type { %"struct.std::_Vector_base<yolo_image, std::allocator<yolo_image>>::_Vector_impl" }
%"struct.std::_Vector_base<yolo_image, std::allocator<yolo_image>>::_Vector_impl" = type { %"struct.std::_Vector_base<yolo_image, std::allocator<yolo_image>>::_Vector_impl_data" }
%"struct.std::_Vector_base<yolo_image, std::allocator<yolo_image>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.ggml_init_params = type { i64, ptr, i8 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.27 = external hidden unnamed_addr constant [36 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [48 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6detectR10yolo_imageP11ggml_cgraphRK10yolo_modelfRKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISC_EERKS6_IS_SaIS_EE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, ptr noundef nonnull align 8 dereferenceable(56), float noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z17yolo_params_parseiPPcR11yolo_params(i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %3 = alloca %struct.yolo_model, align 8
  %4 = alloca %struct.yolo_params, align 8
  %5 = alloca %struct.yolo_image, align 8
  %6 = alloca %"class.std::vector.16", align 8
  %7 = alloca %"class.std::vector.21", align 8
  %8 = alloca %struct.ggml_init_params, align 8
  tail call void @ggml_time_init()
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #8
  call void @_ZN10yolo_modelC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #8
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %4) #8
  invoke void @_ZN11yolo_paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(104) %4)
          to label %9 unwind label %12

9:                                                ; preds = %2
  %10 = invoke noundef zeroext i1 @_Z17yolo_params_parseiPPcR11yolo_params(i32 noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(104) %4)
          to label %11 unwind label %14

11:                                               ; preds = %9
  br i1 %10, label %16, label %122

12:                                               ; preds = %2
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %124

14:                                               ; preds = %16, %9
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %123

16:                                               ; preds = %11
  %17 = getelementptr inbounds i8, ptr %4, i64 8
  %18 = invoke noundef zeroext i1 @_ZL10load_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10yolo_model(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(56) %3)
          to label %19 unwind label %14

19:                                               ; preds = %16
  br i1 %18, label %24, label %20

20:                                               ; preds = %19
  %21 = load ptr, ptr @stderr, align 8, !tbaa !5
  %22 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull @.str.27, ptr noundef nonnull @__func__.main, ptr noundef %22) #9
  br label %122

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #8
  invoke void @_ZN10yolo_imageC2Eiii(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef 0, i32 noundef 0, i32 noundef 0)
          to label %25 unwind label %34

25:                                               ; preds = %24
  %26 = getelementptr inbounds i8, ptr %4, i64 40
  %27 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %26) #8
  %28 = invoke noundef zeroext i1 @_Z10load_imagePKcR10yolo_image(ptr noundef %27, ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %29 unwind label %36

29:                                               ; preds = %25
  br i1 %28, label %38, label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %26) #8
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.28, ptr noundef nonnull @__func__.main, ptr noundef %32) #9
  br label %119

34:                                               ; preds = %24
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %121

36:                                               ; preds = %25
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %120

38:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #8
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %39 = invoke noundef zeroext i1 @_ZL11load_labelsPKcRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE(ptr noundef nonnull @.str.29, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %40 unwind label %44

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

41:                                               ; preds = %40
  %42 = load ptr, ptr @stderr, align 8, !tbaa !5
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef nonnull @.str.30, ptr noundef nonnull @__func__.main) #9
  br label %117

44:                                               ; preds = %38
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %118

46:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  call void @_ZNSt6vectorI10yolo_imageSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  %47 = invoke noundef zeroext i1 @_ZL13load_alphabetRSt6vectorI10yolo_imageSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %48 unwind label %52

48:                                               ; preds = %46
  br i1 %47, label %54, label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.31, ptr noundef nonnull @__func__.main) #9
  br label %115

52:                                               ; preds = %46
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %116

54:                                               ; preds = %48
  %55 = invoke i64 @ggml_tensor_overhead()
          to label %56 unwind label %88

56:                                               ; preds = %54
  %57 = invoke i64 @ggml_graph_overhead()
          to label %58 unwind label %88

58:                                               ; preds = %56
  %59 = shl i64 %55, 11
  %60 = add i64 %57, %59
  store i64 %60, ptr %8, align 8, !tbaa !9
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  store ptr null, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !5
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 16
  store i8 1, ptr %.sroa.6.0..sroa_idx, align 8, !tbaa !11
  %61 = invoke ptr @ggml_init(ptr noundef nonnull byval(%struct.ggml_init_params) align 8 %8)
          to label %62 unwind label %90

62:                                               ; preds = %58
  %63 = invoke noundef ptr @_ZL11build_graphP12ggml_contextRK10yolo_model(ptr noundef %61, ptr noundef nonnull align 8 dereferenceable(56) %3)
          to label %64 unwind label %92

64:                                               ; preds = %62
  %65 = getelementptr inbounds i8, ptr %3, i64 32
  %66 = load ptr, ptr %65, align 8, !tbaa !13
  %67 = invoke ptr @ggml_backend_get_default_buffer_type(ptr noundef %66)
          to label %68 unwind label %94

68:                                               ; preds = %64
  %69 = invoke ptr @ggml_gallocr_new(ptr noundef %67)
          to label %70 unwind label %94

70:                                               ; preds = %68
  %71 = invoke zeroext i1 @ggml_gallocr_alloc_graph(ptr noundef %69, ptr noundef %63)
          to label %72 unwind label %94

72:                                               ; preds = %70
  %73 = invoke i64 @ggml_time_ms()
          to label %74 unwind label %96

74:                                               ; preds = %72
  %75 = load float, ptr %4, align 8, !tbaa !20
  invoke void @_Z6detectR10yolo_imageP11ggml_cgraphRK10yolo_modelfRKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISC_EERKS6_IS_SaIS_EE(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef %63, ptr noundef nonnull align 8 dereferenceable(56) %3, float noundef %75, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %76 unwind label %96

76:                                               ; preds = %74
  %77 = invoke i64 @ggml_time_ms()
          to label %78 unwind label %98

78:                                               ; preds = %76
  %79 = sub nsw i64 %77, %73
  %80 = getelementptr inbounds i8, ptr %4, i64 72
  %81 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %80) #8
  %82 = invoke noundef zeroext i1 @_Z10save_imageRK10yolo_imagePKci(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef %81, i32 noundef 80)
          to label %83 unwind label %98

83:                                               ; preds = %78
  br i1 %82, label %100, label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr @stderr, align 8, !tbaa !5
  %86 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %80) #8
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef nonnull @.str.32, ptr noundef nonnull @__func__.main, ptr noundef %86) #9
  br label %115

88:                                               ; preds = %56, %54
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %116

90:                                               ; preds = %58
  %91 = landingpad { ptr, i32 }
          cleanup
  br label %116

92:                                               ; preds = %62
  %93 = landingpad { ptr, i32 }
          cleanup
  br label %116

94:                                               ; preds = %70, %68, %64
  %95 = landingpad { ptr, i32 }
          cleanup
  br label %116

96:                                               ; preds = %74, %72
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %116

98:                                               ; preds = %113, %110, %107, %106, %100, %78, %76
  %99 = landingpad { ptr, i32 }
          cleanup
  br label %116

100:                                              ; preds = %83
  %101 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %80) #8
  %102 = sitofp i64 %79 to float
  %103 = fdiv float %102, 1.000000e+03
  %104 = fpext float %103 to double
  %105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33, ptr noundef %101, double noundef %104)
  invoke void @ggml_free(ptr noundef %61)
          to label %106 unwind label %98

106:                                              ; preds = %100
  invoke void @ggml_gallocr_free(ptr noundef %69)
          to label %107 unwind label %98

107:                                              ; preds = %106
  %108 = getelementptr inbounds i8, ptr %3, i64 48
  %109 = load ptr, ptr %108, align 8, !tbaa !25
  invoke void @ggml_free(ptr noundef %109)
          to label %110 unwind label %98

110:                                              ; preds = %107
  %111 = getelementptr inbounds i8, ptr %3, i64 40
  %112 = load ptr, ptr %111, align 8, !tbaa !26
  invoke void @ggml_backend_buffer_free(ptr noundef %112)
          to label %113 unwind label %98

113:                                              ; preds = %110
  %114 = load ptr, ptr %65, align 8, !tbaa !13
  invoke void @ggml_backend_free(ptr noundef %114)
          to label %115 unwind label %98

115:                                              ; preds = %84, %113, %49
  %.1 = phi i32 [ 1, %49 ], [ 1, %84 ], [ 0, %113 ]
  call void @_ZNSt6vectorI10yolo_imageSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  br label %117

116:                                              ; preds = %88, %92, %96, %98, %94, %90, %52
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %53, %52 ], [ %89, %88 ], [ %91, %90 ], [ %93, %92 ], [ %95, %94 ], [ %99, %98 ], [ %97, %96 ]
  call void @_ZNSt6vectorI10yolo_imageSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  br label %118

117:                                              ; preds = %115, %41
  %.2 = phi i32 [ %.1, %115 ], [ 1, %41 ]
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #8
  br label %119

118:                                              ; preds = %116, %44
  %.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn, %116 ], [ %45, %44 ]
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #8
  br label %120

119:                                              ; preds = %117, %30
  %.3 = phi i32 [ %.2, %117 ], [ 1, %30 ]
  call void @_ZN10yolo_imageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #8
  br label %122

120:                                              ; preds = %118, %36
  %.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn.pn, %118 ], [ %37, %36 ]
  call void @_ZN10yolo_imageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #8
  br label %121

121:                                              ; preds = %120, %34
  %.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn.pn.pn, %120 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #8
  br label %123

122:                                              ; preds = %11, %119, %20
  %.4 = phi i32 [ %.3, %119 ], [ 1, %20 ], [ 1, %11 ]
  call void @_ZN11yolo_paramsD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %4) #8
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %4) #8
  call void @_ZN10yolo_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #8
  ret i32 %.4

123:                                              ; preds = %121, %14
  %.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn.pn.pn.pn, %121 ], [ %15, %14 ]
  call void @_ZN11yolo_paramsD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %4) #8
  br label %124

124:                                              ; preds = %123, %12
  %.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %123 ], [ %13, %12 ]
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %4) #8
  call void @_ZN10yolo_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn
}

declare void @ggml_time_init() local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN11yolo_paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(104)) unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZL10load_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10yolo_model(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #0

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

declare noundef zeroext i1 @_Z10load_imagePKcR10yolo_image(ptr noundef, ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZL11load_labelsPKcRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZL13load_alphabetRSt6vectorI10yolo_imageSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare i64 @ggml_tensor_overhead() local_unnamed_addr #6

declare i64 @ggml_graph_overhead() local_unnamed_addr #6

declare ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL11build_graphP12ggml_contextRK10yolo_model(ptr noundef, ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #0

declare ptr @ggml_gallocr_new(ptr noundef) local_unnamed_addr #6

declare ptr @ggml_backend_get_default_buffer_type(ptr noundef) local_unnamed_addr #6

declare zeroext i1 @ggml_gallocr_alloc_graph(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i64 @ggml_time_ms() local_unnamed_addr #6

declare noundef zeroext i1 @_Z10save_imageRK10yolo_imagePKci(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i32 noundef) local_unnamed_addr #6

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

declare void @ggml_free(ptr noundef) local_unnamed_addr #6

declare void @ggml_gallocr_free(ptr noundef) local_unnamed_addr #6

declare void @ggml_backend_buffer_free(ptr noundef) local_unnamed_addr #6

declare void @ggml_backend_free(ptr noundef) local_unnamed_addr #6

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 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 #6 = { "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 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 = { cold 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !6, i64 32}
!14 = !{!"_ZTS10yolo_model", !15, i64 0, !15, i64 4, !16, i64 8, !6, i64 32, !6, i64 40, !6, i64 48}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSSt6vectorI12conv2d_layerSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseI12conv2d_layerSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI12conv2d_layerSaIS0_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI12conv2d_layerSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!21, !22, i64 0}
!21 = !{!"_ZTS11yolo_params", !22, i64 0, !23, i64 8, !23, i64 40, !23, i64 72}
!22 = !{!"float", !7, i64 0}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !24, i64 0, !10, i64 8, !7, i64 16}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!25 = !{!14, !6, i64 48}
!26 = !{!14, !6, i64 40}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass