; LLVM IR from ggml-org/ggml :: src/ggml-rpc/ggml-rpc.ll (ZN10rpc_server10set_tensorERKSt6vectorIhSaIhEE)

; 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.ggml_init_params = type { i64, ptr, i8 }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.6" }
%"struct.std::_Head_base.6" = type { ptr }
%"class.std::filesystem::__cxx11::path" = type { %"class.std::__cxx11::basic_string", %"struct.std::filesystem::__cxx11::path::_List" }
%"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.std::filesystem::__cxx11::path::_List" = type { %"class.std::unique_ptr.33" }
%"class.std::unique_ptr.33" = type { %"struct.std::__uniq_ptr_data.34" }
%"struct.std::__uniq_ptr_data.34" = type { %"class.std::__uniq_ptr_impl.35" }
%"class.std::__uniq_ptr_impl.35" = type { %"class.std::tuple.36" }
%"class.std::tuple.36" = type { %"struct.std::_Tuple_impl.37" }
%"struct.std::_Tuple_impl.37" = type { %"struct.std::_Head_base.40" }
%"struct.std::_Head_base.40" = type { ptr }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon.41 }
%union.anon.41 = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%struct.ggml_tensor = type { i32, ptr, [4 x i64], [4 x i64], i32, [16 x i32], i32, [10 x ptr], ptr, i64, ptr, [64 x i8], ptr, [8 x i8] }
%struct.rpc_tensor = type <{ i64, i32, i64, [4 x i32], [4 x i32], i32, [16 x i32], i32, [10 x i64], i64, i64, i64, [64 x i8], [4 x i8] }>
%class.rpc_server = type { ptr, ptr, %"class.std::unordered_set" }
%"class.std::unordered_set" = type { %"class.std::_Hashtable.7" }
%"class.std::_Hashtable.7" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }

@.str.3 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [33 x i8], align 1
@__func__._ZN10rpc_server10set_tensorERKSt6vectorIhSaIhEE = external hidden unnamed_addr constant [11 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [96 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [20 x i8], align 1

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

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) #0

; 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) #1

declare i64 @ggml_tensor_overhead() #2

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

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

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

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

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

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

declare void @ggml_log_internal(i32 noundef, ptr noundef, ...) #2

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

declare ptr @ggml_backend_buffer_get_base(ptr noundef) #2

declare i64 @ggml_backend_buffer_get_size(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10rpc_server10set_tensorERKSt6vectorIhSaIhEE(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca %struct.ggml_init_params, align 8
  %10 = alloca %"class.std::unique_ptr", align 8
  %11 = alloca %struct.ggml_init_params, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca [17 x i8], align 16
  %22 = alloca %"class.std::filesystem::__cxx11::path", align 8
  %23 = alloca %"class.std::filesystem::__cxx11::path", align 8
  %24 = alloca %"class.std::filesystem::__cxx11::path", align 8
  %25 = alloca %"class.std::basic_ofstream", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %26 = load ptr, ptr %4, align 8
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #8
  %29 = icmp ult i64 %28, 304
  br i1 %29, label %30, label %31

30:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  br label %201

31:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #8
  store ptr %33, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #8
  %36 = getelementptr inbounds i8, ptr %35, i64 296
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 1 %36, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #8
  %39 = sub i64 %38, 296
  %40 = sub i64 %39, 8
  store i64 %40, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #8
  %41 = getelementptr inbounds %struct.ggml_init_params, ptr %9, i32 0, i32 0
  %42 = call i64 @ggml_tensor_overhead()
  store i64 %42, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds %struct.ggml_init_params, ptr %9, i32 0, i32 1
  store ptr null, ptr %43, align 8, !tbaa !14
  %44 = getelementptr inbounds %struct.ggml_init_params, ptr %9, i32 0, i32 2
  store i8 1, ptr %44, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %9, i64 24, i1 false), !tbaa.struct !16
  %45 = call ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8 %11)
  call void @_ZNSt10unique_ptrI12ggml_context20ggml_context_deleterEC2IS1_vEEPS0_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef %45) #8
  %46 = call noundef zeroext i1 @_ZStneI12ggml_context20ggml_context_deleterEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr null) #8
  br i1 %46, label %53, label %47

