; 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.gpt_params = type { i32, i32, i32, i32, i32, i32, i32, i8, i32, float, float, i32, float, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i8, i32 }
%"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] }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }
%struct.gpt_vocab = type { %"class.std::map.19", %"class.std::map.24", %"class.std::vector" }
%"class.std::map.19" = type { %"class.std::_Rb_tree.20" }
%"class.std::_Rb_tree.20" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, 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>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, 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 }
%"class.std::map.24" = type { %"class.std::_Rb_tree.25" }
%"class.std::_Rb_tree.25" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const int, std::__cxx11::basic_string<char>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const int, std::__cxx11::basic_string<char>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%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" }
%"class.std::vector.44" = type { %"struct.std::_Vector_base.45" }
%"struct.std::_Vector_base.45" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { 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" = type { i8 }
%"class.std::allocator.46" = type { i8 }

@stderr = external global ptr, align 8
@.str.51 = external hidden unnamed_addr constant [15 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [3 x i8], align 1
@stdout = external global ptr, align 8
@.str.63 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.69 = 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: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z15gpt2_model_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10gpt2_modelR9gpt_vocabii(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(232), ptr noundef nonnull align 8 dereferenceable(120), i32 noundef, i32 noundef) #2

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

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

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

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

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

; 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

declare void @ggml_free(ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z15gpt2_batch_initii(ptr dead_on_unwind noalias writable sret(%struct.gpt2_batch) align 8, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z15gpt2_batch_free10gpt2_batch(ptr noundef byval(%struct.gpt2_batch) align 8) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef, ptr noundef byval(%struct.gpt2_batch) align 8, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #6 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca %struct.gpt_params, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::mersenne_twister_engine", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca i64, align 8
  %14 = alloca %struct.gpt_vocab, align 8
  %15 = alloca %struct.gpt2_model, align 8
  %16 = alloca i64, align 8
  %17 = alloca %"class.std::vector.44", align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca %struct.gpt2_batch, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca %"class.std::vector.39", align 8
  %29 = alloca i32, align 4
  %30 = alloca %struct.gpt2_batch, align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca %"class.std::vector", align 8
  %37 = alloca %"class.std::allocator", align 1
  %38 = alloca %"class.std::vector.44", align 8
  %39 = alloca i32, align 4
  %40 = alloca %"class.std::allocator.46", align 1
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca float, align 4
  %47 = alloca float, align 4
  %48 = alloca i32, align 4
  %49 = alloca ptr, align 8
  %50 = alloca i32, align 4
  %51 = alloca i64, align 8
  %52 = alloca ptr, align 8
  %53 = alloca i64, align 8
  %54 = alloca i32, align 4
  %55 = alloca %struct.gpt2_batch, align 8
  %56 = alloca i32, align 4
  %57 = alloca i64, align 8
  %58 = alloca %struct.gpt2_batch, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @ggml_time_init()
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %59 = call i64 @ggml_time_us()
  store i64 %59, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 160, ptr %7) #9
  call void @_ZN10gpt_paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(160) %7)
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = load ptr, ptr %5, align 8, !tbaa !9
  %62 = invoke noundef zeroext i1 @_Z16gpt_params_parseiPPcR10gpt_params(i32 noundef %60, ptr noundef %61, ptr noundef nonnull align 8 dereferenceable(160) %7)
          to label %63 unwind label %67

63:                                               ; preds = %2
  %64 = zext i1 %62 to i32
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %71

66:                                               ; preds = %63
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %643

67:                                               ; preds = %79, %2
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %8, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %9, align 4
  br label %645

71:                                               ; preds = %63
  %72 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 0
  %73 = load i32, ptr %72, align 8, !tbaa !13
  %74 = icmp slt i32 %73, 0
  br i1 %74, label %75, label %79

75:                                               ; preds = %71
  %76 = call i64 @time(ptr noundef null) #9
  %77 = trunc i64 %76 to i32
  %78 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 0
  store i32 %77, ptr %78, align 8, !tbaa !13
  br label %79

79:                                               ; preds = %75, %71
  %80 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 0
  %81 = load i32, ptr %80, align 8, !tbaa !13
  %82 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.51, ptr noundef @__func__.main, i32 noundef %81)
          to label %83 unwind label %67

83:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 5000, ptr %11) #9
  %84 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 0
  %85 = load i32, ptr %84, align 8, !tbaa !13
  %86 = sext i32 %85 to i64
  invoke void @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEC2Em(ptr noundef nonnull align 8 dereferenceable(5000) %11, i64 noundef %86)
          to label %87 unwind label %94

87:                                               ; preds = %83
  %88 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 14
  %89 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %88) #9
  br i1 %89, label %90, label %102

90:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #9
  invoke void @_Z17gpt_random_promptB5cxx11RSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %12, ptr noundef nonnull align 8 dereferenceable(5000) %11)
          to label %91 unwind label %98

91:                                               ; preds = %90
  %92 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 14
  %93 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %92, ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #9
  br label %102

94:                                               ; preds = %83
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %8, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %9, align 4
  br label %642

98:                                               ; preds = %90
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %8, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #9
  br label %642

102:                                              ; preds = %91, %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  store i64 0, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 120, ptr %14) #9
  call void @_ZN9gpt_vocabC2Ev(ptr noundef nonnull align 8 dereferenceable(120) %14) #9
  call void @llvm.lifetime.start.p0(i64 232, ptr %15) #9
  call void @_ZN10gpt2_modelC2Ev(ptr noundef nonnull align 8 dereferenceable(232) %15) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %103 = invoke i64 @ggml_time_us()
          to label %104 unwind label %117

104:                                              ; preds = %102
  store i64 %103, ptr %16, align 8, !tbaa !11
  %105 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 13
  %106 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 5
  %107 = load i32, ptr %106, align 4, !tbaa !19
  %108 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 6
  %109 = load i32, ptr %108, align 8, !tbaa !20
  %110 = invoke noundef zeroext i1 @_Z15gpt2_model_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10gpt2_modelR9gpt_vocabii(ptr noundef nonnull align 8 dereferenceable(32) %105, ptr noundef nonnull align 8 dereferenceable(232) %15, ptr noundef nonnull align 8 dereferenceable(120) %14, i32 noundef %107, i32 noundef %109)
          to label %111 unwind label %117

111:                                              ; preds = %104
  br i1 %110, label %121, label %112

112:                                              ; preds = %111
  %113 = load ptr, ptr @stderr, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 13
  %115 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %114) #9
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef @.str.52, ptr noundef @__func__.main, ptr noundef %115) #9
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %128

117:                                              ; preds = %123, %121, %104, %102
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %8, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br label %641

121:                                              ; preds = %111
  %122 = invoke i64 @ggml_time_us()
          to label %123 unwind label %117

123:                                              ; preds = %121
  %124 = load i64, ptr %16, align 8, !tbaa !11
  %125 = sub nsw i64 %122, %124
  store i64 %125, ptr %13, align 8, !tbaa !11
  %126 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 15
  invoke void @_Z18test_gpt_tokenizerR9gpt_vocabRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(120) %14, ptr noundef nonnull align 8 dereferenceable(32) %126)
          to label %127 unwind label %117

127:                                              ; preds = %123
  store i32 0, ptr %10, align 4
  br label %128

128:                                              ; preds = %127, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  %129 = load i32, ptr %10, align 4
  switch i32 %129, label %640 [
    i32 0, label %130
  ]

130:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #9
  %131 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 14
  invoke void @_Z12gpt_tokenizeRK9gpt_vocabRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::vector.44") align 8 %17, ptr noundef nonnull align 8 dereferenceable(120) %14, ptr noundef nonnull align 8 dereferenceable(32) %131)
          to label %132 unwind label %175

132:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  %133 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 3
  %134 = load i32, ptr %133, align 4, !tbaa !21
  store i32 %134, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  %135 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #9
  store i64 %135, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %136 = load i32, ptr %18, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  store i64 %137, ptr %21, align 8, !tbaa !11
  %138 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %139 unwind label %179

139:                                              ; preds = %132
  %140 = load i64, ptr %138, align 8, !tbaa !11
  %141 = trunc i64 %140 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  store i32 %141, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %22) #9
  %142 = load i32, ptr %19, align 4, !tbaa !5
  call void @_Z15gpt2_batch_initii(ptr dead_on_unwind writable sret(%struct.gpt2_batch) align 8 %22, i32 noundef %142, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  store ptr null, ptr %23, align 8, !tbaa !9
  %143 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 9
  %144 = load ptr, ptr %143, align 8, !tbaa !22
  %145 = invoke ptr @ggml_backend_get_default_buffer_type(ptr noundef %144)
          to label %146 unwind label %183

146:                                              ; preds = %139
  %147 = invoke ptr @ggml_gallocr_new(ptr noundef %145)
          to label %148 unwind label %183

148:                                              ; preds = %146
  store ptr %147, ptr %23, align 8, !tbaa !9
  %149 = load i32, ptr %19, align 4, !tbaa !5
  %150 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  store i32 %149, ptr %150, align 8, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #9
  %151 = invoke noundef ptr @_Z10gpt2_graphRK10gpt2_modelRK10gpt2_batchb(ptr noundef nonnull align 8 dereferenceable(232) %15, ptr noundef nonnull align 8 dereferenceable(48) %22, i1 noundef zeroext true)
          to label %152 unwind label %187

152:                                              ; preds = %148
  store ptr %151, ptr %24, align 8, !tbaa !9
  %153 = load ptr, ptr %23, align 8, !tbaa !9
  %154 = load ptr, ptr %24, align 8, !tbaa !9
  %155 = invoke zeroext i1 @ggml_gallocr_reserve(ptr noundef %153, ptr noundef %154)
          to label %156 unwind label %187

156:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  %157 = load ptr, ptr %23, align 8, !tbaa !9
  %158 = invoke i64 @ggml_gallocr_get_buffer_size(ptr noundef %157, i32 noundef 0)
          to label %159 unwind label %191

159:                                              ; preds = %156
  store i64 %158, ptr %25, align 8, !tbaa !11
  %160 = load ptr, ptr @stderr, align 8, !tbaa !9
  %161 = load i64, ptr %25, align 8, !tbaa !11
  %162 = uitofp i64 %161 to double
  %163 = fdiv double %162, 1.024000e+03
  %164 = fdiv double %163, 1.024000e+03
  %165 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %160, ptr noundef @.str.53, ptr noundef @__func__.main, double noundef %164) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  store i64 0, ptr %26, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  store i64 0, ptr %27, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #9
  call void @_ZNSt6vectorIfSaIfEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #9
  %166 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #9
  %167 = trunc i64 %166 to i32
  %168 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  store i32 %167, ptr %168, align 8, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %222, %159
  %170 = load i32, ptr %29, align 4, !tbaa !5
  %171 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %172 = load i32, ptr %171, align 8, !tbaa !42
  %173 = icmp slt i32 %170, %172
  br i1 %173, label %196, label %174

