; LLVM IR from ggml-org/ggml :: examples/gpt-2 (main-batched)

; 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.gpt2_batch = type { i32, ptr, ptr, ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::vector.39" = type { %"struct.std::_Vector_base.40" }
%"struct.std::_Vector_base.40" = 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::allocator.41" = type { i8 }
%struct.gpt2_model = type { %struct.gpt2_hparams, ptr, ptr, ptr, ptr, ptr, %"class.std::vector.4", %struct.gpt2_kv_cache, ptr, ptr, ptr, %"class.std::map" }
%struct.gpt2_hparams = type { i32, i32, i32, i32, i32, i32, float }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<gpt2_layer, std::allocator<gpt2_layer>>::_Vector_impl" }
%"struct.std::_Vector_base<gpt2_layer, std::allocator<gpt2_layer>>::_Vector_impl" = type { %"struct.std::_Vector_base<gpt2_layer, std::allocator<gpt2_layer>>::_Vector_impl_data" }
%"struct.std::_Vector_base<gpt2_layer, std::allocator<gpt2_layer>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.gpt2_kv_cache = type { ptr, ptr, i32, i32, i32, %"class.std::vector.9", ptr }
%"class.std::vector.9" = type { %"struct.std::_Vector_base.10" }
%"struct.std::_Vector_base.10" = type { %"struct.std::_Vector_base<gpt2_kv_cell, std::allocator<gpt2_kv_cell>>::_Vector_impl" }
%"struct.std::_Vector_base<gpt2_kv_cell, std::allocator<gpt2_kv_cell>>::_Vector_impl" = type { %"struct.std::_Vector_base<gpt2_kv_cell, std::allocator<gpt2_kv_cell>>::_Vector_impl_data" }
%"struct.std::_Vector_base<gpt2_kv_cell, std::allocator<gpt2_kv_cell>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, ggml_tensor *>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, ggml_tensor *>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, ggml_tensor *>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, ggml_tensor *>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%struct.gpt2_kv_cell = type { i32, i32, %"class.std::set" }
%"class.std::set" = type { %"class.std::_Rb_tree.35" }
%"class.std::_Rb_tree.35" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }

@.str.41 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [18 x i8], align 1
@__func__._Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE = external hidden unnamed_addr constant [12 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [30 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

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

declare zeroext i1 @ggml_backend_is_cpu(ptr noundef) #1

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

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

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

declare i64 @ggml_element_size(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef %1, ptr noundef byval(%struct.gpt2_batch) align 8 %2, i32 noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %4) #2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %"class.std::vector.39", align 8
  %29 = alloca %"class.std::allocator.41", align 1
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  %32 = alloca float, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca ptr, align 8
  %40 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %41 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !11
  store i32 %42, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.gpt2_model, ptr %43, i32 0, i32 0
  store ptr %44, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.gpt2_hparams, ptr %45, i32 0, i32 0
  %47 = load i32, ptr %46, align 4, !tbaa !13
  store i32 %47, ptr %13, align 4, !tbaa !9
  %48 = load i32, ptr %11, align 4, !tbaa !9
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %52

50:                                               ; preds = %5
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.48, ptr noundef @__func__._Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE)
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %384

52:                                               ; preds = %5
  %53 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = icmp ne ptr %54, null
  br i1 %55, label %60, label %56

56:                                               ; preds = %52
  %57 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !17
  %59 = icmp ne ptr %58, null
  br i1 %59, label %69, label %60

60:                                               ; preds = %56, %52
  %61 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %68

64:                                               ; preds = %60
  %65 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !17
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %69

68:                                               ; preds = %64, %60
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.43, i32 noundef 886, ptr noundef @.str.44, ptr noundef @.str.49) #6
  unreachable

69:                                               ; preds = %64, %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.gpt2_model, ptr %70, i32 0, i32 7
  store ptr %71, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %114, %69
  %73 = load i32, ptr %16, align 4, !tbaa !9
  %74 = load i32, ptr %11, align 4, !tbaa !9
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %117

77:                                               ; preds = %72
  %78 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 3
  %79 = load ptr, ptr %78, align 8, !tbaa !18
  %80 = load i32, ptr %16, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i32, ptr %79, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = load ptr, ptr %15, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %84, i32 0, i32 5
  %86 = load ptr, ptr %15, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %86, i32 0, i32 2
  %88 = load i32, ptr %87, align 8, !tbaa !19
  %89 = load i32, ptr %16, align 4, !tbaa !9
  %90 = add i32 %88, %89
  %91 = zext i32 %90 to i64
  %92 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI12gpt2_kv_cellSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef %91) #5
  %93 = getelementptr inbounds %struct.gpt2_kv_cell, ptr %92, i32 0, i32 0
  store i32 %83, ptr %93, align 8, !tbaa !25
  %94 = load ptr, ptr %15, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %94, i32 0, i32 5
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %96, i32 0, i32 2
  %98 = load i32, ptr %97, align 8, !tbaa !19
  %99 = load i32, ptr %16, align 4, !tbaa !9
  %100 = add i32 %98, %99
  %101 = zext i32 %100 to i64
  %102 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI12gpt2_kv_cellSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %95, i64 noundef %101) #5
  %103 = getelementptr inbounds %struct.gpt2_kv_cell, ptr %102, i32 0, i32 2
  %104 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 4
  %105 = load ptr, ptr %104, align 8, !tbaa !36
  %106 = load i32, ptr %16, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %105, i64 %107
  %109 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %103, ptr noundef nonnull align 4 dereferenceable(4) %108)
  %110 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 0
  %111 = extractvalue { ptr, i8 } %109, 0
  store ptr %111, ptr %110, align 8
  %112 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 1
  %113 = extractvalue { ptr, i8 } %109, 1
  store i8 %113, ptr %112, align 8
  br label %114