47:                                               ; preds = %31
  invoke void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.3, i32 noundef 1049, ptr noundef @.str.4, ptr noundef @.str.5) #9
          to label %48 unwind label %49

48:                                               ; preds = %47
  unreachable

49:                                               ; preds = %47
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %12, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %13, align 4
  br label %200

53:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %54 = call noundef ptr @_ZNKSt10unique_ptrI12ggml_context20ggml_context_deleterE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  store ptr %54, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %55 = load ptr, ptr %14, align 8, !tbaa !5
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = invoke noundef ptr @_ZN10rpc_server18deserialize_tensorEP12ggml_contextPK10rpc_tensor(ptr noundef nonnull align 8 dereferenceable(72) %26, ptr noundef %55, ptr noundef %56)
          to label %58 unwind label %63

58:                                               ; preds = %53
  store ptr %57, ptr %15, align 8, !tbaa !5
  %59 = load ptr, ptr %15, align 8, !tbaa !5
  %60 = icmp eq ptr %59, null
  br i1 %60, label %61, label %67

61:                                               ; preds = %58
  invoke void (i32, ptr, ...) @ggml_log_internal(i32 noundef 4, ptr noundef @.str.13, ptr noundef @__func__._ZN10rpc_server10set_tensorERKSt6vectorIhSaIhEE)
          to label %62 unwind label %63

62:                                               ; preds = %61
  store i1 false, ptr %3, align 1
  store i32 1, ptr %16, align 4
  br label %198

63:                                               ; preds = %61, %53
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %12, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %13, align 4
  br label %199

67:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.ggml_tensor, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !18
  %71 = invoke ptr @ggml_backend_buffer_get_base(ptr noundef %70)
          to label %72 unwind label %115

72:                                               ; preds = %67
  %73 = ptrtoint ptr %71 to i64
  store i64 %73, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %74 = load i64, ptr %17, align 8, !tbaa !9
  %75 = load ptr, ptr %15, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ggml_tensor, ptr %75, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !18
  %78 = invoke i64 @ggml_backend_buffer_get_size(ptr noundef %77)
          to label %79 unwind label %119

79:                                               ; preds = %72
  %80 = add i64 %74, %78
  store i64 %80, ptr %18, align 8, !tbaa !9
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.rpc_tensor, ptr %81, i32 0, i32 11
  %83 = load i64, ptr %82, align 1, !tbaa !23
  %84 = load i64, ptr %7, align 8, !tbaa !9
  %85 = add i64 %83, %84
  %86 = load i64, ptr %17, align 8, !tbaa !9
  %87 = icmp ult i64 %85, %86
  br i1 %87, label %106, label %88

88:                                               ; preds = %79
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.rpc_tensor, ptr %89, i32 0, i32 11
  %91 = load i64, ptr %90, align 1, !tbaa !23
  %92 = load i64, ptr %7, align 8, !tbaa !9
  %93 = add i64 %91, %92
  %94 = load i64, ptr %18, align 8, !tbaa !9
  %95 = icmp uge i64 %93, %94
  br i1 %95, label %106, label %96

96:                                               ; preds = %88
  %97 = load i64, ptr %8, align 8, !tbaa !9
  %98 = load i64, ptr %18, align 8, !tbaa !9
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.rpc_tensor, ptr %99, i32 0, i32 11
  %101 = load i64, ptr %100, align 1, !tbaa !23
  %102 = sub i64 %98, %101
  %103 = load i64, ptr %7, align 8, !tbaa !9
  %104 = sub i64 %102, %103
  %105 = icmp ugt i64 %97, %104
  br i1 %105, label %106, label %123