174:                                              ; preds = %169
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  br label %225

175:                                              ; preds = %130
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %8, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %9, align 4
  br label %639

179:                                              ; preds = %132
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %8, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  br label %638

183:                                              ; preds = %146, %139
  %184 = landingpad { ptr, i32 }
          cleanup
  %185 = extractvalue { ptr, i32 } %184, 0
  store ptr %185, ptr %8, align 8
  %186 = extractvalue { ptr, i32 } %184, 1
  store i32 %186, ptr %9, align 4
  br label %637

187:                                              ; preds = %152, %148
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %8, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %9, align 4
  br label %195

191:                                              ; preds = %156
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %8, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  br label %195

195:                                              ; preds = %191, %187
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  br label %637

196:                                              ; preds = %169
  %197 = load i32, ptr %29, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %198) #9
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 1
  %202 = load ptr, ptr %201, align 8, !tbaa !44
  %203 = load i32, ptr %29, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds i32, ptr %202, i64 %204
  store i32 %200, ptr %205, align 4, !tbaa !5
  %206 = load i32, ptr %29, align 4, !tbaa !5
  %207 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 3
  %208 = load ptr, ptr %207, align 8, !tbaa !45
  %209 = load i32, ptr %29, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds i32, ptr %208, i64 %210
  store i32 %206, ptr %211, align 4, !tbaa !5
  %212 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 4
  %213 = load ptr, ptr %212, align 8, !tbaa !46
  %214 = load i32, ptr %29, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds i32, ptr %213, i64 %215
  store i32 0, ptr %216, align 4, !tbaa !5
  %217 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 5
  %218 = load ptr, ptr %217, align 8, !tbaa !47
  %219 = load i32, ptr %29, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds i8, ptr %218, i64 %220
  store i8 0, ptr %221, align 1, !tbaa !48
  br label %222

222:                                              ; preds = %196
  %223 = load i32, ptr %29, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %29, align 4, !tbaa !5
  br label %169, !llvm.loop !49

225:                                              ; preds = %174
  %226 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 5
  %227 = load ptr, ptr %226, align 8, !tbaa !47
  %228 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %229 = load i32, ptr %228, align 8, !tbaa !42
  %230 = sub nsw i32 %229, 1
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds i8, ptr %227, i64 %231
  store i8 1, ptr %232, align 1, !tbaa !48
  %233 = load ptr, ptr %23, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %30, ptr align 8 %22, i64 48, i1 false), !tbaa.struct !51
  %234 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 1
  %235 = load i32, ptr %234, align 4, !tbaa !52
  %236 = invoke noundef i32 @_Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(232) %15, ptr noundef %233, ptr noundef byval(%struct.gpt2_batch) align 8 %30, i32 noundef %235, ptr noundef nonnull align 8 dereferenceable(24) %28)
          to label %237 unwind label %242

237:                                              ; preds = %225
  %238 = icmp ne i32 %236, 0
  br i1 %238, label %239, label %246

239:                                              ; preds = %237
  %240 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.54, ptr noundef @__func__.main)
          to label %241 unwind label %242

241:                                              ; preds = %239
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %635

242:                                              ; preds = %323, %287, %281, %268, %239, %225
  %243 = landingpad { ptr, i32 }
          cleanup
  %244 = extractvalue { ptr, i32 } %243, 0
  store ptr %244, ptr %8, align 8
  %245 = extractvalue { ptr, i32 } %243, 1
  store i32 %245, ptr %9, align 4
  br label %636

246:                                              ; preds = %237
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #9
  store i32 1, ptr %31, align 4, !tbaa !5
  br label %247

247:                                              ; preds = %258, %246
  %248 = load i32, ptr %31, align 4, !tbaa !5
  %249 = load i32, ptr %18, align 4, !tbaa !5
  %250 = icmp slt i32 %248, %249
  br i1 %250, label %252, label %251

251:                                              ; preds = %247
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  br label %265

252:                                              ; preds = %247
  %253 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 7
  %254 = load i32, ptr %31, align 4, !tbaa !5
  %255 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %256 = load i32, ptr %255, align 8, !tbaa !42
  invoke void @_ZL20gpt2_kv_cache_seq_cpR13gpt2_kv_cacheiiii(ptr noundef nonnull align 8 dereferenceable(64) %253, i32 noundef 0, i32 noundef %254, i32 noundef 0, i32 noundef %256)
          to label %257 unwind label %261

257:                                              ; preds = %252
  br label %258

258:                                              ; preds = %257
  %259 = load i32, ptr %31, align 4, !tbaa !5
  %260 = add nsw i32 %259, 1
  store i32 %260, ptr %31, align 4, !tbaa !5
  br label %247, !llvm.loop !53

261:                                              ; preds = %252
  %262 = landingpad { ptr, i32 }
          cleanup
  %263 = extractvalue { ptr, i32 } %262, 0
  store ptr %263, ptr %8, align 8
  %264 = extractvalue { ptr, i32 } %262, 1
  store i32 %264, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  br label %636

265:                                              ; preds = %251
  %266 = load i32, ptr %18, align 4, !tbaa !5
  %267 = icmp sgt i32 %266, 1
  br i1 %267, label %268, label %272

268:                                              ; preds = %265
  %269 = load i32, ptr %18, align 4, !tbaa !5
  %270 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.55, ptr noundef @__func__.main, i32 noundef %269)
          to label %271 unwind label %242

271:                                              ; preds = %268
  br label %272

272:                                              ; preds = %271, %265
  %273 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #9
  %274 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 0
  %275 = getelementptr inbounds %struct.gpt2_hparams, ptr %274, i32 0, i32 1
  %276 = load i32, ptr %275, align 4, !tbaa !54
  %277 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #9
  %278 = trunc i64 %277 to i32
  %279 = sub nsw i32 %276, %278
  store i32 %279, ptr %32, align 4, !tbaa !5
  %280 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %273, ptr noundef nonnull align 4 dereferenceable(4) %32)
          to label %281 unwind label %300

281:                                              ; preds = %272
  %282 = load i32, ptr %280, align 4, !tbaa !5
  %283 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 2
  store i32 %282, ptr %283, align 8, !tbaa !55
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  %284 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 14
  %285 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %284) #9
  %286 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.56, ptr noundef @__func__.main, ptr noundef %285)
          to label %287 unwind label %242

287:                                              ; preds = %281
  %288 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #9
  %289 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.57, ptr noundef @__func__.main, i64 noundef %288)
          to label %290 unwind label %242

290:                                              ; preds = %287
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #9
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %291

291:                                              ; preds = %315, %290
  %292 = load i32, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #9
  store i32 8, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #9
  %293 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #9
  %294 = trunc i64 %293 to i32
  store i32 %294, ptr %35, align 4, !tbaa !5
  %295 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %34, ptr noundef nonnull align 4 dereferenceable(4) %35)
          to label %296 unwind label %304

296:                                              ; preds = %291
  %297 = load i32, ptr %295, align 4, !tbaa !5
  %298 = icmp slt i32 %292, %297
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  br i1 %298, label %308, label %299

299:                                              ; preds = %296
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  br label %323

300:                                              ; preds = %272
  %301 = landingpad { ptr, i32 }
          cleanup
  %302 = extractvalue { ptr, i32 } %301, 0
  store ptr %302, ptr %8, align 8
  %303 = extractvalue { ptr, i32 } %301, 1
  store i32 %303, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  br label %636

304:                                              ; preds = %291
  %305 = landingpad { ptr, i32 }
          cleanup
  %306 = extractvalue { ptr, i32 } %305, 0
  store ptr %306, ptr %8, align 8
  %307 = extractvalue { ptr, i32 } %305, 1
  store i32 %307, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  br label %322

308:                                              ; preds = %296
  %309 = load i32, ptr %33, align 4, !tbaa !5
  %310 = sext i32 %309 to i64
  %311 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %310) #9
  %312 = load i32, ptr %311, align 4, !tbaa !5
  %313 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.58, i32 noundef %312)
          to label %314 unwind label %318

314:                                              ; preds = %308
  br label %315

315:                                              ; preds = %314
  %316 = load i32, ptr %33, align 4, !tbaa !5
  %317 = add nsw i32 %316, 1
  store i32 %317, ptr %33, align 4, !tbaa !5
  br label %291, !llvm.loop !56

318:                                              ; preds = %308
  %319 = landingpad { ptr, i32 }
          cleanup
  %320 = extractvalue { ptr, i32 } %319, 0
  store ptr %320, ptr %8, align 8
  %321 = extractvalue { ptr, i32 } %319, 1
  store i32 %321, ptr %9, align 4
  br label %322

322:                                              ; preds = %318, %304
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  br label %636

323:                                              ; preds = %299
  %324 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.59)
          to label %325 unwind label %242

325:                                              ; preds = %323
  call void @llvm.lifetime.start.p0(i64 24, ptr %36) #9
  %326 = load i32, ptr %18, align 4, !tbaa !5
  %327 = sext i32 %326 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %37) #9
  call void @_ZNSaINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #9
  invoke void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2EmRKS6_(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %327, ptr noundef nonnull align 1 dereferenceable(1) %37)
          to label %328 unwind label %362

328:                                              ; preds = %325
  call void @_ZNSt15__new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr %38) #9
  %329 = load i32, ptr %18, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #9
  %331 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %332 = load i32, ptr %331, align 8, !tbaa !42
  %333 = sub nsw i32 %332, 1
  store i32 %333, ptr %39, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %40) #9
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %40) #9
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %330, ptr noundef nonnull align 4 dereferenceable(4) %39, ptr noundef nonnull align 1 dereferenceable(1) %40)
          to label %334 unwind label %366