114:                                              ; preds = %77
  %115 = load i32, ptr %16, align 4, !tbaa !9
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %16, align 4, !tbaa !9
  br label %72, !llvm.loop !37

117:                                              ; preds = %76
  %118 = load ptr, ptr %15, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %118, i32 0, i32 2
  %120 = load i32, ptr %119, align 8, !tbaa !19
  %121 = load i32, ptr %11, align 4, !tbaa !9
  %122 = add i32 %120, %121
  %123 = load ptr, ptr %15, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %123, i32 0, i32 4
  store i32 %122, ptr %124, align 8, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = call noundef ptr @_Z10gpt2_graphRK10gpt2_modelRK10gpt2_batchb(ptr noundef nonnull align 8 dereferenceable(232) %125, ptr noundef nonnull align 8 dereferenceable(48) %2, i1 noundef zeroext false)
  store ptr %126, ptr %18, align 8, !tbaa !5
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = load ptr, ptr %18, align 8, !tbaa !5
  %129 = call zeroext i1 @ggml_gallocr_alloc_graph(ptr noundef %127, ptr noundef %128)
  %130 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !16
  %132 = icmp ne ptr %131, null
  br i1 %132, label %133, label %166

133:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %134 = load ptr, ptr %18, align 8, !tbaa !5
  %135 = call ptr @ggml_graph_get_tensor(ptr noundef %134, ptr noundef @.str.41)
  store ptr %135, ptr %19, align 8, !tbaa !5
  %136 = load ptr, ptr %19, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8, !tbaa !16
  %139 = load i32, ptr %11, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = load ptr, ptr %19, align 8, !tbaa !5
  %142 = call i64 @ggml_element_size(ptr noundef %141)
  %143 = mul i64 %140, %142
  call void @ggml_backend_tensor_set(ptr noundef %136, ptr noundef %138, i64 noundef 0, i64 noundef %143)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %144 = load ptr, ptr %18, align 8, !tbaa !5
  %145 = call ptr @ggml_graph_get_tensor(ptr noundef %144, ptr noundef @.str.42)
  store ptr %145, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %146

146:                                              ; preds = %162, %133
  %147 = load i32, ptr %21, align 4, !tbaa !9
  %148 = load i32, ptr %11, align 4, !tbaa !9
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %146
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %165

151:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %152 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 3
  %153 = load ptr, ptr %152, align 8, !tbaa !18
  %154 = load i32, ptr %21, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds i32, ptr %153, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !9
  store i32 %157, ptr %22, align 4, !tbaa !9
  %158 = load ptr, ptr %20, align 8, !tbaa !5
  %159 = load i32, ptr %21, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = mul i64 %160, 4
  call void @ggml_backend_tensor_set(ptr noundef %158, ptr noundef %22, i64 noundef %161, i64 noundef 4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %162

162:                                              ; preds = %151
  %163 = load i32, ptr %21, align 4, !tbaa !9
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %21, align 4, !tbaa !9
  br label %146, !llvm.loop !40

165:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %181

166:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %167 = load ptr, ptr %18, align 8, !tbaa !5
  %168 = call ptr @ggml_graph_get_tensor(ptr noundef %167, ptr noundef @.str.46)
  store ptr %168, ptr %23, align 8, !tbaa !5
  %169 = load ptr, ptr %23, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 2
  %171 = load ptr, ptr %170, align 8, !tbaa !17
  %172 = load i32, ptr %11, align 4, !tbaa !9
  %173 = load ptr, ptr %12, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.gpt2_hparams, ptr %173, i32 0, i32 2
  %175 = load i32, ptr %174, align 4, !tbaa !41
  %176 = mul nsw i32 %172, %175
  %177 = sext i32 %176 to i64
  %178 = load ptr, ptr %23, align 8, !tbaa !5
  %179 = call i64 @ggml_element_size(ptr noundef %178)
  %180 = mul i64 %177, %179
  call void @ggml_backend_tensor_set(ptr noundef %169, ptr noundef %171, i64 noundef 0, i64 noundef %180)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %181

181:                                              ; preds = %166, %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %182 = load ptr, ptr %18, align 8, !tbaa !5
  %183 = call ptr @ggml_graph_get_tensor(ptr noundef %182, ptr noundef @.str.47)
  store ptr %183, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %184 = load ptr, ptr %7, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.gpt2_model, ptr %184, i32 0, i32 7
  store ptr %185, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %186 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 0
  %187 = load i32, ptr %186, align 8, !tbaa !11
  store i32 %187, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %188 = load ptr, ptr %25, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %188, i32 0, i32 4
  %190 = load i32, ptr %189, align 8, !tbaa !39
  store i32 %190, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #5
  %191 = load i32, ptr %27, align 4, !tbaa !9
  %192 = load i32, ptr %26, align 4, !tbaa !9
  %193 = mul nsw i32 %191, %192
  %194 = sext i32 %193 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #5
  call void @_ZNSaIfEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #5
  invoke void @_ZNSt6vectorIfSaIfEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %194, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %195 unwind label %200

195:                                              ; preds = %181
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  store float 0xFFF0000000000000, ptr %32, align 4, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #5
  store i32 0, ptr %33, align 4, !tbaa !9
  br label %196

196:                                              ; preds = %274, %195
  %197 = load i32, ptr %33, align 4, !tbaa !9
  %198 = icmp slt i32 %197, 1
  br i1 %198, label %204, label %199

199:                                              ; preds = %196
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  br label %277

200:                                              ; preds = %181
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %30, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %31, align 4
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #5
  br label %297

204:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  %205 = load i32, ptr %33, align 4, !tbaa !9
  %206 = load i32, ptr %27, align 4, !tbaa !9
  %207 = load i32, ptr %26, align 4, !tbaa !9
  %208 = mul nsw i32 %206, %207
  %209 = mul nsw i32 %205, %208
  store i32 %209, ptr %34, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #5
  store i32 0, ptr %35, align 4, !tbaa !9
  br label %210

210:                                              ; preds = %270, %204
  %211 = load i32, ptr %35, align 4, !tbaa !9
  %212 = load i32, ptr %26, align 4, !tbaa !9
  %213 = icmp slt i32 %211, %212
  br i1 %213, label %215, label %214

214:                                              ; preds = %210
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  br label %273

215:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #5
  %216 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 3
  %217 = load ptr, ptr %216, align 8, !tbaa !18
  %218 = load i32, ptr %35, align 4, !tbaa !9
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds i32, ptr %217, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !9
  store i32 %221, ptr %36, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #5
  %222 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 4
  %223 = load ptr, ptr %222, align 8, !tbaa !36
  %224 = load i32, ptr %35, align 4, !tbaa !9
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds i32, ptr %223, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !9
  store i32 %227, ptr %37, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #5
  store i32 0, ptr %38, align 4, !tbaa !9
  br label %228

228:                                              ; preds = %266, %215
  %229 = load i32, ptr %38, align 4, !tbaa !9
  %230 = load i32, ptr %27, align 4, !tbaa !9
  %231 = icmp slt i32 %229, %230
  br i1 %231, label %233, label %232

232:                                              ; preds = %228
  store i32 14, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #5
  br label %269

233:                                              ; preds = %228
  %234 = load ptr, ptr %25, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %234, i32 0, i32 5
  %236 = load i32, ptr %38, align 4, !tbaa !9
  %237 = sext i32 %236 to i64
  %238 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNKSt6vectorI12gpt2_kv_cellSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %235, i64 noundef %237) #5
  %239 = invoke noundef zeroext i1 @_ZNK12gpt2_kv_cell10has_seq_idERKi(ptr noundef nonnull align 8 dereferenceable(56) %238, ptr noundef nonnull align 4 dereferenceable(4) %37)
          to label %240 unwind label %261