106:                                              ; preds = %96, %88, %79
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.rpc_tensor, ptr %107, i32 0, i32 11
  %109 = load i64, ptr %108, align 1, !tbaa !23
  %110 = load i64, ptr %7, align 8, !tbaa !9
  %111 = load i64, ptr %8, align 8, !tbaa !9
  %112 = load i64, ptr %17, align 8, !tbaa !9
  %113 = load i64, ptr %18, align 8, !tbaa !9
  invoke void (i32, ptr, ...) @ggml_log_internal(i32 noundef 4, ptr noundef @.str.14, ptr noundef @__func__._ZN10rpc_server10set_tensorERKSt6vectorIhSaIhEE, i64 noundef %109, i64 noundef %110, i64 noundef %111, i64 noundef %112, i64 noundef %113)
          to label %114 unwind label %119

114:                                              ; preds = %106
  store i1 false, ptr %3, align 1
  store i32 1, ptr %16, align 4
  br label %124

115:                                              ; preds = %67
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %12, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %13, align 4
  br label %157

119:                                              ; preds = %106, %72
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %12, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %157

123:                                              ; preds = %96
  store i32 0, ptr %16, align 4
  br label %124

124:                                              ; preds = %123, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  %125 = load i32, ptr %16, align 4
  switch i32 %125, label %198 [
    i32 0, label %126
  ]

126:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %127) #8
  %129 = getelementptr inbounds i8, ptr %128, i64 296
  %130 = getelementptr inbounds i8, ptr %129, i64 8
  store ptr %130, ptr %19, align 8, !tbaa !5
  %131 = getelementptr inbounds %class.rpc_server, ptr %26, i32 0, i32 1
  %132 = load ptr, ptr %131, align 8, !tbaa !25
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %187

134:                                              ; preds = %126
  %135 = load i64, ptr %8, align 8, !tbaa !9
  %136 = icmp ugt i64 %135, 10485760
  br i1 %136, label %137, label %187

137:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %138 = load ptr, ptr %19, align 8, !tbaa !5
  %139 = load i64, ptr %8, align 8, !tbaa !9
  %140 = invoke noundef i64 @_ZL8fnv_hashPKhm(ptr noundef %138, i64 noundef %139)
          to label %141 unwind label %158

141:                                              ; preds = %137
  store i64 %140, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 17, ptr %21) #8
  %142 = getelementptr inbounds [17 x i8], ptr %21, i64 0, i64 0
  %143 = load i64, ptr %20, align 8, !tbaa !9
  %144 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %142, i64 noundef 17, ptr noundef @.str.15, i64 noundef %143) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr %23) #8
  %145 = getelementptr inbounds %class.rpc_server, ptr %26, i32 0, i32 1
  invoke void @_ZNSt10filesystem7__cxx114pathC2IPKcS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(40) %23, ptr noundef nonnull align 8 dereferenceable(8) %145, i8 noundef zeroext 2)
          to label %146 unwind label %162

146:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 40, ptr %24) #8
  invoke void @_ZNSt10filesystem7__cxx114pathC2IA17_cS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef nonnull align 1 dereferenceable(17) %21, i8 noundef zeroext 2)
          to label %147 unwind label %166

147:                                              ; preds = %146
  invoke void @_ZNSt10filesystem7__cxx11dvERKNS0_4pathES3_(ptr dead_on_unwind writable sret(%"class.std::filesystem::__cxx11::path") align 8 %22, ptr noundef nonnull align 8 dereferenceable(40) %23, ptr noundef nonnull align 8 dereferenceable(40) %24)
          to label %148 unwind label %170

148:                                              ; preds = %147
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %24) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %24) #8
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %23) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 512, ptr %25) #8
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1INSt10filesystem7__cxx114pathES6_EERKT_St13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %25, ptr noundef nonnull align 8 dereferenceable(40) %22, i32 noundef 4)
          to label %149 unwind label %176