334:                                              ; preds = %328
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %40) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %40) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #9
  %335 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %336 = load i32, ptr %335, align 8, !tbaa !42
  store i32 %336, ptr %41, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #9
  %337 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %338 = load i32, ptr %337, align 8, !tbaa !42
  %339 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 2
  %340 = load i32, ptr %339, align 8, !tbaa !55
  %341 = add nsw i32 %338, %340
  store i32 %341, ptr %42, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #9
  store i32 0, ptr %43, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #9
  %342 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 0
  %343 = getelementptr inbounds %struct.gpt2_hparams, ptr %342, i32 0, i32 0
  %344 = load i32, ptr %343, align 8, !tbaa !57
  store i32 %344, ptr %44, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #9
  %345 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 8
  %346 = load i32, ptr %345, align 8, !tbaa !58
  store i32 %346, ptr %45, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #9
  %347 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 9
  %348 = load float, ptr %347, align 4, !tbaa !59
  store float %348, ptr %46, align 4, !tbaa !60
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #9
  %349 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 10
  %350 = load float, ptr %349, align 8, !tbaa !61
  store float %350, ptr %47, align 4, !tbaa !60
  br label %351

351:                                              ; preds = %543, %334
  %352 = load i32, ptr %41, align 4, !tbaa !5
  %353 = load i32, ptr %42, align 4, !tbaa !5
  %354 = icmp slt i32 %352, %353
  br i1 %354, label %355, label %545

355:                                              ; preds = %351
  %356 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  store i32 0, ptr %356, align 8, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #9
  store i32 0, ptr %48, align 4, !tbaa !5
  br label %357

357:                                              ; preds = %501, %355
  %358 = load i32, ptr %48, align 4, !tbaa !5
  %359 = load i32, ptr %18, align 4, !tbaa !5
  %360 = icmp slt i32 %358, %359
  br i1 %360, label %370, label %361

361:                                              ; preds = %357
  store i32 13, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #9
  br label %505

362:                                              ; preds = %325
  %363 = landingpad { ptr, i32 }
          cleanup
  %364 = extractvalue { ptr, i32 } %363, 0
  store ptr %364, ptr %8, align 8
  %365 = extractvalue { ptr, i32 } %363, 1
  store i32 %365, ptr %9, align 4
  call void @_ZNSt15__new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #9
  br label %634

366:                                              ; preds = %328
  %367 = landingpad { ptr, i32 }
          cleanup
  %368 = extractvalue { ptr, i32 } %367, 0
  store ptr %368, ptr %8, align 8
  %369 = extractvalue { ptr, i32 } %367, 1
  store i32 %369, ptr %9, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %40) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %40) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %633

370:                                              ; preds = %357
  %371 = load i32, ptr %48, align 4, !tbaa !5
  %372 = sext i32 %371 to i64
  %373 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %372) #9
  %374 = load i32, ptr %373, align 4, !tbaa !5
  %375 = icmp slt i32 %374, 0
  br i1 %375, label %376, label %377

376:                                              ; preds = %370
  br label %501

377:                                              ; preds = %370
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #9
  %378 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #9
  %379 = load i32, ptr %48, align 4, !tbaa !5
  %380 = sext i32 %379 to i64
  %381 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %380) #9
  %382 = load i32, ptr %381, align 4, !tbaa !5
  %383 = load i32, ptr %44, align 4, !tbaa !5
  %384 = mul nsw i32 %382, %383
  %385 = sext i32 %384 to i64
  %386 = getelementptr inbounds float, ptr %378, i64 %385
  store ptr %386, ptr %49, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #9
  store i32 0, ptr %50, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #9
  %387 = invoke i64 @ggml_time_us()
          to label %388 unwind label %427

388:                                              ; preds = %377
  store i64 %387, ptr %51, align 8, !tbaa !11
  %389 = load ptr, ptr %49, align 8, !tbaa !9
  %390 = load i32, ptr %45, align 4, !tbaa !5
  %391 = load float, ptr %46, align 4, !tbaa !60
  %392 = fpext float %391 to double
  %393 = load float, ptr %47, align 4, !tbaa !60
  %394 = fpext float %393 to double
  %395 = invoke noundef i32 @_Z22gpt_sample_top_k_top_pRK9gpt_vocabPKfiddRSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE(ptr noundef nonnull align 8 dereferenceable(120) %14, ptr noundef %389, i32 noundef %390, double noundef %392, double noundef %394, ptr noundef nonnull align 8 dereferenceable(5000) %11)
          to label %396 unwind label %427

396:                                              ; preds = %388
  store i32 %395, ptr %50, align 4, !tbaa !5
  %397 = invoke i64 @ggml_time_us()
          to label %398 unwind label %427

398:                                              ; preds = %396
  %399 = load i64, ptr %51, align 8, !tbaa !11
  %400 = sub nsw i64 %397, %399
  %401 = load i64, ptr %26, align 8, !tbaa !11
  %402 = add nsw i64 %401, %400
  store i64 %402, ptr %26, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #9
  %403 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 7
  %404 = load i8, ptr %403, align 4, !tbaa !62, !range !63, !noundef !64
  %405 = trunc i8 %404 to i1
  br i1 %405, label %409, label %406

406:                                              ; preds = %398
  %407 = load i32, ptr %50, align 4, !tbaa !5
  %408 = icmp eq i32 %407, 50256
  br i1 %408, label %414, label %409

409:                                              ; preds = %406, %398
  %410 = load i32, ptr %41, align 4, !tbaa !5
  %411 = load i32, ptr %42, align 4, !tbaa !5
  %412 = sub nsw i32 %411, 1
  %413 = icmp eq i32 %410, %412
  br i1 %413, label %414, label %436

414:                                              ; preds = %409, %406
  %415 = load i32, ptr %48, align 4, !tbaa !5
  %416 = sext i32 %415 to i64
  %417 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %416) #9
  store i32 -1, ptr %417, align 4, !tbaa !5
  %418 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.60)
          to label %419 unwind label %431

419:                                              ; preds = %414
  %420 = load i32, ptr %18, align 4, !tbaa !5
  %421 = icmp sgt i32 %420, 1
  br i1 %421, label %422, label %435

422:                                              ; preds = %419
  %423 = load i32, ptr %48, align 4, !tbaa !5
  %424 = load i32, ptr %41, align 4, !tbaa !5
  %425 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.61, ptr noundef @__func__.main, i32 noundef %423, i32 noundef %424)
          to label %426 unwind label %431

426:                                              ; preds = %422
  br label %435

427:                                              ; preds = %396, %388, %377
  %428 = landingpad { ptr, i32 }
          cleanup
  %429 = extractvalue { ptr, i32 } %428, 0
  store ptr %429, ptr %8, align 8
  %430 = extractvalue { ptr, i32 } %428, 1
  store i32 %430, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #9
  br label %504

431:                                              ; preds = %422, %414
  %432 = landingpad { ptr, i32 }
          cleanup
  %433 = extractvalue { ptr, i32 } %432, 0
  store ptr %433, ptr %8, align 8
  %434 = extractvalue { ptr, i32 } %432, 1
  store i32 %434, ptr %9, align 4
  br label %504

435:                                              ; preds = %426, %419
  store i32 15, ptr %10, align 4
  br label %498

436:                                              ; preds = %409
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #9
  %437 = getelementptr inbounds %struct.gpt_vocab, ptr %14, i32 0, i32 1
  %438 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt3mapIiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIiESaISt4pairIKiS5_EEEixERS9_(ptr noundef nonnull align 8 dereferenceable(48) %437, ptr noundef nonnull align 4 dereferenceable(4) %50)
          to label %439 unwind label %450

439:                                              ; preds = %436
  store ptr %438, ptr %52, align 8, !tbaa !9
  %440 = load i32, ptr %18, align 4, !tbaa !5
  %441 = icmp eq i32 %440, 1
  br i1 %441, label %442, label %454

442:                                              ; preds = %439
  %443 = load ptr, ptr %52, align 8, !tbaa !9
  %444 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %443) #9
  %445 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.62, ptr noundef %444)
          to label %446 unwind label %450

446:                                              ; preds = %442
  %447 = load ptr, ptr @stdout, align 8, !tbaa !9
  %448 = invoke i32 @fflush(ptr noundef %447)
          to label %449 unwind label %450

449:                                              ; preds = %446
  br label %454

450:                                              ; preds = %454, %446, %442, %436
  %451 = landingpad { ptr, i32 }
          cleanup
  %452 = extractvalue { ptr, i32 } %451, 0
  store ptr %452, ptr %8, align 8
  %453 = extractvalue { ptr, i32 } %451, 1
  store i32 %453, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #9
  br label %504

454:                                              ; preds = %449, %439
  %455 = load ptr, ptr %52, align 8, !tbaa !9
  %456 = load i32, ptr %48, align 4, !tbaa !5
  %457 = sext i32 %456 to i64
  %458 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %457) #9
  %459 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %458, ptr noundef nonnull align 8 dereferenceable(32) %455)
          to label %460 unwind label %450

460:                                              ; preds = %454
  %461 = load i32, ptr %50, align 4, !tbaa !5
  %462 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 1
  %463 = load ptr, ptr %462, align 8, !tbaa !44
  %464 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %465 = load i32, ptr %464, align 8, !tbaa !42
  %466 = sext i32 %465 to i64
  %467 = getelementptr inbounds i32, ptr %463, i64 %466
  store i32 %461, ptr %467, align 4, !tbaa !5
  %468 = load i32, ptr %41, align 4, !tbaa !5
  %469 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 3
  %470 = load ptr, ptr %469, align 8, !tbaa !45
  %471 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %472 = load i32, ptr %471, align 8, !tbaa !42
  %473 = sext i32 %472 to i64
  %474 = getelementptr inbounds i32, ptr %470, i64 %473
  store i32 %468, ptr %474, align 4, !tbaa !5
  %475 = load i32, ptr %48, align 4, !tbaa !5
  %476 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 4
  %477 = load ptr, ptr %476, align 8, !tbaa !46
  %478 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %479 = load i32, ptr %478, align 8, !tbaa !42
  %480 = sext i32 %479 to i64
  %481 = getelementptr inbounds i32, ptr %477, i64 %480
  store i32 %475, ptr %481, align 4, !tbaa !5
  %482 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 5
  %483 = load ptr, ptr %482, align 8, !tbaa !47
  %484 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %485 = load i32, ptr %484, align 8, !tbaa !42
  %486 = sext i32 %485 to i64
  %487 = getelementptr inbounds i8, ptr %483, i64 %486
  store i8 1, ptr %487, align 1, !tbaa !48
  %488 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %489 = load i32, ptr %488, align 8, !tbaa !42
  %490 = load i32, ptr %48, align 4, !tbaa !5
  %491 = sext i32 %490 to i64
  %492 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %491) #9
  store i32 %489, ptr %492, align 4, !tbaa !5
  %493 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %494 = load i32, ptr %493, align 8, !tbaa !42
  %495 = add nsw i32 %494, 1
  store i32 %495, ptr %493, align 8, !tbaa !42
  %496 = load i32, ptr %43, align 4, !tbaa !5
  %497 = add nsw i32 %496, 1
  store i32 %497, ptr %43, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #9
  store i32 0, ptr %10, align 4
  br label %498