240:                                              ; preds = %233
  br i1 %239, label %241, label %251

241:                                              ; preds = %240
  %242 = load ptr, ptr %25, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %242, i32 0, i32 5
  %244 = load i32, ptr %38, align 4, !tbaa !9
  %245 = sext i32 %244 to i64
  %246 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNKSt6vectorI12gpt2_kv_cellSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %243, i64 noundef %245) #5
  %247 = getelementptr inbounds %struct.gpt2_kv_cell, ptr %246, i32 0, i32 0
  %248 = load i32, ptr %247, align 8, !tbaa !25
  %249 = load i32, ptr %36, align 4, !tbaa !9
  %250 = icmp sgt i32 %248, %249
  br i1 %250, label %251, label %265

251:                                              ; preds = %241, %240
  %252 = load i32, ptr %34, align 4, !tbaa !9
  %253 = load i32, ptr %35, align 4, !tbaa !9
  %254 = load i32, ptr %27, align 4, !tbaa !9
  %255 = mul nsw i32 %253, %254
  %256 = add nsw i32 %252, %255
  %257 = load i32, ptr %38, align 4, !tbaa !9
  %258 = add nsw i32 %256, %257
  %259 = sext i32 %258 to i64
  %260 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %259) #5
  store float 0xFFF0000000000000, ptr %260, align 4, !tbaa !42
  br label %265

261:                                              ; preds = %233
  %262 = landingpad { ptr, i32 }
          cleanup
  %263 = extractvalue { ptr, i32 } %262, 0
  store ptr %263, ptr %30, align 8
  %264 = extractvalue { ptr, i32 } %262, 1
  store i32 %264, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  br label %296

265:                                              ; preds = %251, %241
  br label %266

266:                                              ; preds = %265
  %267 = load i32, ptr %38, align 4, !tbaa !9
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %38, align 4, !tbaa !9
  br label %228, !llvm.loop !43

269:                                              ; preds = %232
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #5
  br label %270

270:                                              ; preds = %269
  %271 = load i32, ptr %35, align 4, !tbaa !9
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %35, align 4, !tbaa !9
  br label %210, !llvm.loop !44

273:                                              ; preds = %214
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  br label %274

274:                                              ; preds = %273
  %275 = load i32, ptr %33, align 4, !tbaa !9
  %276 = add nsw i32 %275, 1
  store i32 %276, ptr %33, align 4, !tbaa !9
  br label %196, !llvm.loop !45

277:                                              ; preds = %199
  %278 = load ptr, ptr %24, align 8, !tbaa !5
  %279 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  %280 = call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  %281 = mul i64 %280, 4
  invoke void @ggml_backend_tensor_set(ptr noundef %278, ptr noundef %279, i64 noundef 0, i64 noundef %281)
          to label %282 unwind label %292

282:                                              ; preds = %277
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  %283 = load ptr, ptr %7, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.gpt2_model, ptr %283, i32 0, i32 9
  %285 = load ptr, ptr %284, align 8, !tbaa !46
  %286 = call zeroext i1 @ggml_backend_is_cpu(ptr noundef %285)
  br i1 %286, label %287, label %298