149:                                              ; preds = %148
  %150 = load ptr, ptr %19, align 8, !tbaa !5
  %151 = load i64, ptr %8, align 8, !tbaa !9
  %152 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5writeEPKcl(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef %150, i64 noundef %151)
          to label %153 unwind label %180

153:                                              ; preds = %149
  %154 = call noundef ptr @_ZNKSt10filesystem7__cxx114path5c_strEv(ptr noundef nonnull align 8 dereferenceable(40) %22) #8
  %155 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef @__func__._ZN10rpc_server10set_tensorERKSt6vectorIhSaIhEE, ptr noundef %154)
          to label %156 unwind label %180

156:                                              ; preds = %153
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %25) #8
  call void @llvm.lifetime.end.p0(i64 512, ptr %25) #8
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %22) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 17, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %187

157:                                              ; preds = %119, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %199

158:                                              ; preds = %137
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %12, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %13, align 4
  br label %186

162:                                              ; preds = %141
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %12, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %13, align 4
  br label %175

166:                                              ; preds = %146
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %12, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %13, align 4
  br label %174

170:                                              ; preds = %147
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %12, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %13, align 4
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %24) #8
  br label %174

174:                                              ; preds = %170, %166
  call void @llvm.lifetime.end.p0(i64 40, ptr %24) #8
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %23) #8
  br label %175

175:                                              ; preds = %174, %162
  call void @llvm.lifetime.end.p0(i64 40, ptr %23) #8
  br label %185

176:                                              ; preds = %148
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %12, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %13, align 4
  br label %184

180:                                              ; preds = %153, %149
  %181 = landingpad { ptr, i32 }
          cleanup
  %182 = extractvalue { ptr, i32 } %181, 0
  store ptr %182, ptr %12, align 8
  %183 = extractvalue { ptr, i32 } %181, 1
  store i32 %183, ptr %13, align 4
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %25) #8
  br label %184

184:                                              ; preds = %180, %176
  call void @llvm.lifetime.end.p0(i64 512, ptr %25) #8
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %22) #8
  br label %185

185:                                              ; preds = %184, %175
  call void @llvm.lifetime.end.p0(i64 40, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 17, ptr %21) #8
  br label %186

186:                                              ; preds = %185, %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %197

187:                                              ; preds = %156, %134, %126
  %188 = load ptr, ptr %15, align 8, !tbaa !5
  %189 = load ptr, ptr %19, align 8, !tbaa !5
  %190 = load i64, ptr %7, align 8, !tbaa !9
  %191 = load i64, ptr %8, align 8, !tbaa !9
  invoke void @ggml_backend_tensor_set(ptr noundef %188, ptr noundef %189, i64 noundef %190, i64 noundef %191)
          to label %192 unwind label %193

192:                                              ; preds = %187
  store i1 true, ptr %3, align 1
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %198

193:                                              ; preds = %187
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %12, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %13, align 4
  br label %197

197:                                              ; preds = %193, %186
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %199

198:                                              ; preds = %192, %124, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @_ZNSt10unique_ptrI12ggml_context20ggml_context_deleterED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %201

199:                                              ; preds = %197, %157, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %200

200:                                              ; preds = %199, %49
  call void @_ZNSt10unique_ptrI12ggml_context20ggml_context_deleterED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %203

201:                                              ; preds = %198, %30
  %202 = load i1, ptr %3, align 1
  ret i1 %202