498:                                              ; preds = %460, %435
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #9
  %499 = load i32, ptr %10, align 4
  switch i32 %499, label %651 [
    i32 0, label %500
    i32 15, label %501
  ]

500:                                              ; preds = %498
  br label %501

501:                                              ; preds = %500, %498, %376
  %502 = load i32, ptr %48, align 4, !tbaa !5
  %503 = add nsw i32 %502, 1
  store i32 %503, ptr %48, align 4, !tbaa !5
  br label %357, !llvm.loop !65

504:                                              ; preds = %450, %431, %427
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #9
  br label %632

505:                                              ; preds = %361
  %506 = getelementptr inbounds %struct.gpt2_batch, ptr %22, i32 0, i32 0
  %507 = load i32, ptr %506, align 8, !tbaa !42
  %508 = icmp eq i32 %507, 0
  br i1 %508, label %509, label %510

509:                                              ; preds = %505
  br label %545

510:                                              ; preds = %505
  %511 = load i32, ptr %41, align 4, !tbaa !5
  %512 = add nsw i32 %511, 1
  store i32 %512, ptr %41, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #9
  %513 = invoke i64 @ggml_time_us()
          to label %514 unwind label %526

514:                                              ; preds = %510
  store i64 %513, ptr %53, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #9
  %515 = load ptr, ptr %23, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %55, ptr align 8 %22, i64 48, i1 false), !tbaa.struct !51
  %516 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 1
  %517 = load i32, ptr %516, align 4, !tbaa !52
  %518 = invoke noundef i32 @_Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(232) %15, ptr noundef %515, ptr noundef byval(%struct.gpt2_batch) align 8 %55, i32 noundef %517, ptr noundef nonnull align 8 dereferenceable(24) %28)
          to label %519 unwind label %530

519:                                              ; preds = %514
  store i32 %518, ptr %54, align 4, !tbaa !5
  %520 = load i32, ptr %54, align 4, !tbaa !5
  %521 = icmp ne i32 %520, 0
  br i1 %521, label %522, label %534

522:                                              ; preds = %519
  %523 = load ptr, ptr @stderr, align 8, !tbaa !9
  %524 = load i32, ptr %54, align 4, !tbaa !5
  %525 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %523, ptr noundef @.str.63, ptr noundef @__func__.main, i32 noundef %524) #9
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %541

526:                                              ; preds = %510
  %527 = landingpad { ptr, i32 }
          cleanup
  %528 = extractvalue { ptr, i32 } %527, 0
  store ptr %528, ptr %8, align 8
  %529 = extractvalue { ptr, i32 } %527, 1
  store i32 %529, ptr %9, align 4
  br label %544

530:                                              ; preds = %534, %514
  %531 = landingpad { ptr, i32 }
          cleanup
  %532 = extractvalue { ptr, i32 } %531, 0
  store ptr %532, ptr %8, align 8
  %533 = extractvalue { ptr, i32 } %531, 1
  store i32 %533, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #9
  br label %544

534:                                              ; preds = %519
  %535 = invoke i64 @ggml_time_us()
          to label %536 unwind label %530

536:                                              ; preds = %534
  %537 = load i64, ptr %53, align 8, !tbaa !11
  %538 = sub nsw i64 %535, %537
  %539 = load i64, ptr %27, align 8, !tbaa !11
  %540 = add nsw i64 %539, %538
  store i64 %540, ptr %27, align 8, !tbaa !11
  store i32 0, ptr %10, align 4
  br label %541

541:                                              ; preds = %536, %522
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #9
  %542 = load i32, ptr %10, align 4
  switch i32 %542, label %631 [
    i32 0, label %543
  ]

543:                                              ; preds = %541
  br label %351, !llvm.loop !66

544:                                              ; preds = %530, %526
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #9
  br label %632

545:                                              ; preds = %509, %351
  %546 = load i32, ptr %18, align 4, !tbaa !5
  %547 = icmp sgt i32 %546, 1
  br i1 %547, label %548, label %578

548:                                              ; preds = %545
  %549 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.60)
          to label %550 unwind label %556

550:                                              ; preds = %548
  call void @llvm.lifetime.start.p0(i64 4, ptr %56) #9
  store i32 0, ptr %56, align 4, !tbaa !5
  br label %551

551:                                              ; preds = %570, %550
  %552 = load i32, ptr %56, align 4, !tbaa !5
  %553 = load i32, ptr %18, align 4, !tbaa !5
  %554 = icmp slt i32 %552, %553
  br i1 %554, label %560, label %555

555:                                              ; preds = %551
  store i32 16, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %56) #9
  br label %577

556:                                              ; preds = %623, %619, %616, %614, %611, %548
  %557 = landingpad { ptr, i32 }
          cleanup
  %558 = extractvalue { ptr, i32 } %557, 0
  store ptr %558, ptr %8, align 8
  %559 = extractvalue { ptr, i32 } %557, 1
  store i32 %559, ptr %9, align 4
  br label %632

560:                                              ; preds = %551
  %561 = load i32, ptr %56, align 4, !tbaa !5
  %562 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 14
  %563 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %562) #9
  %564 = load i32, ptr %56, align 4, !tbaa !5
  %565 = sext i32 %564 to i64
  %566 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %565) #9
  %567 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %566) #9
  %568 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.64, i32 noundef %561, ptr noundef %563, ptr noundef %567)
          to label %569 unwind label %573

569:                                              ; preds = %560
  br label %570

570:                                              ; preds = %569
  %571 = load i32, ptr %56, align 4, !tbaa !5
  %572 = add nsw i32 %571, 1
  store i32 %572, ptr %56, align 4, !tbaa !5
  br label %551, !llvm.loop !67

573:                                              ; preds = %560
  %574 = landingpad { ptr, i32 }
          cleanup
  %575 = extractvalue { ptr, i32 } %574, 0
  store ptr %575, ptr %8, align 8
  %576 = extractvalue { ptr, i32 } %574, 1
  store i32 %576, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %56) #9
  br label %632

577:                                              ; preds = %555
  br label %578

578:                                              ; preds = %577, %545
  call void @llvm.lifetime.start.p0(i64 8, ptr %57) #9
  %579 = invoke i64 @ggml_time_us()
          to label %580 unwind label %627

580:                                              ; preds = %578
  store i64 %579, ptr %57, align 8, !tbaa !11
  %581 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.59)
          to label %582 unwind label %627

582:                                              ; preds = %580
  %583 = load i32, ptr %43, align 4, !tbaa !5
  %584 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.65, ptr noundef @__func__.main, i32 noundef %583)
          to label %585 unwind label %627

585:                                              ; preds = %582
  %586 = load i64, ptr %13, align 8, !tbaa !11
  %587 = sitofp i64 %586 to float
  %588 = fdiv float %587, 1.000000e+03
  %589 = fpext float %588 to double
  %590 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.66, ptr noundef @__func__.main, double noundef %589)
          to label %591 unwind label %627

591:                                              ; preds = %585
  %592 = load i64, ptr %26, align 8, !tbaa !11
  %593 = sitofp i64 %592 to float
  %594 = fdiv float %593, 1.000000e+03
  %595 = fpext float %594 to double
  %596 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.67, ptr noundef @__func__.main, double noundef %595)
          to label %597 unwind label %627

597:                                              ; preds = %591
  %598 = load i64, ptr %27, align 8, !tbaa !11
  %599 = sitofp i64 %598 to float
  %600 = fdiv float %599, 1.000000e+03
  %601 = fpext float %600 to double
  %602 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.68, ptr noundef @__func__.main, double noundef %601)
          to label %603 unwind label %627

603:                                              ; preds = %597
  %604 = load i64, ptr %57, align 8, !tbaa !11
  %605 = load i64, ptr %6, align 8, !tbaa !11
  %606 = sub nsw i64 %604, %605
  %607 = sitofp i64 %606 to float
  %608 = fdiv float %607, 1.000000e+03
  %609 = fpext float %608 to double
  %610 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.69, ptr noundef @__func__.main, double noundef %609)
          to label %611 unwind label %627

611:                                              ; preds = %603
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %58, ptr align 8 %22, i64 48, i1 false), !tbaa.struct !51
  call void @_Z15gpt2_batch_free10gpt2_batch(ptr noundef byval(%struct.gpt2_batch) align 8 %58)
  %612 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 8
  %613 = load ptr, ptr %612, align 8, !tbaa !68
  invoke void @ggml_free(ptr noundef %613)
          to label %614 unwind label %556

614:                                              ; preds = %611
  %615 = load ptr, ptr %23, align 8, !tbaa !9
  invoke void @ggml_gallocr_free(ptr noundef %615)
          to label %616 unwind label %556

616:                                              ; preds = %614
  %617 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 10
  %618 = load ptr, ptr %617, align 8, !tbaa !69
  invoke void @ggml_backend_buffer_free(ptr noundef %618)
          to label %619 unwind label %556

619:                                              ; preds = %616
  %620 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 7
  %621 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %620, i32 0, i32 6
  %622 = load ptr, ptr %621, align 8, !tbaa !70
  invoke void @ggml_backend_buffer_free(ptr noundef %622)
          to label %623 unwind label %556

623:                                              ; preds = %619
  %624 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 9
  %625 = load ptr, ptr %624, align 8, !tbaa !22
  invoke void @ggml_backend_free(ptr noundef %625)
          to label %626 unwind label %556

626:                                              ; preds = %623
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %631

627:                                              ; preds = %603, %597, %591, %585, %582, %580, %578
  %628 = landingpad { ptr, i32 }
          cleanup
  %629 = extractvalue { ptr, i32 } %628, 0
  store ptr %629, ptr %8, align 8
  %630 = extractvalue { ptr, i32 } %628, 1
  store i32 %630, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #9
  br label %632

631:                                              ; preds = %626, %541
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %38) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %38) #9
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %36) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %36) #9
  br label %635

632:                                              ; preds = %627, %573, %556, %544, %504
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %38) #9
  br label %633

633:                                              ; preds = %632, %366
  call void @llvm.lifetime.end.p0(i64 24, ptr %38) #9
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %36) #9
  br label %634

634:                                              ; preds = %633, %362
  call void @llvm.lifetime.end.p0(i64 24, ptr %36) #9
  br label %636

635:                                              ; preds = %631, %241
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #9
  br label %640

636:                                              ; preds = %634, %322, %300, %261, %242
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  br label %637