287:                                              ; preds = %282
  %288 = load ptr, ptr %7, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.gpt2_model, ptr %288, i32 0, i32 9
  %290 = load ptr, ptr %289, align 8, !tbaa !46
  %291 = load i32, ptr %9, align 4, !tbaa !9
  call void @ggml_backend_cpu_set_n_threads(ptr noundef %290, i32 noundef %291)
  br label %298

292:                                              ; preds = %277
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %30, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %31, align 4
  br label %296

296:                                              ; preds = %292, %261
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  br label %297

297:                                              ; preds = %296, %200
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %386

298:                                              ; preds = %287, %282
  %299 = load ptr, ptr %7, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.gpt2_model, ptr %299, i32 0, i32 9
  %301 = load ptr, ptr %300, align 8, !tbaa !46
  %302 = load ptr, ptr %18, align 8, !tbaa !5
  %303 = call i32 @ggml_backend_graph_compute(ptr noundef %301, ptr noundef %302)
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #5
  %304 = load ptr, ptr %18, align 8, !tbaa !5
  %305 = call ptr @ggml_graph_node(ptr noundef %304, i32 noundef -1)
  store ptr %305, ptr %39, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 5
  %307 = load ptr, ptr %306, align 8, !tbaa !57
  %308 = icmp ne ptr %307, null
  br i1 %308, label %309, label %351

309:                                              ; preds = %298
  %310 = load ptr, ptr %10, align 8, !tbaa !5
  %311 = load i32, ptr %13, align 4, !tbaa !9
  %312 = load i32, ptr %11, align 4, !tbaa !9
  %313 = mul nsw i32 %311, %312
  %314 = sext i32 %313 to i64
  call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %310, i64 noundef %314)
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #5
  store i32 0, ptr %40, align 4, !tbaa !9
  br label %315

315:                                              ; preds = %347, %309
  %316 = load i32, ptr %40, align 4, !tbaa !9
  %317 = load i32, ptr %11, align 4, !tbaa !9
  %318 = icmp slt i32 %316, %317
  br i1 %318, label %320, label %319

319:                                              ; preds = %315
  store i32 17, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #5
  br label %350

320:                                              ; preds = %315
  %321 = getelementptr inbounds %struct.gpt2_batch, ptr %2, i32 0, i32 5
  %322 = load ptr, ptr %321, align 8, !tbaa !57
  %323 = load i32, ptr %40, align 4, !tbaa !9
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds i8, ptr %322, i64 %324
  %326 = load i8, ptr %325, align 1, !tbaa !58
  %327 = sext i8 %326 to i32
  %328 = icmp eq i32 %327, 0
  br i1 %328, label %329, label %330

329:                                              ; preds = %320
  br label %347

330:                                              ; preds = %320
  %331 = load ptr, ptr %39, align 8, !tbaa !5
  %332 = load ptr, ptr %10, align 8, !tbaa !5
  %333 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %332) #5
  %334 = load i32, ptr %13, align 4, !tbaa !9
  %335 = load i32, ptr %40, align 4, !tbaa !9
  %336 = mul nsw i32 %334, %335
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds float, ptr %333, i64 %337
  %339 = load i32, ptr %13, align 4, !tbaa !9
  %340 = load i32, ptr %40, align 4, !tbaa !9
  %341 = mul nsw i32 %339, %340
  %342 = sext i32 %341 to i64
  %343 = mul i64 %342, 4
  %344 = load i32, ptr %13, align 4, !tbaa !9
  %345 = sext i32 %344 to i64
  %346 = mul i64 4, %345
  call void @ggml_backend_tensor_get(ptr noundef %331, ptr noundef %338, i64 noundef %343, i64 noundef %346)
  br label %347

347:                                              ; preds = %330, %329
  %348 = load i32, ptr %40, align 4, !tbaa !9
  %349 = add nsw i32 %348, 1
  store i32 %349, ptr %40, align 4, !tbaa !9
  br label %315, !llvm.loop !59

350:                                              ; preds = %319
  br label %367

351:                                              ; preds = %298
  %352 = load ptr, ptr %10, align 8, !tbaa !5
  %353 = load i32, ptr %13, align 4, !tbaa !9
  %354 = sext i32 %353 to i64
  call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %352, i64 noundef %354)
  %355 = load ptr, ptr %39, align 8, !tbaa !5
  %356 = load ptr, ptr %10, align 8, !tbaa !5
  %357 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %356) #5
  %358 = load i32, ptr %13, align 4, !tbaa !9
  %359 = load i32, ptr %11, align 4, !tbaa !9
  %360 = sub nsw i32 %359, 1
  %361 = mul nsw i32 %358, %360
  %362 = sext i32 %361 to i64
  %363 = mul i64 %362, 4
  %364 = load i32, ptr %13, align 4, !tbaa !9
  %365 = sext i32 %364 to i64
  %366 = mul i64 4, %365
  call void @ggml_backend_tensor_get(ptr noundef %355, ptr noundef %357, i64 noundef %363, i64 noundef %366)
  br label %367

367:                                              ; preds = %351, %350
  %368 = load i32, ptr %11, align 4, !tbaa !9
  %369 = load ptr, ptr %15, align 8, !tbaa !5
  %370 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %369, i32 0, i32 2
  %371 = load i32, ptr %370, align 8, !tbaa !19
  %372 = add i32 %371, %368
  store i32 %372, ptr %370, align 8, !tbaa !19
  %373 = load ptr, ptr %15, align 8, !tbaa !5
  %374 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %373, i32 0, i32 2
  %375 = load i32, ptr %374, align 8, !tbaa !19
  %376 = load ptr, ptr %15, align 8, !tbaa !5
  %377 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %376, i32 0, i32 3
  %378 = load i32, ptr %377, align 4, !tbaa !60
  %379 = icmp uge i32 %375, %378
  br i1 %379, label %380, label %382