203:                                              ; preds = %200
  %204 = load ptr, ptr %12, align 8
  %205 = load i32, ptr %13, align 4
  %206 = insertvalue { ptr, i32 } poison, ptr %204, 0
  %207 = insertvalue { ptr, i32 } %206, i32 %205, 1
  resume { ptr, i32 } %207
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZL8fnv_hashPKhm(ptr noundef, i64 noundef) #3

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #7

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10filesystem7__cxx11dvERKNS0_4pathES3_(ptr dead_on_unwind noalias writable sret(%"class.std::filesystem::__cxx11::path") align 8, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10filesystem7__cxx114pathC2IPKcS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(8), i8 noundef zeroext) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10filesystem7__cxx114pathC2IA17_cS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 1 dereferenceable(17), i8 noundef zeroext) unnamed_addr #6 align 2

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5writeEPKcl(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i64 noundef) #2

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

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

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

declare void @ggml_backend_tensor_set(ptr noundef, ptr noundef, i64 noundef, i64 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree 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 = { 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 = { 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 = { 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 #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 = { 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 = !{!"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, !10, i64 0}
!12 = !{!"_ZTS16ggml_init_params", !10, i64 0, !6, i64 8, !13, i64 16}
!13 = !{!"bool", !7, i64 0}
!14 = !{!12, !6, i64 8}
!15 = !{!12, !13, i64 16}
!16 = !{i64 0, i64 8, !9, i64 8, i64 8, !5, i64 16, i64 1, !17}
!17 = !{!13, !13, i64 0}
!18 = !{!19, !6, i64 8}
!19 = !{!"_ZTS11ggml_tensor", !20, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !21, i64 80, !7, i64 84, !22, i64 148, !7, i64 152, !6, i64 232, !10, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}
!20 = !{!"_ZTS9ggml_type", !7, i64 0}
!21 = !{!"_ZTS7ggml_op", !7, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!24, !10, i64 220}
!24 = !{!"_ZTS10rpc_tensor", !10, i64 0, !22, i64 8, !10, i64 12, !7, i64 20, !7, i64 36, !22, i64 52, !7, i64 56, !22, i64 120, !7, i64 124, !10, i64 204, !10, i64 212, !10, i64 220, !7, i64 228, !7, i64 292}
!25 = !{!26, !6, i64 8}
!26 = !{!"_ZTS10rpc_server", !6, i64 0, !6, i64 8, !27, i64 16}
!27 = !{!"_ZTSSt13unordered_setIP19ggml_backend_bufferSt4hashIS1_ESt8equal_toIS1_ESaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt10_HashtableIP19ggml_backend_bufferS1_SaIS1_ENSt8__detail9_IdentityESt8equal_toIS1_ESt4hashIS1_ENS3_18_Mod_range_hashingENS3_20_Default_ranged_hashENS3_20_Prime_rehash_policyENS3_17_Hashtable_traitsILb0ELb1ELb1EEEE", !6, i64 0, !10, i64 8, !29, i64 16, !10, i64 24, !30, i64 32, !6, i64 48}
!29 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!30 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !31, i64 0, !10, i64 8}
!31 = !{!"float", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ggml_init_params = type { i64, ptr, i8 }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.6" }
%"struct.std::_Head_base.6" = type { ptr }
%"class.std::filesystem::__cxx11::path" = type { %"class.std::__cxx11::basic_string", %"struct.std::filesystem::__cxx11::path::_List" }
%"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.std::filesystem::__cxx11::path::_List" = type { %"class.std::unique_ptr.33" }
%"class.std::unique_ptr.33" = type { %"struct.std::__uniq_ptr_data.34" }
%"struct.std::__uniq_ptr_data.34" = type { %"class.std::__uniq_ptr_impl.35" }
%"class.std::__uniq_ptr_impl.35" = type { %"class.std::tuple.36" }
%"class.std::tuple.36" = type { %"struct.std::_Tuple_impl.37" }
%"struct.std::_Tuple_impl.37" = type { %"struct.std::_Head_base.40" }
%"struct.std::_Head_base.40" = type { ptr }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon.41 }
%union.anon.41 = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }

@.str.3 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [33 x i8], align 1
@__func__._ZN10rpc_server10set_tensorERKSt6vectorIhSaIhEE = external hidden unnamed_addr constant [11 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [96 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [20 x i8], align 1

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

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) #0

declare i64 @ggml_tensor_overhead() local_unnamed_addr #1

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

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

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

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

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

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

declare void @ggml_log_internal(i32 noundef, ptr noundef, ...) local_unnamed_addr #1

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

declare ptr @ggml_backend_buffer_get_base(ptr noundef) local_unnamed_addr #1

declare i64 @ggml_backend_buffer_get_size(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10rpc_server10set_tensorERKSt6vectorIhSaIhEE(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::unique_ptr", align 8
  %4 = alloca %struct.ggml_init_params, align 8
  %5 = alloca [17 x i8], align 16
  %6 = alloca %"class.std::filesystem::__cxx11::path", align 8
  %7 = alloca %"class.std::filesystem::__cxx11::path", align 8
  %8 = alloca %"class.std::filesystem::__cxx11::path", align 8
  %9 = alloca %"class.std::basic_ofstream", align 8
  %10 = tail call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %11 = icmp ult i64 %10, 304
  br i1 %11, label %91, label %12

12:                                               ; preds = %2
  %13 = tail call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %14 = tail call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %15 = getelementptr inbounds i8, ptr %14, i64 296
  %.0.copyload = load i64, ptr %15, align 1
  %16 = tail call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %17 = add i64 %16, -304
  %18 = tail call i64 @ggml_tensor_overhead()
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 %18, ptr %4, align 8, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  store ptr null, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !9
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 16
  store i8 1, ptr %.sroa.6.0..sroa_idx, align 8, !tbaa !11
  %19 = tail call ptr @ggml_init(ptr noundef nonnull byval(%struct.ggml_init_params) align 8 %4)
  call void @_ZNSt10unique_ptrI12ggml_context20ggml_context_deleterEC2IS1_vEEPS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %19) #7
  %20 = call noundef zeroext i1 @_ZStneI12ggml_context20ggml_context_deleterEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr null) #7
  br i1 %20, label %25, label %21

21:                                               ; preds = %12
  invoke void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.3, i32 noundef 1049, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5) #8
          to label %22 unwind label %23

22:                                               ; preds = %21
  unreachable

23:                                               ; preds = %21
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %90

25:                                               ; preds = %12
  %26 = call noundef ptr @_ZNKSt10unique_ptrI12ggml_context20ggml_context_deleterE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %27 = invoke noundef ptr @_ZN10rpc_server18deserialize_tensorEP12ggml_contextPK10rpc_tensor(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef %26, ptr noundef %13)
          to label %28 unwind label %31

28:                                               ; preds = %25
  %29 = icmp eq ptr %27, null
  br i1 %29, label %30, label %33

30:                                               ; preds = %28
  invoke void (i32, ptr, ...) @ggml_log_internal(i32 noundef 4, ptr noundef nonnull @.str.13, ptr noundef nonnull @__func__._ZN10rpc_server10set_tensorERKSt6vectorIhSaIhEE)
          to label %.critedge unwind label %31

31:                                               ; preds = %30, %25
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %90

33:                                               ; preds = %28
  %34 = getelementptr inbounds i8, ptr %27, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = invoke ptr @ggml_backend_buffer_get_base(ptr noundef %35)
          to label %37 unwind label %51

37:                                               ; preds = %33
  %38 = ptrtoint ptr %36 to i64
  %39 = load ptr, ptr %34, align 8, !tbaa !13
  %40 = invoke i64 @ggml_backend_buffer_get_size(ptr noundef %39)
          to label %41 unwind label %53

41:                                               ; preds = %37
  %42 = add i64 %40, %38
  %43 = getelementptr inbounds i8, ptr %13, i64 220
  %44 = load i64, ptr %43, align 1, !tbaa !18
  %45 = add i64 %44, %.0.copyload
  %46 = icmp ult i64 %45, %38
  %.not = icmp uge i64 %45, %42
  %47 = sub i64 %42, %45
  %48 = icmp ugt i64 %17, %47
  %49 = or i1 %.not, %48
  %or.cond70 = select i1 %46, i1 true, i1 %49
  br i1 %or.cond70, label %50, label %55

50:                                               ; preds = %41
  invoke void (i32, ptr, ...) @ggml_log_internal(i32 noundef 4, ptr noundef nonnull @.str.14, ptr noundef nonnull @__func__._ZN10rpc_server10set_tensorERKSt6vectorIhSaIhEE, i64 noundef %44, i64 noundef %.0.copyload, i64 noundef %17, i64 noundef %38, i64 noundef %42)
          to label %.critedge unwind label %53

51:                                               ; preds = %33
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %90

53:                                               ; preds = %50, %37
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %90

55:                                               ; preds = %41
  %56 = call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %57 = getelementptr inbounds i8, ptr %56, i64 304
  %58 = getelementptr inbounds i8, ptr %0, i64 8
  %59 = load ptr, ptr %58, align 8, !tbaa !20
  %60 = icmp ne ptr %59, null
  %61 = icmp ugt i64 %17, 10485760
  %or.cond = and i1 %61, %60
  br i1 %or.cond, label %62, label %87

62:                                               ; preds = %55
  %63 = call noundef i64 @_ZL8fnv_hashPKhm(ptr noundef nonnull %57, i64 noundef %17)
  call void @llvm.lifetime.start.p0(i64 17, ptr nonnull %5) #7
  %64 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %5, i64 noundef 17, ptr noundef nonnull @.str.15, i64 noundef %63) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #7
  invoke void @_ZNSt10filesystem7__cxx114pathC2IPKcS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull align 8 dereferenceable(8) %58, i8 noundef zeroext 2)
          to label %65 unwind label %73

65:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #7
  invoke void @_ZNSt10filesystem7__cxx114pathC2IA17_cS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 1 dereferenceable(17) %5, i8 noundef zeroext 2)
          to label %66 unwind label %75

66:                                               ; preds = %65
  invoke void @_ZNSt10filesystem7__cxx11dvERKNS0_4pathES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::filesystem::__cxx11::path") align 8 %6, ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull align 8 dereferenceable(40) %8)
          to label %67 unwind label %77

67:                                               ; preds = %66
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #7
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %9) #7
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1INSt10filesystem7__cxx114pathES6_EERKT_St13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %9, ptr noundef nonnull align 8 dereferenceable(40) %6, i32 noundef 4)
          to label %68 unwind label %81

68:                                               ; preds = %67
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5writeEPKcl(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull %57, i64 noundef %17)
          to label %70 unwind label %83

70:                                               ; preds = %68
  %71 = call noundef ptr @_ZNKSt10filesystem7__cxx114path5c_strEv(ptr noundef nonnull align 8 dereferenceable(40) %6) #7
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef nonnull @__func__._ZN10rpc_server10set_tensorERKSt6vectorIhSaIhEE, ptr noundef %71)
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %9) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %9) #7
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 17, ptr nonnull %5) #7
  br label %87