637:                                              ; preds = %636, %195, %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr %22) #9
  br label %638

638:                                              ; preds = %637, %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #9
  br label %639

639:                                              ; preds = %638, %175
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #9
  br label %641

640:                                              ; preds = %635, %128
  call void @_ZN10gpt2_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(232) %15) #9
  call void @llvm.lifetime.end.p0(i64 232, ptr %15) #9
  call void @_ZN9gpt_vocabD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %14) #9
  call void @llvm.lifetime.end.p0(i64 120, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 5000, ptr %11) #9
  br label %643

641:                                              ; preds = %639, %117
  call void @_ZN10gpt2_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(232) %15) #9
  call void @llvm.lifetime.end.p0(i64 232, ptr %15) #9
  call void @_ZN9gpt_vocabD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %14) #9
  call void @llvm.lifetime.end.p0(i64 120, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  br label %642

642:                                              ; preds = %641, %98, %94
  call void @llvm.lifetime.end.p0(i64 5000, ptr %11) #9
  br label %645

643:                                              ; preds = %640, %66
  call void @_ZN10gpt_paramsD2Ev(ptr noundef nonnull align 8 dereferenceable(160) %7) #9
  call void @llvm.lifetime.end.p0(i64 160, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  %644 = load i32, ptr %3, align 4
  ret i32 %644

645:                                              ; preds = %642, %67
  call void @_ZN10gpt_paramsD2Ev(ptr noundef nonnull align 8 dereferenceable(160) %7) #9
  call void @llvm.lifetime.end.p0(i64 160, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  br label %646

646:                                              ; preds = %645
  %647 = load ptr, ptr %8, align 8
  %648 = load i32, ptr %9, align 4
  %649 = insertvalue { ptr, i32 } poison, ptr %647, 0
  %650 = insertvalue { ptr, i32 } %649, i32 %648, 1
  resume { ptr, i32 } %650

651:                                              ; preds = %498
  unreachable
}

declare void @ggml_time_init() #3

declare i64 @ggml_time_us() #3

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

declare noundef zeroext i1 @_Z16gpt_params_parseiPPcR10gpt_params(i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(160)) #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

declare void @_Z17gpt_random_promptB5cxx11RSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(5000)) #3

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

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

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

declare void @_Z18test_gpt_tokenizerR9gpt_vocabRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(32)) #3

declare void @_Z12gpt_tokenizeRK9gpt_vocabRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::vector.44") align 8, ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(32)) #3

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

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

declare ptr @ggml_gallocr_new(ptr noundef) #3

declare ptr @ggml_backend_get_default_buffer_type(ptr noundef) #3

declare zeroext i1 @ggml_gallocr_reserve(ptr noundef, ptr noundef) #3

declare i64 @ggml_gallocr_get_buffer_size(ptr noundef, i32 noundef) #3

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL20gpt2_kv_cache_seq_cpR13gpt2_kv_cacheiiii(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2EmRKS6_(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 void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

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

declare noundef i32 @_Z22gpt_sample_top_k_top_pRK9gpt_vocabPKfiddRSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef, i32 noundef, double noundef, double noundef, ptr noundef nonnull align 8 dereferenceable(5000)) #3

declare i32 @fflush(ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

declare void @ggml_gallocr_free(ptr noundef) #3

declare void @ggml_backend_buffer_free(ptr noundef) #3

declare void @ggml_backend_free(ptr noundef) #3

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

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

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

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

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

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

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

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


; 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 }
%struct.gpt_params = type { i32, i32, i32, i32, i32, i32, i32, i8, i32, float, float, i32, float, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i8, i32 }
%"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] }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }
%struct.gpt_vocab = type { %"class.std::map.19", %"class.std::map.24", %"class.std::vector" }
%"class.std::map.19" = type { %"class.std::_Rb_tree.20" }
%"class.std::_Rb_tree.20" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, 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>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, 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 }
%"class.std::map.24" = type { %"class.std::_Rb_tree.25" }
%"class.std::_Rb_tree.25" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const int, std::__cxx11::basic_string<char>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const int, std::__cxx11::basic_string<char>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%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" }
%"class.std::vector.44" = type { %"struct.std::_Vector_base.45" }
%"struct.std::_Vector_base.45" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { 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" = type { i8 }
%"class.std::allocator.46" = type { i8 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.51 = external hidden unnamed_addr constant [15 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [3 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.63 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.69 = 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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z15gpt2_model_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10gpt2_modelR9gpt_vocabii(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(232), ptr noundef nonnull align 8 dereferenceable(120), i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt3mapIiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIiESaISt4pairIKiS5_EEEixERS9_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 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 #2

declare void @ggml_free(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z15gpt2_batch_initii(ptr dead_on_unwind noalias writable sret(%struct.gpt2_batch) align 8, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z15gpt2_batch_free10gpt2_batch(ptr noundef byval(%struct.gpt2_batch) align 8) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef, ptr noundef byval(%struct.gpt2_batch) align 8, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %3 = alloca %struct.gpt_params, align 8
  %4 = alloca %"class.std::mersenne_twister_engine", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %struct.gpt_vocab, align 8
  %7 = alloca %struct.gpt2_model, align 8
  %8 = alloca %"class.std::vector.44", align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %struct.gpt2_batch, align 8
  %12 = alloca %"class.std::vector.39", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::vector", align 8
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca %"class.std::vector.44", align 8
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::allocator.46", align 1
  %21 = alloca i32, align 4
  tail call void @ggml_time_init()
  %22 = tail call i64 @ggml_time_us()
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %3) #9
  call void @_ZN10gpt_paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(160) %3)
  %23 = invoke noundef zeroext i1 @_Z16gpt_params_parseiPPcR10gpt_params(i32 noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(160) %3)
          to label %24 unwind label %25

24:                                               ; preds = %2
  br i1 %23, label %27, label %375

25:                                               ; preds = %2
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %376

27:                                               ; preds = %24
  %28 = load i32, ptr %3, align 8, !tbaa !5
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %27
  %31 = call i64 @time(ptr noundef null) #9
  %32 = trunc i64 %31 to i32
  store i32 %32, ptr %3, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %30, %27
  %34 = phi i32 [ %32, %30 ], [ %28, %27 ]
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.51, ptr noundef nonnull @__func__.main, i32 noundef %34)
  call void @llvm.lifetime.start.p0(i64 5000, ptr nonnull %4) #9
  %36 = load i32, ptr %3, align 8, !tbaa !5
  %37 = sext i32 %36 to i64
  invoke void @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEC2Em(ptr noundef nonnull align 8 dereferenceable(5000) %4, i64 noundef %37)
          to label %38 unwind label %44

38:                                               ; preds = %33
  %39 = getelementptr inbounds i8, ptr %3, i64 88
  %40 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %39) #9
  br i1 %40, label %41, label %48

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #9
  invoke void @_Z17gpt_random_promptB5cxx11RSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(5000) %4)
          to label %42 unwind label %46

42:                                               ; preds = %41
  %43 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %39, ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  br label %48

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

46:                                               ; preds = %41
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  br label %374

48:                                               ; preds = %42, %38
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %6) #9
  call void @_ZN9gpt_vocabC2Ev(ptr noundef nonnull align 8 dereferenceable(120) %6) #9
  call void @llvm.lifetime.start.p0(i64 232, ptr nonnull %7) #9
  call void @_ZN10gpt2_modelC2Ev(ptr noundef nonnull align 8 dereferenceable(232) %7) #9
  %49 = invoke i64 @ggml_time_us()
          to label %50 unwind label %58

50:                                               ; preds = %48
  %51 = getelementptr inbounds i8, ptr %3, i64 56
  %52 = getelementptr inbounds i8, ptr %3, i64 20
  %53 = load i32, ptr %52, align 4, !tbaa !16
  %54 = getelementptr inbounds i8, ptr %3, i64 24
  %55 = load i32, ptr %54, align 8, !tbaa !17
  %56 = invoke noundef zeroext i1 @_Z15gpt2_model_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10gpt2_modelR9gpt_vocabii(ptr noundef nonnull align 8 dereferenceable(32) %51, ptr noundef nonnull align 8 dereferenceable(232) %7, ptr noundef nonnull align 8 dereferenceable(120) %6, i32 noundef %53, i32 noundef %55)
          to label %57 unwind label %58

57:                                               ; preds = %50
  br i1 %56, label %60, label %64

58:                                               ; preds = %62, %60, %50, %48
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %373

60:                                               ; preds = %57
  %61 = invoke i64 @ggml_time_us()
          to label %62 unwind label %58

62:                                               ; preds = %60
  %63 = getelementptr inbounds i8, ptr %3, i64 120
  invoke void @_Z18test_gpt_tokenizerR9gpt_vocabRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(120) %6, ptr noundef nonnull align 8 dereferenceable(32) %63)
          to label %68 unwind label %58

64:                                               ; preds = %57
  %65 = load ptr, ptr @stderr, align 8, !tbaa !18
  %66 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %51) #9
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef nonnull @.str.52, ptr noundef nonnull @__func__.main, ptr noundef %66) #10
  br label %372

68:                                               ; preds = %62
  %69 = sub nsw i64 %61, %49
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #9
  invoke void @_Z12gpt_tokenizeRK9gpt_vocabRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.44") align 8 %8, ptr noundef nonnull align 8 dereferenceable(120) %6, ptr noundef nonnull align 8 dereferenceable(32) %39)
          to label %70 unwind label %109

70:                                               ; preds = %68
  %71 = getelementptr inbounds i8, ptr %3, i64 12
  %72 = load i32, ptr %71, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %73 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  store i64 %73, ptr %9, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %74 = sext i32 %72 to i64
  store i64 %74, ptr %10, align 8, !tbaa !20
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %76 = load i64, ptr %75, align 8, !tbaa !20
  %77 = trunc i64 %76 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #9
  call void @_Z15gpt2_batch_initii(ptr dead_on_unwind nonnull writable sret(%struct.gpt2_batch) align 8 %11, i32 noundef %77, i32 noundef 0)
  %78 = getelementptr inbounds i8, ptr %7, i64 168
  %79 = load ptr, ptr %78, align 8, !tbaa !21
  %80 = invoke ptr @ggml_backend_get_default_buffer_type(ptr noundef %79)
          to label %81 unwind label %111

81:                                               ; preds = %70
  %82 = invoke ptr @ggml_gallocr_new(ptr noundef %80)
          to label %83 unwind label %111