380:                                              ; preds = %367
  %381 = call i32 (ptr, ...) @printf(ptr noundef @.str.50, ptr noundef @__func__._Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE)
  store i32 -2, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %383

382:                                              ; preds = %367
  store i32 0, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %383

383:                                              ; preds = %382, %380
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %384

384:                                              ; preds = %383, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %385 = load i32, ptr %6, align 4
  ret i32 %385

386:                                              ; preds = %297
  %387 = load ptr, ptr %30, align 8
  %388 = load i32, ptr %31, align 4
  %389 = insertvalue { ptr, i32 } poison, ptr %387, 0
  %390 = insertvalue { ptr, i32 } %389, i32 %388, 1
  resume { ptr, i32 } %390
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

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

declare ptr @ggml_graph_get_tensor(ptr noundef, ptr noundef) #1

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

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

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

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

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

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

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

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

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

declare i32 @ggml_backend_graph_compute(ptr noundef, ptr noundef) #1

declare ptr @ggml_graph_node(ptr noundef, i32 noundef) #1

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

declare void @ggml_backend_tensor_get(ptr noundef, ptr noundef, i64 noundef, i64 noundef) #1

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

attributes #0 = { 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 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 = { 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 #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 = { nounwind }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS10gpt2_batch", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTS12gpt2_hparams", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !15, i64 24}
!15 = !{!"float", !7, i64 0}
!16 = !{!12, !6, i64 8}
!17 = !{!12, !6, i64 16}
!18 = !{!12, !6, i64 24}
!19 = !{!20, !10, i64 16}
!20 = !{!"_ZTS13gpt2_kv_cache", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !21, i64 32, !6, i64 56}
!21 = !{!"_ZTSSt6vectorI12gpt2_kv_cellSaIS0_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseI12gpt2_kv_cellSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseI12gpt2_kv_cellSaIS0_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI12gpt2_kv_cellSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!26, !10, i64 0}
!26 = !{!"_ZTS12gpt2_kv_cell", !10, i64 0, !10, i64 4, !27, i64 8}
!27 = !{!"_ZTSSt3setIiSt4lessIiESaIiEE", !28, i64 0}
!28 = !{!"_ZTSSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE", !29, i64 0}
!29 = !{!"_ZTSNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE13_Rb_tree_implIS3_Lb1EEE", !30, i64 0, !32, i64 8}
!30 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !31, i64 0}
!31 = !{!"_ZTSSt4lessIiE"}
!32 = !{!"_ZTSSt15_Rb_tree_header", !33, i64 0, !35, i64 32}
!33 = !{!"_ZTSSt18_Rb_tree_node_base", !34, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!34 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!35 = !{!"long", !7, i64 0}
!36 = !{!12, !6, i64 32}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!20, !10, i64 24}
!40 = distinct !{!40, !38}
!41 = !{!14, !10, i64 8}
!42 = !{!15, !15, i64 0}
!43 = distinct !{!43, !38}
!44 = distinct !{!44, !38}
!45 = distinct !{!45, !38}
!46 = !{!47, !6, i64 168}
!47 = !{!"_ZTS10gpt2_model", !14, i64 0, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !48, i64 72, !20, i64 96, !6, i64 160, !6, i64 168, !6, i64 176, !52, i64 184}
!48 = !{!"_ZTSSt6vectorI10gpt2_layerSaIS0_EE", !49, i64 0}
!49 = !{!"_ZTSSt12_Vector_baseI10gpt2_layerSaIS0_EE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE12_Vector_implE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!52 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP11ggml_tensorSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !53, i64 0}
!53 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !54, i64 0}
!54 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !55, i64 0, !32, i64 8}
!55 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !56, i64 0}
!56 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!57 = !{!12, !6, i64 40}
!58 = !{!7, !7, i64 0}
!59 = distinct !{!59, !38}
!60 = !{!20, !10, i64 20}


; 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.gpt2_batch = type { i32, ptr, ptr, ptr, ptr, ptr }
%"class.std::vector.39" = type { %"struct.std::_Vector_base.40" }
%"struct.std::_Vector_base.40" = 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::allocator.41" = type { i8 }

@.str.41 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [18 x i8], align 1
@__func__._Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE = external hidden unnamed_addr constant [12 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [30 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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z10gpt2_graphRK10gpt2_modelRK10gpt2_batchb(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef nonnull align 8 dereferenceable(48), i1 noundef zeroext) local_unnamed_addr #3

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

declare i64 @ggml_element_size(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -2, 1) i32 @_Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef %1, ptr noundef byval(%struct.gpt2_batch) align 8 %2, i32 noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %4) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector.39", align 8
  %8 = alloca %"class.std::allocator.41", align 1
  %9 = alloca i32, align 4
  %10 = load i32, ptr %2, align 8, !tbaa !5
  %11 = load i32, ptr %0, align 8, !tbaa !11
  %12 = icmp eq i32 %10, 0
  br i1 %12, label %13, label %15

13:                                               ; preds = %5
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.48, ptr noundef nonnull @__func__._Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE)
  br label %156