73:                                               ; preds = %62
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %80

75:                                               ; preds = %65
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %79

77:                                               ; preds = %66
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #7
  br label %79

79:                                               ; preds = %77, %75
  %.pn57 = phi { ptr, i32 } [ %78, %77 ], [ %76, %75 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #7
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #7
  br label %80

80:                                               ; preds = %79, %73
  %.pn57.pn = phi { ptr, i32 } [ %.pn57, %79 ], [ %74, %73 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #7
  br label %86

81:                                               ; preds = %67
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %85

83:                                               ; preds = %68
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %9) #7
  br label %85

85:                                               ; preds = %83, %81
  %.pn60 = phi { ptr, i32 } [ %84, %83 ], [ %82, %81 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %9) #7
  call void @_ZNSt10filesystem7__cxx114pathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #7
  br label %86

86:                                               ; preds = %85, %80
  %.pn60.pn = phi { ptr, i32 } [ %.pn60, %85 ], [ %.pn57.pn, %80 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 17, ptr nonnull %5) #7
  br label %90

87:                                               ; preds = %70, %55
  invoke void @ggml_backend_tensor_set(ptr noundef nonnull %27, ptr noundef nonnull %57, i64 noundef %.0.copyload, i64 noundef %17)
          to label %.critedge unwind label %88

88:                                               ; preds = %87
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %90

.critedge:                                        ; preds = %50, %87, %30
  %.1 = phi i1 [ false, %30 ], [ true, %87 ], [ false, %50 ]
  call void @_ZNSt10unique_ptrI12ggml_context20ggml_context_deleterED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %91

90:                                               ; preds = %31, %53, %51, %88, %86, %23
  %.pn65.pn = phi { ptr, i32 } [ %24, %23 ], [ %32, %31 ], [ %54, %53 ], [ %52, %51 ], [ %89, %88 ], [ %.pn60.pn, %86 ]
  call void @_ZNSt10unique_ptrI12ggml_context20ggml_context_deleterED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn65.pn

91:                                               ; preds = %2, %.critedge
  %.2 = phi i1 [ %.1, %.critedge ], [ false, %2 ]
  ret i1 %.2
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZL8fnv_hashPKhm(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10filesystem7__cxx11dvERKNS0_4pathES3_(ptr dead_on_unwind noalias writable sret(%"class.std::filesystem::__cxx11::path") align 8, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10filesystem7__cxx114pathC2IPKcS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(8), i8 noundef zeroext) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10filesystem7__cxx114pathC2IA17_cS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 1 dereferenceable(17), i8 noundef zeroext) unnamed_addr #5 align 2

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5writeEPKcl(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i64 noundef) local_unnamed_addr #1

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

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

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

declare void @ggml_backend_tensor_set(ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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 = { 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 #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 = { 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 #7 = { nounwind }
attributes #8 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTS11ggml_tensor", !15, i64 0, !10, i64 8, !7, i64 16, !7, i64 48, !16, i64 80, !7, i64 84, !17, i64 148, !7, i64 152, !10, i64 232, !6, i64 240, !10, i64 248, !7, i64 256, !10, i64 320, !7, i64 328}
!15 = !{!"_ZTS9ggml_type", !7, i64 0}
!16 = !{!"_ZTS7ggml_op", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!19, !6, i64 220}
!19 = !{!"_ZTS10rpc_tensor", !6, i64 0, !17, i64 8, !6, i64 12, !7, i64 20, !7, i64 36, !17, i64 52, !7, i64 56, !17, i64 120, !7, i64 124, !6, i64 204, !6, i64 212, !6, i64 220, !7, i64 228, !7, i64 292}
!20 = !{!21, !10, i64 8}
!21 = !{!"_ZTS10rpc_server", !10, i64 0, !10, i64 8, !22, i64 16}
!22 = !{!"_ZTSSt13unordered_setIP19ggml_backend_bufferSt4hashIS1_ESt8equal_toIS1_ESaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSSt10_HashtableIP19ggml_backend_bufferS1_SaIS1_ENSt8__detail9_IdentityESt8equal_toIS1_ESt4hashIS1_ENS3_18_Mod_range_hashingENS3_20_Default_ranged_hashENS3_20_Prime_rehash_policyENS3_17_Hashtable_traitsILb0ELb1ELb1EEEE", !10, i64 0, !6, i64 8, !24, i64 16, !6, i64 24, !25, i64 32, !10, i64 48}
!24 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !10, i64 0}
!25 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !26, i64 0, !6, i64 8}
!26 = !{!"float", !7, i64 0}


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