83:                                               ; preds = %81
  store i32 %77, ptr %11, align 8, !tbaa !41
  %84 = invoke noundef ptr @_Z10gpt2_graphRK10gpt2_modelRK10gpt2_batchb(ptr noundef nonnull align 8 dereferenceable(232) %7, ptr noundef nonnull align 8 dereferenceable(48) %11, i1 noundef zeroext true)
          to label %85 unwind label %113

85:                                               ; preds = %83
  %86 = invoke zeroext i1 @ggml_gallocr_reserve(ptr noundef %82, ptr noundef %84)
          to label %87 unwind label %113

87:                                               ; preds = %85
  %88 = invoke i64 @ggml_gallocr_get_buffer_size(ptr noundef %82, i32 noundef 0)
          to label %89 unwind label %115

89:                                               ; preds = %87
  %90 = load ptr, ptr @stderr, align 8, !tbaa !18
  %91 = uitofp i64 %88 to double
  %92 = fmul double %91, 0x3F50000000000000
  %93 = fmul double %92, 0x3F50000000000000
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef nonnull @.str.53, ptr noundef nonnull @__func__.main, double noundef %93) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #9
  call void @_ZNSt6vectorIfSaIfEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #9
  %95 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  %96 = trunc i64 %95 to i32
  store i32 %96, ptr %11, align 8, !tbaa !41
  %97 = icmp sgt i32 %96, 0
  br i1 %97, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %89
  %sext = shl i64 %95, 32
  %.pre = ashr exact i64 %sext, 32
  br label %._crit_edge

.lr.ph:                                           ; preds = %89
  %98 = getelementptr inbounds i8, ptr %11, i64 8
  %99 = getelementptr inbounds i8, ptr %11, i64 24
  %100 = getelementptr inbounds i8, ptr %11, i64 32
  %101 = getelementptr inbounds i8, ptr %11, i64 40
  br label %117

._crit_edge:                                      ; preds = %117, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %130, %117 ]
  %102 = getelementptr inbounds i8, ptr %11, i64 40
  %103 = load ptr, ptr %102, align 8, !tbaa !43
  %104 = getelementptr i8, ptr %103, i64 %.pre-phi
  %105 = getelementptr i8, ptr %104, i64 -1
  store i8 1, ptr %105, align 1, !tbaa !44
  %106 = getelementptr inbounds i8, ptr %3, i64 4
  %107 = load i32, ptr %106, align 4, !tbaa !45
  %108 = invoke noundef i32 @_Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(232) %7, ptr noundef %82, ptr noundef nonnull byval(%struct.gpt2_batch) align 8 %11, i32 noundef %107, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %132 unwind label %137

109:                                              ; preds = %68
  %110 = landingpad { ptr, i32 }
          cleanup
  br label %371

111:                                              ; preds = %81, %70
  %112 = landingpad { ptr, i32 }
          cleanup
  br label %370

113:                                              ; preds = %85, %83
  %114 = landingpad { ptr, i32 }
          cleanup
  br label %370

115:                                              ; preds = %87
  %116 = landingpad { ptr, i32 }
          cleanup
  br label %370

117:                                              ; preds = %.lr.ph, %117
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %117 ]
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv) #9
  %119 = load i32, ptr %118, align 4, !tbaa !46
  %120 = load ptr, ptr %98, align 8, !tbaa !47
  %121 = getelementptr inbounds i32, ptr %120, i64 %indvars.iv
  store i32 %119, ptr %121, align 4, !tbaa !46
  %122 = load ptr, ptr %99, align 8, !tbaa !48
  %123 = getelementptr inbounds i32, ptr %122, i64 %indvars.iv
  %124 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %124, ptr %123, align 4, !tbaa !46
  %125 = load ptr, ptr %100, align 8, !tbaa !49
  %126 = getelementptr inbounds i32, ptr %125, i64 %indvars.iv
  store i32 0, ptr %126, align 4, !tbaa !46
  %127 = load ptr, ptr %101, align 8, !tbaa !43
  %128 = getelementptr inbounds i8, ptr %127, i64 %indvars.iv
  store i8 0, ptr %128, align 1, !tbaa !44
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %129 = load i32, ptr %11, align 8, !tbaa !41
  %130 = sext i32 %129 to i64
  %131 = icmp slt i64 %indvars.iv.next, %130
  br i1 %131, label %117, label %._crit_edge, !llvm.loop !50

132:                                              ; preds = %._crit_edge
  %.not127 = icmp eq i32 %108, 0
  br i1 %.not127, label %.preheader, label %135

.preheader:                                       ; preds = %132
  %133 = icmp sgt i32 %72, 1
  br i1 %133, label %.lr.ph165, label %._crit_edge166.thread

.lr.ph165:                                        ; preds = %.preheader
  %134 = getelementptr inbounds i8, ptr %7, i64 96
  br label %139

135:                                              ; preds = %132
  %136 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.54, ptr noundef nonnull @__func__.main)
  br label %368

137:                                              ; preds = %._crit_edge
  %138 = landingpad { ptr, i32 }
          cleanup
  br label %369

._crit_edge166:                                   ; preds = %141
  br i1 %133, label %145, label %._crit_edge166.thread

139:                                              ; preds = %.lr.ph165, %141
  %.0114164 = phi i32 [ 1, %.lr.ph165 ], [ %142, %141 ]
  %140 = load i32, ptr %11, align 8, !tbaa !41
  invoke void @_ZL20gpt2_kv_cache_seq_cpR13gpt2_kv_cacheiiii(ptr noundef nonnull align 8 dereferenceable(64) %134, i32 noundef 0, i32 noundef %.0114164, i32 noundef 0, i32 noundef %140)
          to label %141 unwind label %143

141:                                              ; preds = %139
  %142 = add nuw nsw i32 %.0114164, 1
  %exitcond.not = icmp eq i32 %142, %72
  br i1 %exitcond.not, label %._crit_edge166, label %139, !llvm.loop !52

143:                                              ; preds = %139
  %144 = landingpad { ptr, i32 }
          cleanup
  br label %369

145:                                              ; preds = %._crit_edge166
  %146 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.55, ptr noundef nonnull @__func__.main, i32 noundef %72)
  br label %._crit_edge166.thread

._crit_edge166.thread:                            ; preds = %.preheader, %145, %._crit_edge166
  %147 = getelementptr inbounds i8, ptr %3, i64 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #9
  %148 = getelementptr inbounds i8, ptr %7, i64 4
  %149 = load i32, ptr %148, align 4, !tbaa !53
  %150 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  %151 = trunc i64 %150 to i32
  %152 = sub nsw i32 %149, %151
  store i32 %152, ptr %13, align 4, !tbaa !46
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %147, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %154 = load i32, ptr %153, align 4, !tbaa !46
  store i32 %154, ptr %147, align 8, !tbaa !54
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #9
  %155 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %39) #9
  %156 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.56, ptr noundef nonnull @__func__.main, ptr noundef %155)
  %157 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  %158 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.57, ptr noundef nonnull @__func__.main, i64 noundef %157)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #9
  store i32 8, ptr %14, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #9
  %159 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  %160 = trunc i64 %159 to i32
  store i32 %160, ptr %15, align 4, !tbaa !46
  %161 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %162 = load i32, ptr %161, align 4, !tbaa !46
  %163 = icmp sgt i32 %162, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #9
  br i1 %163, label %.lr.ph169, label %._crit_edge170

._crit_edge170:                                   ; preds = %.lr.ph169, %._crit_edge166.thread
  %164 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.59)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #9
  call void @_ZNSaINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #9
  invoke void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2EmRKS6_(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %74, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %174 unwind label %228

.lr.ph169:                                        ; preds = %._crit_edge166.thread, %.lr.ph169
  %indvars.iv206 = phi i64 [ %indvars.iv.next207, %.lr.ph169 ], [ 0, %._crit_edge166.thread ]
  %165 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv206) #9
  %166 = load i32, ptr %165, align 4, !tbaa !46
  %167 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.58, i32 noundef %166)
  %indvars.iv.next207 = add nuw nsw i64 %indvars.iv206, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #9
  store i32 8, ptr %14, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #9
  %168 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  %169 = trunc i64 %168 to i32
  store i32 %169, ptr %15, align 4, !tbaa !46
  %170 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %171 = load i32, ptr %170, align 4, !tbaa !46
  %172 = sext i32 %171 to i64
  %173 = icmp slt i64 %indvars.iv.next207, %172
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #9
  br i1 %173, label %.lr.ph169, label %._crit_edge170, !llvm.loop !55

174:                                              ; preds = %._crit_edge170
  call void @_ZNSt15__new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #9
  %175 = load i32, ptr %11, align 8, !tbaa !41
  %176 = add nsw i32 %175, -1
  store i32 %176, ptr %19, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %20) #9
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #9
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %74, ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 1 dereferenceable(1) %20)
          to label %177 unwind label %230

177:                                              ; preds = %174
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #9
  %178 = load i32, ptr %11, align 8, !tbaa !41
  %179 = load i32, ptr %147, align 8, !tbaa !54
  %180 = add nsw i32 %179, %178
  %181 = load i32, ptr %7, align 8, !tbaa !56
  %182 = getelementptr inbounds i8, ptr %3, i64 32
  %183 = load i32, ptr %182, align 8, !tbaa !57
  %184 = icmp sgt i32 %179, 0
  br i1 %184, label %.lr.ph187, label %._crit_edge188

.lr.ph187:                                        ; preds = %177
  %185 = getelementptr inbounds i8, ptr %3, i64 40
  %186 = load float, ptr %185, align 8, !tbaa !58
  %187 = getelementptr inbounds i8, ptr %3, i64 36
  %188 = load float, ptr %187, align 4, !tbaa !59
  %189 = icmp sgt i32 %72, 0
  %190 = fpext float %188 to double
  %191 = fpext float %186 to double
  %192 = getelementptr inbounds i8, ptr %3, i64 28
  %193 = add nsw i32 %180, -1
  %194 = getelementptr inbounds i8, ptr %6, i64 48
  %195 = icmp eq i32 %72, 1
  %196 = getelementptr inbounds i8, ptr %11, i64 8
  %197 = getelementptr inbounds i8, ptr %11, i64 24
  %198 = getelementptr inbounds i8, ptr %11, i64 32
  %wide.trip.count = zext nneg i32 %72 to i64
  %wide.trip.count216 = zext nneg i32 %72 to i64
  br label %199