15:                                               ; preds = %5
  %16 = getelementptr inbounds i8, ptr %2, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !14
  %18 = icmp eq ptr %17, null
  %19 = getelementptr inbounds i8, ptr %2, i64 16
  %20 = load ptr, ptr %19, align 8
  %21 = icmp ne ptr %20, null
  %or.cond119 = xor i1 %18, %21
  br i1 %or.cond119, label %27, label %.preheader

.preheader:                                       ; preds = %15
  %22 = icmp sgt i32 %10, 0
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %23 = getelementptr inbounds i8, ptr %2, i64 24
  %24 = getelementptr inbounds i8, ptr %0, i64 128
  %25 = getelementptr inbounds i8, ptr %0, i64 112
  %26 = getelementptr inbounds i8, ptr %2, i64 32
  %wide.trip.count = zext nneg i32 %10 to i64
  br label %35

27:                                               ; preds = %15
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.43, i32 noundef 886, ptr noundef nonnull @.str.44, ptr noundef nonnull @.str.49) #6
  unreachable

._crit_edge:                                      ; preds = %35, %.preheader
  %28 = getelementptr inbounds i8, ptr %0, i64 112
  %29 = load i32, ptr %28, align 8, !tbaa !15
  %30 = add i32 %29, %10
  %31 = getelementptr inbounds i8, ptr %0, i64 120
  store i32 %30, ptr %31, align 8, !tbaa !21
  %32 = call noundef ptr @_Z10gpt2_graphRK10gpt2_modelRK10gpt2_batchb(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(48) %2, i1 noundef zeroext false)
  %33 = call zeroext i1 @ggml_gallocr_alloc_graph(ptr noundef %1, ptr noundef %32)
  %34 = load ptr, ptr %16, align 8, !tbaa !14
  %.not = icmp eq ptr %34, null
  br i1 %.not, label %65, label %52

35:                                               ; preds = %.lr.ph, %35
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %35 ]
  %36 = load ptr, ptr %23, align 8, !tbaa !22
  %37 = getelementptr inbounds i32, ptr %36, i64 %indvars.iv
  %38 = load i32, ptr %37, align 4, !tbaa !23
  %39 = load i32, ptr %25, align 8, !tbaa !15
  %40 = trunc nuw nsw i64 %indvars.iv to i32
  %41 = add i32 %39, %40
  %42 = zext i32 %41 to i64
  %43 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI12gpt2_kv_cellSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %42) #7
  store i32 %38, ptr %43, align 8, !tbaa !24
  %44 = load i32, ptr %25, align 8, !tbaa !15
  %45 = add i32 %44, %40
  %46 = zext i32 %45 to i64
  %47 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI12gpt2_kv_cellSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %46) #7
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  %49 = load ptr, ptr %26, align 8, !tbaa !35
  %50 = getelementptr inbounds i32, ptr %49, i64 %indvars.iv
  %51 = tail call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %48, ptr noundef nonnull align 4 dereferenceable(4) %50)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %35, !llvm.loop !36

52:                                               ; preds = %._crit_edge
  %53 = call ptr @ggml_graph_get_tensor(ptr noundef %32, ptr noundef nonnull @.str.41)
  %54 = load ptr, ptr %16, align 8, !tbaa !14
  %55 = sext i32 %10 to i64
  %56 = call i64 @ggml_element_size(ptr noundef %53)
  %57 = mul i64 %56, %55
  call void @ggml_backend_tensor_set(ptr noundef %53, ptr noundef %54, i64 noundef 0, i64 noundef %57)
  %58 = call ptr @ggml_graph_get_tensor(ptr noundef %32, ptr noundef nonnull @.str.42)
  br i1 %22, label %.lr.ph124, label %.loopexit120

.lr.ph124:                                        ; preds = %52
  %59 = getelementptr inbounds i8, ptr %2, i64 24
  %wide.trip.count140 = zext nneg i32 %10 to i64
  br label %60