199:                                              ; preds = %.lr.ph187, %316
  %.0107185 = phi i64 [ 0, %.lr.ph187 ], [ %.1108.lcssa.ph, %316 ]
  %.0111184 = phi i64 [ 0, %.lr.ph187 ], [ %318, %316 ]
  %.0115183 = phi i32 [ 0, %.lr.ph187 ], [ %.1116.lcssa.ph, %316 ]
  %.0121181 = phi i32 [ %178, %.lr.ph187 ], [ %302, %316 ]
  store i32 0, ptr %11, align 8, !tbaa !41
  br i1 %189, label %.lr.ph175, label %._crit_edge188.loopexit

.lr.ph175:                                        ; preds = %199
  %200 = icmp eq i32 %.0121181, %193
  %.fr = freeze i1 %200
  br i1 %.fr, label %.lr.ph175.split.us, label %.lr.ph175.split

.lr.ph175.split.us:                               ; preds = %.lr.ph175, %225
  %indvars.iv213 = phi i64 [ %indvars.iv.next214, %225 ], [ 0, %.lr.ph175 ]
  %.1108172.us = phi i64 [ %.2109.us, %225 ], [ %.0107185, %.lr.ph175 ]
  %201 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv213) #9
  %202 = load i32, ptr %201, align 4, !tbaa !46
  %203 = icmp slt i32 %202, 0
  br i1 %203, label %225, label %204

204:                                              ; preds = %.lr.ph175.split.us
  %205 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #9
  %206 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv213) #9
  %207 = load i32, ptr %206, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #9
  store i32 0, ptr %21, align 4, !tbaa !46
  %208 = invoke i64 @ggml_time_us()
          to label %209 unwind label %.split.us

209:                                              ; preds = %204
  %210 = mul nsw i32 %207, %181
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds float, ptr %205, i64 %211
  %213 = invoke noundef i32 @_Z22gpt_sample_top_k_top_pRK9gpt_vocabPKfiddRSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE(ptr noundef nonnull align 8 dereferenceable(120) %6, ptr noundef %212, i32 noundef %183, double noundef %190, double noundef %191, ptr noundef nonnull align 8 dereferenceable(5000) %4)
          to label %214 unwind label %.split.us

214:                                              ; preds = %209
  store i32 %213, ptr %21, align 4, !tbaa !46
  %215 = invoke i64 @ggml_time_us()
          to label %216 unwind label %.split.us

216:                                              ; preds = %214
  %217 = sub i64 %.1108172.us, %208
  %218 = add i64 %217, %215
  %219 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv213) #9
  store i32 -1, ptr %219, align 4, !tbaa !46
  %220 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.60)
  br i1 %133, label %221, label %224

221:                                              ; preds = %216
  %222 = trunc nuw nsw i64 %indvars.iv213 to i32
  %223 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.61, ptr noundef nonnull @__func__.main, i32 noundef %222, i32 noundef %.0121181)
  br label %224

224:                                              ; preds = %221, %216
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #9
  br label %225

225:                                              ; preds = %224, %.lr.ph175.split.us
  %.2109.us = phi i64 [ %.1108172.us, %.lr.ph175.split.us ], [ %218, %224 ]
  %indvars.iv.next214 = add nuw nsw i64 %indvars.iv213, 1
  %exitcond217.not = icmp eq i64 %indvars.iv.next214, %wide.trip.count216
  br i1 %exitcond217.not, label %._crit_edge176, label %.lr.ph175.split.us, !llvm.loop !60

.split.us:                                        ; preds = %214, %209, %204
  %226 = landingpad { ptr, i32 }
          cleanup
  br label %300

._crit_edge176:                                   ; preds = %299, %225
  %.1116.lcssa.ph = phi i32 [ %.0115183, %225 ], [ %.3118, %299 ]
  %.1108.lcssa.ph = phi i64 [ %.2109.us, %225 ], [ %.2109, %299 ]
  %.pr = load i32, ptr %11, align 8, !tbaa !41
  %227 = icmp eq i32 %.pr, 0
  br i1 %227, label %._crit_edge188.loopexit, label %301

228:                                              ; preds = %._crit_edge170
  %229 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #9
  br label %367

230:                                              ; preds = %174
  %231 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #9
  br label %366

.lr.ph175.split:                                  ; preds = %.lr.ph175, %299
  %indvars.iv209 = phi i64 [ %indvars.iv.next210, %299 ], [ 0, %.lr.ph175 ]
  %.1108172 = phi i64 [ %.2109, %299 ], [ %.0107185, %.lr.ph175 ]
  %.1116171 = phi i32 [ %.3118, %299 ], [ %.0115183, %.lr.ph175 ]
  %232 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv209) #9
  %233 = load i32, ptr %232, align 4, !tbaa !46
  %234 = icmp slt i32 %233, 0
  br i1 %234, label %299, label %235

235:                                              ; preds = %.lr.ph175.split
  %236 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #9
  %237 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv209) #9
  %238 = load i32, ptr %237, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #9
  store i32 0, ptr %21, align 4, !tbaa !46
  %239 = invoke i64 @ggml_time_us()
          to label %240 unwind label %.split

240:                                              ; preds = %235
  %241 = mul nsw i32 %238, %181
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds float, ptr %236, i64 %242
  %244 = invoke noundef i32 @_Z22gpt_sample_top_k_top_pRK9gpt_vocabPKfiddRSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE(ptr noundef nonnull align 8 dereferenceable(120) %6, ptr noundef %243, i32 noundef %183, double noundef %190, double noundef %191, ptr noundef nonnull align 8 dereferenceable(5000) %4)
          to label %245 unwind label %.split

245:                                              ; preds = %240
  store i32 %244, ptr %21, align 4, !tbaa !46
  %246 = invoke i64 @ggml_time_us()
          to label %247 unwind label %.split

247:                                              ; preds = %245
  %248 = sub i64 %.1108172, %239
  %249 = add i64 %248, %246
  %250 = load i8, ptr %192, align 4, !tbaa !61, !range !62, !noundef !63
  %251 = trunc nuw i8 %250 to i1
  %252 = load i32, ptr %21, align 4
  %253 = icmp ne i32 %252, 50256
  %or.cond.not.not = select i1 %251, i1 true, i1 %253
  br i1 %or.cond.not.not, label %261, label %254

254:                                              ; preds = %247
  %255 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv209) #9
  store i32 -1, ptr %255, align 4, !tbaa !46
  %256 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.60)
  br i1 %133, label %257, label %298

257:                                              ; preds = %254
  %258 = trunc nuw nsw i64 %indvars.iv209 to i32
  %259 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.61, ptr noundef nonnull @__func__.main, i32 noundef %258, i32 noundef %.0121181)
  br label %298

.split:                                           ; preds = %245, %240, %235
  %260 = landingpad { ptr, i32 }
          cleanup
  br label %300

261:                                              ; preds = %247
  %262 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt3mapIiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIiESaISt4pairIKiS5_EEEixERS9_(ptr noundef nonnull align 8 dereferenceable(48) %194, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %263 unwind label %269

263:                                              ; preds = %261
  br i1 %195, label %264, label %271

264:                                              ; preds = %263
  %265 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %262) #9
  %266 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.62, ptr noundef %265)
  %267 = load ptr, ptr @stdout, align 8, !tbaa !18
  %268 = call i32 @fflush(ptr noundef %267)
  br label %271

269:                                              ; preds = %271, %261
  %270 = landingpad { ptr, i32 }
          cleanup
  br label %300

271:                                              ; preds = %264, %263
  %272 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %indvars.iv209) #9
  %273 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %272, ptr noundef nonnull align 8 dereferenceable(32) %262)
          to label %274 unwind label %269

274:                                              ; preds = %271
  %275 = load i32, ptr %21, align 4, !tbaa !46
  %276 = load ptr, ptr %196, align 8, !tbaa !47
  %277 = load i32, ptr %11, align 8, !tbaa !41
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds i32, ptr %276, i64 %278
  store i32 %275, ptr %279, align 4, !tbaa !46
  %280 = load ptr, ptr %197, align 8, !tbaa !48
  %281 = load i32, ptr %11, align 8, !tbaa !41
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds i32, ptr %280, i64 %282
  store i32 %.0121181, ptr %283, align 4, !tbaa !46
  %284 = load ptr, ptr %198, align 8, !tbaa !49
  %285 = load i32, ptr %11, align 8, !tbaa !41
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds i32, ptr %284, i64 %286
  %288 = trunc nuw nsw i64 %indvars.iv209 to i32
  store i32 %288, ptr %287, align 4, !tbaa !46
  %289 = load ptr, ptr %102, align 8, !tbaa !43
  %290 = load i32, ptr %11, align 8, !tbaa !41
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds i8, ptr %289, i64 %291
  store i8 1, ptr %292, align 1, !tbaa !44
  %293 = load i32, ptr %11, align 8, !tbaa !41
  %294 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv209) #9
  store i32 %293, ptr %294, align 4, !tbaa !46
  %295 = load i32, ptr %11, align 8, !tbaa !41
  %296 = add nsw i32 %295, 1
  store i32 %296, ptr %11, align 8, !tbaa !41
  %297 = add nsw i32 %.1116171, 1
  br label %298