60:                                               ; preds = %.lr.ph124, %60
  %indvars.iv137 = phi i64 [ 0, %.lr.ph124 ], [ %indvars.iv.next138, %60 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %61 = load ptr, ptr %59, align 8, !tbaa !22
  %62 = getelementptr inbounds i32, ptr %61, i64 %indvars.iv137
  %63 = load i32, ptr %62, align 4, !tbaa !23
  store i32 %63, ptr %6, align 4, !tbaa !23
  %64 = shl nuw nsw i64 %indvars.iv137, 2
  call void @ggml_backend_tensor_set(ptr noundef %58, ptr noundef nonnull %6, i64 noundef %64, i64 noundef 4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %exitcond141.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count140
  br i1 %exitcond141.not, label %.loopexit120, label %60, !llvm.loop !38

65:                                               ; preds = %._crit_edge
  %66 = call ptr @ggml_graph_get_tensor(ptr noundef %32, ptr noundef nonnull @.str.46)
  %67 = load ptr, ptr %19, align 8, !tbaa !39
  %68 = getelementptr inbounds i8, ptr %0, i64 8
  %69 = load i32, ptr %68, align 8, !tbaa !40
  %70 = mul nsw i32 %69, %10
  %71 = sext i32 %70 to i64
  %72 = call i64 @ggml_element_size(ptr noundef %66)
  %73 = mul i64 %72, %71
  call void @ggml_backend_tensor_set(ptr noundef %66, ptr noundef %67, i64 noundef 0, i64 noundef %73)
  br label %.loopexit120

.loopexit120:                                     ; preds = %60, %52, %65
  %74 = call ptr @ggml_graph_get_tensor(ptr noundef %32, ptr noundef nonnull @.str.47)
  %75 = load i32, ptr %2, align 8, !tbaa !5
  %76 = load i32, ptr %31, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  %77 = mul nsw i32 %76, %75
  %78 = sext i32 %77 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #7
  call void @_ZNSaIfEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt6vectorIfSaIfEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %78, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %.critedge unwind label %105

.critedge:                                        ; preds = %.loopexit120
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  %79 = icmp sgt i32 %75, 0
  br i1 %79, label %.lr.ph130, label %._crit_edge131

.lr.ph130:                                        ; preds = %.critedge
  %80 = getelementptr inbounds i8, ptr %2, i64 24
  %81 = getelementptr inbounds i8, ptr %2, i64 32
  %82 = icmp sgt i32 %76, 0
  %83 = getelementptr inbounds i8, ptr %0, i64 128
  br i1 %82, label %.lr.ph127.us.preheader, label %._crit_edge131

.lr.ph127.us.preheader:                           ; preds = %.lr.ph130
  %84 = zext nneg i32 %76 to i64
  %wide.trip.count155 = zext nneg i32 %75 to i64
  br label %.lr.ph127.us

.lr.ph127.us:                                     ; preds = %.lr.ph127.us.preheader, %._crit_edge128.us
  %indvars.iv152 = phi i64 [ 0, %.lr.ph127.us.preheader ], [ %indvars.iv.next153, %._crit_edge128.us ]
  %85 = load ptr, ptr %80, align 8, !tbaa !22
  %86 = getelementptr inbounds i32, ptr %85, i64 %indvars.iv152
  %87 = load i32, ptr %86, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %88 = load ptr, ptr %81, align 8, !tbaa !35
  %89 = getelementptr inbounds i32, ptr %88, i64 %indvars.iv152
  %90 = load i32, ptr %89, align 4, !tbaa !23
  store i32 %90, ptr %9, align 4, !tbaa !23
  %91 = mul nuw nsw i64 %indvars.iv152, %84
  br label %92

92:                                               ; preds = %.lr.ph127.us, %103
  %indvars.iv147 = phi i64 [ 0, %.lr.ph127.us ], [ %indvars.iv.next148, %103 ]
  %93 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNKSt6vectorI12gpt2_kv_cellSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %indvars.iv147) #7
  %94 = invoke noundef zeroext i1 @_ZNK12gpt2_kv_cell10has_seq_idERKi(ptr noundef nonnull align 8 dereferenceable(56) %93, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %95 unwind label %.split.us

95:                                               ; preds = %92
  br i1 %94, label %96, label %100

96:                                               ; preds = %95
  %97 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNKSt6vectorI12gpt2_kv_cellSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %indvars.iv147) #7
  %98 = load i32, ptr %97, align 8, !tbaa !24
  %99 = icmp sgt i32 %98, %87
  br i1 %99, label %100, label %103

100:                                              ; preds = %96, %95
  %101 = add nuw nsw i64 %indvars.iv147, %91
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %101) #7
  store float 0xFFF0000000000000, ptr %102, align 4, !tbaa !41
  br label %103

103:                                              ; preds = %100, %96
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %exitcond151.not = icmp eq i64 %indvars.iv.next148, %84
  br i1 %exitcond151.not, label %._crit_edge128.us, label %92, !llvm.loop !42

._crit_edge128.us:                                ; preds = %103
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1
  %exitcond156.not = icmp eq i64 %indvars.iv.next153, %wide.trip.count155
  br i1 %exitcond156.not, label %._crit_edge131, label %.lr.ph127.us, !llvm.loop !43

.split.us:                                        ; preds = %92
  %104 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %118

105:                                              ; preds = %.loopexit120
  %106 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  br label %119

._crit_edge131:                                   ; preds = %._crit_edge128.us, %.lr.ph130, %.critedge
  %107 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %108 = call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %109 = shl i64 %108, 2
  invoke void @ggml_backend_tensor_set(ptr noundef %74, ptr noundef %107, i64 noundef 0, i64 noundef %109)
          to label %110 unwind label %116

110:                                              ; preds = %._crit_edge131
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  %111 = getelementptr inbounds i8, ptr %0, i64 168
  %112 = load ptr, ptr %111, align 8, !tbaa !44
  %113 = call zeroext i1 @ggml_backend_is_cpu(ptr noundef %112)
  br i1 %113, label %114, label %120

114:                                              ; preds = %110
  %115 = load ptr, ptr %111, align 8, !tbaa !44
  call void @ggml_backend_cpu_set_n_threads(ptr noundef %115, i32 noundef %3)
  br label %120

116:                                              ; preds = %._crit_edge131
  %117 = landingpad { ptr, i32 }
          cleanup
  br label %118

118:                                              ; preds = %116, %.split.us
  %.pn = phi { ptr, i32 } [ %104, %.split.us ], [ %117, %116 ]
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  br label %119

119:                                              ; preds = %118, %105
  %.pn.pn = phi { ptr, i32 } [ %.pn, %118 ], [ %106, %105 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  resume { ptr, i32 } %.pn.pn

120:                                              ; preds = %114, %110
  %121 = load ptr, ptr %111, align 8, !tbaa !44
  %122 = call i32 @ggml_backend_graph_compute(ptr noundef %121, ptr noundef %32)
  %123 = call ptr @ggml_graph_node(ptr noundef %32, i32 noundef -1)
  %124 = getelementptr inbounds i8, ptr %2, i64 40
  %125 = load ptr, ptr %124, align 8, !tbaa !55
  %.not115 = icmp eq ptr %125, null
  br i1 %.not115, label %142, label %126

126:                                              ; preds = %120
  %127 = mul nsw i32 %11, %10
  %128 = sext i32 %127 to i64
  call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %128)
  br i1 %22, label %.lr.ph134, label %.loopexit