298:                                              ; preds = %254, %257, %274
  %.2117 = phi i32 [ %297, %274 ], [ %.1116171, %257 ], [ %.1116171, %254 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #9
  br label %299

299:                                              ; preds = %298, %.lr.ph175.split
  %.3118 = phi i32 [ %.1116171, %.lr.ph175.split ], [ %.2117, %298 ]
  %.2109 = phi i64 [ %.1108172, %.lr.ph175.split ], [ %249, %298 ]
  %indvars.iv.next210 = add nuw nsw i64 %indvars.iv209, 1
  %exitcond212.not = icmp eq i64 %indvars.iv.next210, %wide.trip.count
  br i1 %exitcond212.not, label %._crit_edge176, label %.lr.ph175.split, !llvm.loop !60

300:                                              ; preds = %.split, %.split.us, %269
  %.pn132 = phi { ptr, i32 } [ %270, %269 ], [ %260, %.split ], [ %226, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #9
  br label %365

301:                                              ; preds = %._crit_edge176
  %302 = add nsw i32 %.0121181, 1
  %303 = invoke i64 @ggml_time_us()
          to label %304 unwind label %310

304:                                              ; preds = %301
  %305 = load i32, ptr %106, align 4, !tbaa !45
  %306 = invoke noundef i32 @_Z11gpt2_decodeR10gpt2_modelP12ggml_gallocr10gpt2_batchiRSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(232) %7, ptr noundef %82, ptr noundef nonnull byval(%struct.gpt2_batch) align 8 %11, i32 noundef %305, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %307 unwind label %312

307:                                              ; preds = %304
  %.not128 = icmp eq i32 %306, 0
  br i1 %.not128, label %314, label %.thread149

.thread149:                                       ; preds = %307
  %308 = load ptr, ptr @stderr, align 8, !tbaa !18
  %309 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %308, ptr noundef nonnull @.str.63, ptr noundef nonnull @__func__.main, i32 noundef %306) #10
  br label %364

310:                                              ; preds = %301
  %311 = landingpad { ptr, i32 }
          cleanup
  br label %365

312:                                              ; preds = %314, %304
  %313 = landingpad { ptr, i32 }
          cleanup
  br label %365

314:                                              ; preds = %307
  %315 = invoke i64 @ggml_time_us()
          to label %316 unwind label %312

316:                                              ; preds = %314
  %317 = sub i64 %.0111184, %303
  %318 = add i64 %317, %315
  %319 = icmp slt i32 %302, %180
  br i1 %319, label %199, label %._crit_edge188.loopexit, !llvm.loop !64

._crit_edge188.loopexit:                          ; preds = %199, %._crit_edge176, %316
  %.1108.lcssa226 = phi i64 [ %.1108.lcssa.ph, %316 ], [ %.1108.lcssa.ph, %._crit_edge176 ], [ %.0107185, %199 ]
  %.1116.lcssa225 = phi i32 [ %.1116.lcssa.ph, %316 ], [ %.1116.lcssa.ph, %._crit_edge176 ], [ %.0115183, %199 ]
  %.0111.lcssa.ph = phi i64 [ %318, %316 ], [ %.0111184, %._crit_edge176 ], [ %.0111184, %199 ]
  %320 = sitofp i64 %.1108.lcssa226 to float
  %321 = sitofp i64 %.0111.lcssa.ph to float
  br label %._crit_edge188

._crit_edge188:                                   ; preds = %._crit_edge188.loopexit, %177
  %.0111.lcssa = phi float [ 0.000000e+00, %177 ], [ %321, %._crit_edge188.loopexit ]
  %.4119 = phi i32 [ 0, %177 ], [ %.1116.lcssa225, %._crit_edge188.loopexit ]
  %.3110 = phi float [ 0.000000e+00, %177 ], [ %320, %._crit_edge188.loopexit ]
  br i1 %133, label %322, label %.loopexit

322:                                              ; preds = %._crit_edge188
  %323 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.60)
  %wide.trip.count221 = zext nneg i32 %72 to i64
  br label %326

324:                                              ; preds = %360, %357, %354, %353, %333
  %325 = landingpad { ptr, i32 }
          cleanup
  br label %365

326:                                              ; preds = %322, %326
  %indvars.iv218 = phi i64 [ 0, %322 ], [ %indvars.iv.next219, %326 ]
  %327 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %39) #9
  %328 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %indvars.iv218) #9
  %329 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %328) #9
  %330 = trunc nuw nsw i64 %indvars.iv218 to i32
  %331 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.64, i32 noundef %330, ptr noundef %327, ptr noundef %329)
  %indvars.iv.next219 = add nuw nsw i64 %indvars.iv218, 1
  %exitcond222.not = icmp eq i64 %indvars.iv.next219, %wide.trip.count221
  br i1 %exitcond222.not, label %.loopexit, label %326, !llvm.loop !65

.loopexit:                                        ; preds = %326, %._crit_edge188
  %332 = invoke i64 @ggml_time_us()
          to label %333 unwind label %362

333:                                              ; preds = %.loopexit
  %334 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.59)
  %335 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.65, ptr noundef nonnull @__func__.main, i32 noundef %.4119)
  %336 = sitofp i64 %69 to float
  %337 = fdiv float %336, 1.000000e+03
  %338 = fpext float %337 to double
  %339 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.66, ptr noundef nonnull @__func__.main, double noundef %338)
  %340 = fdiv float %.3110, 1.000000e+03
  %341 = fpext float %340 to double
  %342 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.67, ptr noundef nonnull @__func__.main, double noundef %341)
  %343 = fdiv float %.0111.lcssa, 1.000000e+03
  %344 = fpext float %343 to double
  %345 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.68, ptr noundef nonnull @__func__.main, double noundef %344)
  %346 = sub nsw i64 %332, %22
  %347 = sitofp i64 %346 to float
  %348 = fdiv float %347, 1.000000e+03
  %349 = fpext float %348 to double
  %350 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.69, ptr noundef nonnull @__func__.main, double noundef %349)
  call void @_Z15gpt2_batch_free10gpt2_batch(ptr noundef nonnull byval(%struct.gpt2_batch) align 8 %11)
  %351 = getelementptr inbounds i8, ptr %7, i64 160
  %352 = load ptr, ptr %351, align 8, !tbaa !66
  invoke void @ggml_free(ptr noundef %352)
          to label %353 unwind label %324

353:                                              ; preds = %333
  invoke void @ggml_gallocr_free(ptr noundef %82)
          to label %354 unwind label %324

354:                                              ; preds = %353
  %355 = getelementptr inbounds i8, ptr %7, i64 176
  %356 = load ptr, ptr %355, align 8, !tbaa !67
  invoke void @ggml_backend_buffer_free(ptr noundef %356)
          to label %357 unwind label %324

357:                                              ; preds = %354
  %358 = getelementptr inbounds i8, ptr %7, i64 152
  %359 = load ptr, ptr %358, align 8, !tbaa !68
  invoke void @ggml_backend_buffer_free(ptr noundef %359)
          to label %360 unwind label %324

360:                                              ; preds = %357
  %361 = load ptr, ptr %78, align 8, !tbaa !21
  invoke void @ggml_backend_free(ptr noundef %361)
          to label %364 unwind label %324

362:                                              ; preds = %.loopexit
  %363 = landingpad { ptr, i32 }
          cleanup
  br label %365

364:                                              ; preds = %.thread149, %360
  %.3 = phi i32 [ 0, %360 ], [ 1, %.thread149 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #9
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #9
  br label %368

365:                                              ; preds = %310, %312, %362, %324, %300
  %.pn132.pn = phi { ptr, i32 } [ %.pn132, %300 ], [ %325, %324 ], [ %363, %362 ], [ %313, %312 ], [ %311, %310 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #9
  br label %366

366:                                              ; preds = %365, %230
  %.pn132.pn.pn = phi { ptr, i32 } [ %.pn132.pn, %365 ], [ %231, %230 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #9
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #9
  br label %367

367:                                              ; preds = %366, %228
  %.pn132.pn.pn.pn = phi { ptr, i32 } [ %.pn132.pn.pn, %366 ], [ %229, %228 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #9
  br label %369

368:                                              ; preds = %364, %135
  %.4 = phi i32 [ 1, %135 ], [ %.3, %364 ]
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #9
  br label %372

369:                                              ; preds = %367, %143, %137
  %.pn137 = phi { ptr, i32 } [ %144, %143 ], [ %.pn132.pn.pn.pn, %367 ], [ %138, %137 ]
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #9
  br label %370

370:                                              ; preds = %113, %115, %369, %111
  %.pn137.pn = phi { ptr, i32 } [ %.pn137, %369 ], [ %112, %111 ], [ %116, %115 ], [ %114, %113 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  br label %371

371:                                              ; preds = %370, %109
  %.pn137.pn.pn = phi { ptr, i32 } [ %.pn137.pn, %370 ], [ %110, %109 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #9
  br label %373

372:                                              ; preds = %64, %368
  %.5 = phi i32 [ %.4, %368 ], [ 1, %64 ]
  call void @_ZN10gpt2_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(232) %7) #9
  call void @llvm.lifetime.end.p0(i64 232, ptr nonnull %7) #9
  call void @_ZN9gpt_vocabD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %6) #9
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %4) #9
  br label %375

373:                                              ; preds = %371, %58
  %.pn137.pn.pn.pn = phi { ptr, i32 } [ %.pn137.pn.pn, %371 ], [ %59, %58 ]
  call void @_ZN10gpt2_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(232) %7) #9
  call void @llvm.lifetime.end.p0(i64 232, ptr nonnull %7) #9
  call void @_ZN9gpt_vocabD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %6) #9
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %6) #9
  br label %374

374:                                              ; preds = %373, %46, %44
  %.pn137.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn137.pn.pn.pn, %373 ], [ %47, %46 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %4) #9
  br label %376

375:                                              ; preds = %24, %372
  %.6 = phi i32 [ %.5, %372 ], [ 1, %24 ]
  call void @_ZN10gpt_paramsD2Ev(ptr noundef nonnull align 8 dereferenceable(160) %3) #9
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %3) #9
  ret i32 %.6

376:                                              ; preds = %374, %25
  %.pn137.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn137.pn.pn.pn.pn, %374 ], [ %26, %25 ]
  call void @_ZN10gpt_paramsD2Ev(ptr noundef nonnull align 8 dereferenceable(160) %3) #9
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %3) #9
  resume { ptr, i32 } %.pn137.pn.pn.pn.pn.pn
}

declare void @ggml_time_init() local_unnamed_addr #4

declare i64 @ggml_time_us() local_unnamed_addr #4

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

declare noundef zeroext i1 @_Z16gpt_params_parseiPPcR10gpt_params(i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(160)) local_unnamed_addr #4

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #7

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

declare void @_Z17gpt_random_promptB5cxx11RSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(5000)) local_unnamed_addr #4

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

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

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

declare void @_Z18test_gpt_tokenizerR9gpt_vocabRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

declare void @_Z12gpt_tokenizeRK9gpt_vocabRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::vector.44") align 8, ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

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

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

declare ptr @ggml_gallocr_new(ptr noundef) local_unnamed_addr #4

declare ptr @ggml_backend_get_default_buffer_type(ptr noundef) local_unnamed_addr #4

declare zeroext i1 @ggml_gallocr_reserve(ptr noundef, ptr noundef) local_unnamed_addr #4

declare i64 @ggml_gallocr_get_buffer_size(ptr noundef, i32 noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL20gpt2_kv_cache_seq_cpR13gpt2_kv_cacheiiii(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2EmRKS6_(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 void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

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

declare noundef i32 @_Z22gpt_sample_top_k_top_pRK9gpt_vocabPKfiddRSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef, i32 noundef, double noundef, double noundef, ptr noundef nonnull align 8 dereferenceable(5000)) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #3

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

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

declare void @ggml_gallocr_free(ptr noundef) local_unnamed_addr #4

declare void @ggml_backend_buffer_free(ptr noundef) local_unnamed_addr #4

declare void @ggml_backend_free(ptr noundef) local_unnamed_addr #4

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

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

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

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

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

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

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

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


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