.lr.ph134:                                        ; preds = %126
  %129 = sext i32 %11 to i64
  %130 = shl nsw i64 %129, 2
  %wide.trip.count160 = zext nneg i32 %10 to i64
  br label %131

131:                                              ; preds = %.lr.ph134, %141
  %indvars.iv157 = phi i64 [ 0, %.lr.ph134 ], [ %indvars.iv.next158, %141 ]
  %132 = load ptr, ptr %124, align 8, !tbaa !55
  %133 = getelementptr inbounds i8, ptr %132, i64 %indvars.iv157
  %134 = load i8, ptr %133, align 1, !tbaa !56
  %135 = icmp eq i8 %134, 0
  br i1 %135, label %141, label %136

136:                                              ; preds = %131
  %137 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %138 = mul nsw i64 %indvars.iv157, %129
  %139 = getelementptr inbounds float, ptr %137, i64 %138
  %140 = shl nsw i64 %138, 2
  call void @ggml_backend_tensor_get(ptr noundef %123, ptr noundef %139, i64 noundef %140, i64 noundef %130)
  br label %141

141:                                              ; preds = %131, %136
  %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
  %exitcond161.not = icmp eq i64 %indvars.iv.next158, %wide.trip.count160
  br i1 %exitcond161.not, label %.loopexit, label %131, !llvm.loop !57

142:                                              ; preds = %120
  %143 = sext i32 %11 to i64
  call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %143)
  %144 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %145 = add nsw i32 %10, -1
  %146 = mul nsw i32 %11, %145
  %147 = sext i32 %146 to i64
  %148 = shl nsw i64 %147, 2
  %149 = shl nsw i64 %143, 2
  call void @ggml_backend_tensor_get(ptr noundef %123, ptr noundef %144, i64 noundef %148, i64 noundef %149)
  br label %.loopexit

.loopexit:                                        ; preds = %141, %126, %142
  %150 = load i32, ptr %28, align 8, !tbaa !15
  %151 = add i32 %150, %10
  store i32 %151, ptr %28, align 8, !tbaa !15
  %152 = getelementptr inbounds i8, ptr %0, i64 116
  %153 = load i32, ptr %152, align 4, !tbaa !58
  %.not116 = icmp ult i32 %151, %153
  br i1 %.not116, label %156, label %154

154:                                              ; preds = %.loopexit
  %155 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.50, ptr noundef nonnull @__func__._Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE)
  br label %156

156:                                              ; preds = %154, %.loopexit, %13
  %.1 = phi i32 [ -1, %13 ], [ -2, %154 ], [ 0, %.loopexit ]
  ret i32 %.1
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK12gpt2_kv_cell10has_seq_idERKi(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

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

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

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

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

declare i32 @ggml_backend_graph_compute(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @ggml_graph_node(ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare void @ggml_backend_tensor_get(ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS10gpt2_batch", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"_ZTS12gpt2_hparams", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !13, i64 24}
!13 = !{!"float", !8, i64 0}
!14 = !{!6, !10, i64 8}
!15 = !{!16, !7, i64 16}
!16 = !{!"_ZTS13gpt2_kv_cache", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !17, i64 32, !10, i64 56}
!17 = !{!"_ZTSSt6vectorI12gpt2_kv_cellSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseI12gpt2_kv_cellSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI12gpt2_kv_cellSaIS0_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI12gpt2_kv_cellSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!21 = !{!16, !7, i64 24}
!22 = !{!6, !10, i64 24}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !7, i64 0}
!25 = !{!"_ZTS12gpt2_kv_cell", !7, i64 0, !7, i64 4, !26, i64 8}
!26 = !{!"_ZTSSt3setIiSt4lessIiESaIiEE", !27, i64 0}
!27 = !{!"_ZTSSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE", !28, i64 0}
!28 = !{!"_ZTSNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE13_Rb_tree_implIS3_Lb1EEE", !29, i64 0, !31, i64 8}
!29 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !30, i64 0}
!30 = !{!"_ZTSSt4lessIiE"}
!31 = !{!"_ZTSSt15_Rb_tree_header", !32, i64 0, !34, i64 32}
!32 = !{!"_ZTSSt18_Rb_tree_node_base", !33, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!33 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!34 = !{!"long", !8, i64 0}
!35 = !{!6, !10, i64 32}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}
!39 = !{!6, !10, i64 16}
!40 = !{!12, !7, i64 8}
!41 = !{!13, !13, i64 0}
!42 = distinct !{!42, !37}
!43 = distinct !{!43, !37}
!44 = !{!45, !10, i64 168}
!45 = !{!"_ZTS10gpt2_model", !12, i64 0, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !46, i64 72, !16, i64 96, !10, i64 160, !10, i64 168, !10, i64 176, !50, i64 184}
!46 = !{!"_ZTSSt6vectorI10gpt2_layerSaIS0_EE", !47, i64 0}
!47 = !{!"_ZTSSt12_Vector_baseI10gpt2_layerSaIS0_EE", !48, i64 0}
!48 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE12_Vector_implE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!50 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP11ggml_tensorSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !51, i64 0}
!51 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !52, i64 0}
!52 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !53, i64 0, !31, i64 8}
!53 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !54, i64 0}
!54 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!55 = !{!6, !10, i64 40}
!56 = !{!8, !8, i64 0}
!57 = distinct !{!57, !37}
!58 = !{!16, !7, i64 20}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass