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

; 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.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.14", %"class.std::map.19", %"class.std::vector" }
%"class.std::map.14" = type { %"class.std::_Rb_tree.15" }
%"class.std::_Rb_tree.15" = 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.19" = type { %"class.std::_Rb_tree.20" }
%"class.std::_Rb_tree.20" = 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", 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 }
%"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.35" = type { %"struct.std::_Vector_base.36" }
%"struct.std::_Vector_base.36" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.30" = type { %"struct.std::_Vector_base.31" }
%"struct.std::_Vector_base.31" = 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.__gnu_cxx::__normal_iterator" = type { ptr }

@stderr = external global ptr, align 8
@.str.42 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [15 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [3 x i8], align 1
@stdout = external global ptr, align 8
@.str.52 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.55 = 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z15gpt2_model_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10gpt2_modelR9gpt_vocab(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(120)) #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: mustprogress uwtable
declare dso_local noundef ptr @_Z10gpt2_graphRK10gpt2_modelii(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i32 noundef) #2

declare void @ggml_free(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z9gpt2_evalRK10gpt2_modelP12ggml_gallocriiRKSt6vectorIiSaIiEERS4_IfSaIfEE(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 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 norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #5 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 ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca %"class.std::vector.35", align 8
  %26 = alloca %"class.std::vector.30", align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca %"class.std::vector.30", align 8
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  %34 = alloca i32, align 4
  %35 = alloca float, align 4
  %36 = alloca float, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i64, align 8
  %40 = alloca i64, align 8
  %41 = alloca ptr, align 8
  %42 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %43 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %44 = alloca i32, align 4
  %45 = alloca i64, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @ggml_time_init()
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %46 = call i64 @ggml_time_us()
  store i64 %46, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 160, ptr %7) #8
  call void @_ZN10gpt_paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(160) %7)
  %47 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 13
  %48 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %47, ptr noundef @.str.42)
          to label %49 unwind label %57

49:                                               ; preds = %2
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = load ptr, ptr %5, align 8, !tbaa !9
  %52 = invoke noundef zeroext i1 @_Z16gpt_params_parseiPPcR10gpt_params(i32 noundef %50, ptr noundef %51, ptr noundef nonnull align 8 dereferenceable(160) %7)
          to label %53 unwind label %57

53:                                               ; preds = %49
  %54 = zext i1 %52 to i32
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %61

56:                                               ; preds = %53
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %451

57:                                               ; preds = %69, %49, %2
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %8, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %9, align 4
  br label %453

61:                                               ; preds = %53
  %62 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 0
  %63 = load i32, ptr %62, align 8, !tbaa !13
  %64 = icmp slt i32 %63, 0
  br i1 %64, label %65, label %69

65:                                               ; preds = %61
  %66 = call i64 @time(ptr noundef null) #8
  %67 = trunc i64 %66 to i32
  %68 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 0
  store i32 %67, ptr %68, align 8, !tbaa !13
  br label %69

69:                                               ; preds = %65, %61
  %70 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 0
  %71 = load i32, ptr %70, align 8, !tbaa !13
  %72 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.43, ptr noundef @__func__.main, i32 noundef %71)
          to label %73 unwind label %57

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 5000, ptr %11) #8
  %74 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 0
  %75 = load i32, ptr %74, align 8, !tbaa !13
  %76 = sext i32 %75 to i64
  invoke void @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEC2Em(ptr noundef nonnull align 8 dereferenceable(5000) %11, i64 noundef %76)
          to label %77 unwind label %84

77:                                               ; preds = %73
  %78 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 14
  %79 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %78) #8
  br i1 %79, label %80, label %92

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #8
  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 %81 unwind label %88

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

84:                                               ; preds = %73
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %8, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %9, align 4
  br label %450

88:                                               ; preds = %80
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %8, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #8
  br label %450

92:                                               ; preds = %81, %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store i64 0, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 120, ptr %14) #8
  call void @_ZN9gpt_vocabC2Ev(ptr noundef nonnull align 8 dereferenceable(120) %14) #8
  call void @llvm.lifetime.start.p0(i64 168, ptr %15) #8
  call void @_ZN10gpt2_modelC2Ev(ptr noundef nonnull align 8 dereferenceable(168) %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %93 = invoke i64 @ggml_time_us()
          to label %94 unwind label %103

94:                                               ; preds = %92
  store i64 %93, ptr %16, align 8, !tbaa !11
  %95 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 13
  %96 = invoke noundef zeroext i1 @_Z15gpt2_model_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10gpt2_modelR9gpt_vocab(ptr noundef nonnull align 8 dereferenceable(32) %95, ptr noundef nonnull align 8 dereferenceable(168) %15, ptr noundef nonnull align 8 dereferenceable(120) %14)
          to label %97 unwind label %103

97:                                               ; preds = %94
  br i1 %96, label %107, label %98

98:                                               ; preds = %97
  %99 = load ptr, ptr @stderr, align 8, !tbaa !9
  %100 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 13
  %101 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %100) #8
  %102 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef @.str.44, ptr noundef @__func__.main, ptr noundef %101) #8
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %114

103:                                              ; preds = %109, %107, %94, %92
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %8, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %449

107:                                              ; preds = %97
  %108 = invoke i64 @ggml_time_us()
          to label %109 unwind label %103

109:                                              ; preds = %107
  %110 = load i64, ptr %16, align 8, !tbaa !11
  %111 = sub nsw i64 %108, %110
  store i64 %111, ptr %13, align 8, !tbaa !11
  %112 = 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) %112)
          to label %113 unwind label %103

113:                                              ; preds = %109
  store i32 0, ptr %10, align 4
  br label %114

114:                                              ; preds = %113, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  %115 = load i32, ptr %10, align 4
  switch i32 %115, label %448 [
    i32 0, label %116
  ]

116:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  store ptr null, ptr %17, align 8, !tbaa !9
  %117 = invoke ptr @ggml_backend_cpu_buffer_type()
          to label %118 unwind label %178

118:                                              ; preds = %116
  %119 = invoke ptr @ggml_gallocr_new(ptr noundef %117)
          to label %120 unwind label %178

120:                                              ; preds = %118
  store ptr %119, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %121 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 0
  %122 = getelementptr inbounds %struct.gpt2_hparams, ptr %121, i32 0, i32 1
  %123 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 4
  %124 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %122, ptr noundef nonnull align 4 dereferenceable(4) %123)
          to label %125 unwind label %182

125:                                              ; preds = %120
  %126 = load i32, ptr %124, align 4, !tbaa !5
  store i32 %126, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %127 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 0
  %128 = getelementptr inbounds %struct.gpt2_hparams, ptr %127, i32 0, i32 1
  %129 = load i32, ptr %128, align 4, !tbaa !19
  %130 = load i32, ptr %18, align 4, !tbaa !5
  %131 = sub nsw i32 %129, %130
  store i32 %131, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %132 = load i32, ptr %19, align 4, !tbaa !5
  %133 = load i32, ptr %18, align 4, !tbaa !5
  %134 = invoke noundef ptr @_Z10gpt2_graphRK10gpt2_modelii(ptr noundef nonnull align 8 dereferenceable(168) %15, i32 noundef %132, i32 noundef %133)
          to label %135 unwind label %186

135:                                              ; preds = %125
  store ptr %134, ptr %20, align 8, !tbaa !9
  %136 = load ptr, ptr %17, align 8, !tbaa !9
  %137 = load ptr, ptr %20, align 8, !tbaa !9
  %138 = invoke zeroext i1 @ggml_gallocr_reserve(ptr noundef %136, ptr noundef %137)
          to label %139 unwind label %186

139:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %140 = load ptr, ptr %17, align 8, !tbaa !9
  %141 = invoke i64 @ggml_gallocr_get_buffer_size(ptr noundef %140, i32 noundef 0)
          to label %142 unwind label %190

142:                                              ; preds = %139
  store i64 %141, ptr %21, align 8, !tbaa !11
  %143 = load ptr, ptr @stderr, align 8, !tbaa !9
  %144 = load i64, ptr %21, align 8, !tbaa !11
  %145 = uitofp i64 %144 to double
  %146 = fdiv double %145, 1.024000e+03
  %147 = fdiv double %146, 1.024000e+03
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %143, ptr noundef @.str.45, ptr noundef @__func__.main, double noundef %147) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  store i64 0, ptr %23, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  store i64 0, ptr %24, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #8
  call void @_ZNSt6vectorIfSaIfEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #8
  %149 = 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.30") align 8 %26, ptr noundef nonnull align 8 dereferenceable(120) %14, ptr noundef nonnull align 8 dereferenceable(32) %149)
          to label %150 unwind label %196

150:                                              ; preds = %142
  %151 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %152 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 0
  %153 = getelementptr inbounds %struct.gpt2_hparams, ptr %152, i32 0, i32 1
  %154 = load i32, ptr %153, align 4, !tbaa !19
  %155 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %156 = trunc i64 %155 to i32
  %157 = sub nsw i32 %154, %156
  store i32 %157, ptr %27, align 4, !tbaa !5
  %158 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %151, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %159 unwind label %200

159:                                              ; preds = %150
  %160 = load i32, ptr %158, align 4, !tbaa !5
  %161 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 2
  store i32 %160, ptr %161, align 8, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  %162 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 14
  %163 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %162) #8
  %164 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.46, ptr noundef @__func__.main, ptr noundef %163)
          to label %165 unwind label %204

165:                                              ; preds = %159
  %166 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %167 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.47, ptr noundef @__func__.main, i64 noundef %166)
          to label %168 unwind label %204

168:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 0, ptr %28, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %219, %168
  %170 = load i32, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 8, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  %171 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %172 = trunc i64 %171 to i32
  store i32 %172, ptr %30, align 4, !tbaa !5
  %173 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %29, ptr noundef nonnull align 4 dereferenceable(4) %30)
          to label %174 unwind label %208

174:                                              ; preds = %169
  %175 = load i32, ptr %173, align 4, !tbaa !5
  %176 = icmp slt i32 %170, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br i1 %176, label %212, label %177

177:                                              ; preds = %174
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  br label %227

178:                                              ; preds = %118, %116
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %8, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %9, align 4
  br label %447

182:                                              ; preds = %120
  %183 = landingpad { ptr, i32 }
          cleanup
  %184 = extractvalue { ptr, i32 } %183, 0
  store ptr %184, ptr %8, align 8
  %185 = extractvalue { ptr, i32 } %183, 1
  store i32 %185, ptr %9, align 4
  br label %195

186:                                              ; preds = %135, %125
  %187 = landingpad { ptr, i32 }
          cleanup
  %188 = extractvalue { ptr, i32 } %187, 0
  store ptr %188, ptr %8, align 8
  %189 = extractvalue { ptr, i32 } %187, 1
  store i32 %189, ptr %9, align 4
  br label %194

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

194:                                              ; preds = %190, %186
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %195

195:                                              ; preds = %194, %182
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %447

196:                                              ; preds = %142
  %197 = landingpad { ptr, i32 }
          cleanup
  %198 = extractvalue { ptr, i32 } %197, 0
  store ptr %198, ptr %8, align 8
  %199 = extractvalue { ptr, i32 } %197, 1
  store i32 %199, ptr %9, align 4
  br label %446

200:                                              ; preds = %150
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %8, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %445

204:                                              ; preds = %227, %165, %159
  %205 = landingpad { ptr, i32 }
          cleanup
  %206 = extractvalue { ptr, i32 } %205, 0
  store ptr %206, ptr %8, align 8
  %207 = extractvalue { ptr, i32 } %205, 1
  store i32 %207, ptr %9, align 4
  br label %445

208:                                              ; preds = %169
  %209 = landingpad { ptr, i32 }
          cleanup
  %210 = extractvalue { ptr, i32 } %209, 0
  store ptr %210, ptr %8, align 8
  %211 = extractvalue { ptr, i32 } %209, 1
  store i32 %211, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %226

212:                                              ; preds = %174
  %213 = load i32, ptr %28, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %214) #8
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.48, i32 noundef %216)
          to label %218 unwind label %222

218:                                              ; preds = %212
  br label %219

219:                                              ; preds = %218
  %220 = load i32, ptr %28, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %28, align 4, !tbaa !5
  br label %169, !llvm.loop !35

222:                                              ; preds = %212
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %8, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %9, align 4
  br label %226

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

227:                                              ; preds = %177
  %228 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.49)
          to label %229 unwind label %204

229:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 24, ptr %31) #8
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %230 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #8
  store i64 %230, ptr %32, align 8, !tbaa !11
  br label %231

231:                                              ; preds = %388, %229
  %232 = load i64, ptr %32, align 8, !tbaa !11
  %233 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %234 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 2
  %235 = load i32, ptr %234, align 8, !tbaa !34
  %236 = sext i32 %235 to i64
  %237 = add i64 %233, %236
  %238 = icmp ult i64 %232, %237
  br i1 %238, label %240, label %239

239:                                              ; preds = %231
  store i32 5, ptr %10, align 4
  br label %391

240:                                              ; preds = %231
  %241 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #8
  %242 = icmp ugt i64 %241, 0
  br i1 %242, label %243, label %269

243:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %244 = invoke i64 @ggml_time_us()
          to label %245 unwind label %255

245:                                              ; preds = %243
  store i64 %244, ptr %33, align 8, !tbaa !11
  %246 = load ptr, ptr %17, align 8, !tbaa !9
  %247 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 1
  %248 = load i32, ptr %247, align 4, !tbaa !37
  %249 = load i32, ptr %22, align 4, !tbaa !5
  %250 = invoke noundef zeroext i1 @_Z9gpt2_evalRK10gpt2_modelP12ggml_gallocriiRKSt6vectorIiSaIiEERS4_IfSaIfEE(ptr noundef nonnull align 8 dereferenceable(168) %15, ptr noundef %246, i32 noundef %248, i32 noundef %249, ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(24) %25)
          to label %251 unwind label %255

251:                                              ; preds = %245
  br i1 %250, label %259, label %252

252:                                              ; preds = %251
  %253 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.50)
          to label %254 unwind label %255

254:                                              ; preds = %252
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %266

255:                                              ; preds = %259, %252, %245, %243
  %256 = landingpad { ptr, i32 }
          cleanup
  %257 = extractvalue { ptr, i32 } %256, 0
  store ptr %257, ptr %8, align 8
  %258 = extractvalue { ptr, i32 } %256, 1
  store i32 %258, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  br label %393

259:                                              ; preds = %251
  %260 = invoke i64 @ggml_time_us()
          to label %261 unwind label %255

261:                                              ; preds = %259
  %262 = load i64, ptr %33, align 8, !tbaa !11
  %263 = sub nsw i64 %260, %262
  %264 = load i64, ptr %24, align 8, !tbaa !11
  %265 = add nsw i64 %264, %263
  store i64 %265, ptr %24, align 8, !tbaa !11
  store i32 0, ptr %10, align 4
  br label %266

266:                                              ; preds = %261, %254
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  %267 = load i32, ptr %10, align 4
  switch i32 %267, label %391 [
    i32 0, label %268
  ]

268:                                              ; preds = %266
  br label %269

269:                                              ; preds = %268, %240
  %270 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #8
  %271 = load i32, ptr %22, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = add i64 %272, %270
  %274 = trunc i64 %273 to i32
  store i32 %274, ptr %22, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #8
  %275 = load i64, ptr %32, align 8, !tbaa !11
  %276 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %277 = icmp uge i64 %275, %276
  br i1 %277, label %278, label %319

278:                                              ; preds = %269
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %279 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 8
  %280 = load i32, ptr %279, align 8, !tbaa !38
  store i32 %280, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  %281 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 9
  %282 = load float, ptr %281, align 4, !tbaa !39
  store float %282, ptr %35, align 4, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %283 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 10
  %284 = load float, ptr %283, align 8, !tbaa !41
  store float %284, ptr %36, align 4, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  %285 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 0
  %286 = getelementptr inbounds %struct.gpt2_hparams, ptr %285, i32 0, i32 0
  %287 = load i32, ptr %286, align 8, !tbaa !42
  store i32 %287, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  store i32 0, ptr %38, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %288 = invoke i64 @ggml_time_us()
          to label %289 unwind label %310

289:                                              ; preds = %278
  store i64 %288, ptr %39, align 8, !tbaa !11
  %290 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  %291 = call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  %292 = load i32, ptr %37, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = sub i64 %291, %293
  %295 = getelementptr inbounds float, ptr %290, i64 %294
  %296 = load i32, ptr %34, align 4, !tbaa !5
  %297 = load float, ptr %35, align 4, !tbaa !40
  %298 = fpext float %297 to double
  %299 = load float, ptr %36, align 4, !tbaa !40
  %300 = fpext float %299 to double
  %301 = invoke noundef i32 @_Z22gpt_sample_top_k_top_pRK9gpt_vocabPKfiddRSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE(ptr noundef nonnull align 8 dereferenceable(120) %14, ptr noundef %295, i32 noundef %296, double noundef %298, double noundef %300, ptr noundef nonnull align 8 dereferenceable(5000) %11)
          to label %302 unwind label %310

302:                                              ; preds = %289
  store i32 %301, ptr %38, align 4, !tbaa !5
  %303 = invoke i64 @ggml_time_us()
          to label %304 unwind label %310

304:                                              ; preds = %302
  %305 = load i64, ptr %39, align 8, !tbaa !11
  %306 = sub nsw i64 %303, %305
  %307 = load i64, ptr %23, align 8, !tbaa !11
  %308 = add nsw i64 %307, %306
  store i64 %308, ptr %23, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 4 dereferenceable(4) %38)
          to label %309 unwind label %314

309:                                              ; preds = %304
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %350

310:                                              ; preds = %302, %289, %278
  %311 = landingpad { ptr, i32 }
          cleanup
  %312 = extractvalue { ptr, i32 } %311, 0
  store ptr %312, ptr %8, align 8
  %313 = extractvalue { ptr, i32 } %311, 1
  store i32 %313, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  br label %318

314:                                              ; preds = %304
  %315 = landingpad { ptr, i32 }
          cleanup
  %316 = extractvalue { ptr, i32 } %315, 0
  store ptr %316, ptr %8, align 8
  %317 = extractvalue { ptr, i32 } %315, 1
  store i32 %317, ptr %9, align 4
  br label %318

318:                                              ; preds = %314, %310
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %393

319:                                              ; preds = %269
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  %320 = load i64, ptr %32, align 8, !tbaa !11
  store i64 %320, ptr %40, align 8, !tbaa !11
  br label %321

321:                                              ; preds = %341, %319
  %322 = load i64, ptr %40, align 8, !tbaa !11
  %323 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %324 = icmp ult i64 %322, %323
  br i1 %324, label %326, label %325

325:                                              ; preds = %321
  store i32 8, ptr %10, align 4
  br label %344

326:                                              ; preds = %321
  %327 = load i64, ptr %40, align 8, !tbaa !11
  %328 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %327) #8
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 4 dereferenceable(4) %328)
          to label %329 unwind label %336

329:                                              ; preds = %326
  %330 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #8
  %331 = trunc i64 %330 to i32
  %332 = getelementptr inbounds %struct.gpt_params, ptr %7, i32 0, i32 4
  %333 = load i32, ptr %332, align 8, !tbaa !43
  %334 = icmp sge i32 %331, %333
  br i1 %334, label %335, label %340

335:                                              ; preds = %329
  store i32 8, ptr %10, align 4
  br label %344

336:                                              ; preds = %326
  %337 = landingpad { ptr, i32 }
          cleanup
  %338 = extractvalue { ptr, i32 } %337, 0
  store ptr %338, ptr %8, align 8
  %339 = extractvalue { ptr, i32 } %337, 1
  store i32 %339, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  br label %393

340:                                              ; preds = %329
  br label %341

341:                                              ; preds = %340
  %342 = load i64, ptr %40, align 8, !tbaa !11
  %343 = add i64 %342, 1
  store i64 %343, ptr %40, align 8, !tbaa !11
  br label %321, !llvm.loop !44

344:                                              ; preds = %335, %325
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  br label %345

345:                                              ; preds = %344
  %346 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #8
  %347 = sub i64 %346, 1
  %348 = load i64, ptr %32, align 8, !tbaa !11
  %349 = add i64 %348, %347
  store i64 %349, ptr %32, align 8, !tbaa !11
  br label %350

350:                                              ; preds = %345, %309
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  store ptr %31, ptr %41, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  %351 = load ptr, ptr %41, align 8, !tbaa !9
  %352 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %351) #8
  %353 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %42, i32 0, i32 0
  store ptr %352, ptr %353, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #8
  %354 = load ptr, ptr %41, align 8, !tbaa !9
  %355 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %354) #8
  %356 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %43, i32 0, i32 0
  store ptr %355, ptr %356, align 8
  br label %357

357:                                              ; preds = %369, %350
  %358 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull align 8 dereferenceable(8) %43) #8
  br i1 %358, label %360, label %359

359:                                              ; preds = %357
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  br label %375

360:                                              ; preds = %357
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #8
  %361 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %42) #8
  %362 = load i32, ptr %361, align 4, !tbaa !5
  store i32 %362, ptr %44, align 4, !tbaa !5
  %363 = getelementptr inbounds %struct.gpt_vocab, ptr %14, i32 0, i32 1
  %364 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt3mapIiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIiESaISt4pairIKiS5_EEEixERS9_(ptr noundef nonnull align 8 dereferenceable(48) %363, ptr noundef nonnull align 4 dereferenceable(4) %44)
          to label %365 unwind label %371

365:                                              ; preds = %360
  %366 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %364) #8
  %367 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.51, ptr noundef %366)
          to label %368 unwind label %371

368:                                              ; preds = %365
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  br label %369

369:                                              ; preds = %368
  %370 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %42) #8
  br label %357

371:                                              ; preds = %365, %360
  %372 = landingpad { ptr, i32 }
          cleanup
  %373 = extractvalue { ptr, i32 } %372, 0
  store ptr %373, ptr %8, align 8
  %374 = extractvalue { ptr, i32 } %372, 1
  store i32 %374, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  br label %393

375:                                              ; preds = %359
  %376 = load ptr, ptr @stdout, align 8, !tbaa !9
  %377 = invoke i32 @fflush(ptr noundef %376)
          to label %378 unwind label %383

378:                                              ; preds = %375
  %379 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #8
  %380 = load i32, ptr %379, align 4, !tbaa !5
  %381 = icmp eq i32 %380, 50256
  br i1 %381, label %382, label %387

382:                                              ; preds = %378
  store i32 5, ptr %10, align 4
  br label %391

383:                                              ; preds = %375
  %384 = landingpad { ptr, i32 }
          cleanup
  %385 = extractvalue { ptr, i32 } %384, 0
  store ptr %385, ptr %8, align 8
  %386 = extractvalue { ptr, i32 } %384, 1
  store i32 %386, ptr %9, align 4
  br label %393

387:                                              ; preds = %378
  br label %388

388:                                              ; preds = %387
  %389 = load i64, ptr %32, align 8, !tbaa !11
  %390 = add i64 %389, 1
  store i64 %390, ptr %32, align 8, !tbaa !11
  br label %231, !llvm.loop !45

391:                                              ; preds = %382, %266, %239
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  %392 = load i32, ptr %10, align 4
  switch i32 %392, label %443 [
    i32 5, label %394
  ]

393:                                              ; preds = %383, %371, %336, %318, %255
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %444

394:                                              ; preds = %391
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #8
  %395 = invoke i64 @ggml_time_us()
          to label %396 unwind label %435

396:                                              ; preds = %394
  store i64 %395, ptr %45, align 8, !tbaa !11
  %397 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.49)
          to label %398 unwind label %435

398:                                              ; preds = %396
  %399 = load i64, ptr %13, align 8, !tbaa !11
  %400 = sitofp i64 %399 to float
  %401 = fdiv float %400, 1.000000e+03
  %402 = fpext float %401 to double
  %403 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.52, ptr noundef @__func__.main, double noundef %402)
          to label %404 unwind label %435

404:                                              ; preds = %398
  %405 = load i64, ptr %23, align 8, !tbaa !11
  %406 = sitofp i64 %405 to float
  %407 = fdiv float %406, 1.000000e+03
  %408 = fpext float %407 to double
  %409 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.53, ptr noundef @__func__.main, double noundef %408)
          to label %410 unwind label %435

410:                                              ; preds = %404
  %411 = load i64, ptr %24, align 8, !tbaa !11
  %412 = sitofp i64 %411 to float
  %413 = fdiv float %412, 1.000000e+03
  %414 = fpext float %413 to double
  %415 = load i64, ptr %24, align 8, !tbaa !11
  %416 = sitofp i64 %415 to float
  %417 = fdiv float %416, 1.000000e+03
  %418 = load i32, ptr %22, align 4, !tbaa !5
  %419 = sitofp i32 %418 to float
  %420 = fdiv float %417, %419
  %421 = fpext float %420 to double
  %422 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.54, ptr noundef @__func__.main, double noundef %414, double noundef %421)
          to label %423 unwind label %435

423:                                              ; preds = %410
  %424 = load i64, ptr %45, align 8, !tbaa !11
  %425 = load i64, ptr %6, align 8, !tbaa !11
  %426 = sub nsw i64 %424, %425
  %427 = sitofp i64 %426 to float
  %428 = fdiv float %427, 1.000000e+03
  %429 = fpext float %428 to double
  %430 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.55, ptr noundef @__func__.main, double noundef %429)
          to label %431 unwind label %435

431:                                              ; preds = %423
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  %432 = getelementptr inbounds %struct.gpt2_model, ptr %15, i32 0, i32 9
  %433 = load ptr, ptr %432, align 8, !tbaa !46
  invoke void @ggml_free(ptr noundef %433)
          to label %434 unwind label %439

434:                                              ; preds = %431
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %443

435:                                              ; preds = %423, %410, %404, %398, %396, %394
  %436 = landingpad { ptr, i32 }
          cleanup
  %437 = extractvalue { ptr, i32 } %436, 0
  store ptr %437, ptr %8, align 8
  %438 = extractvalue { ptr, i32 } %436, 1
  store i32 %438, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  br label %444

439:                                              ; preds = %431
  %440 = landingpad { ptr, i32 }
          cleanup
  %441 = extractvalue { ptr, i32 } %440, 0
  store ptr %441, ptr %8, align 8
  %442 = extractvalue { ptr, i32 } %440, 1
  store i32 %442, ptr %9, align 4
  br label %444

443:                                              ; preds = %434, %391
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #8
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %448

444:                                              ; preds = %439, %435, %393
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #8
  br label %445

445:                                              ; preds = %444, %226, %204, %200
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  br label %446

446:                                              ; preds = %445, %196
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #8
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %447

447:                                              ; preds = %446, %195, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %449

448:                                              ; preds = %443, %114
  call void @_ZN10gpt2_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(168) %15) #8
  call void @llvm.lifetime.end.p0(i64 168, ptr %15) #8
  call void @_ZN9gpt_vocabD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %14) #8
  call void @llvm.lifetime.end.p0(i64 120, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 5000, ptr %11) #8
  br label %451

449:                                              ; preds = %447, %103
  call void @_ZN10gpt2_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(168) %15) #8
  call void @llvm.lifetime.end.p0(i64 168, ptr %15) #8
  call void @_ZN9gpt_vocabD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %14) #8
  call void @llvm.lifetime.end.p0(i64 120, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %450

450:                                              ; preds = %449, %88, %84
  call void @llvm.lifetime.end.p0(i64 5000, ptr %11) #8
  br label %453

451:                                              ; preds = %448, %56
  call void @_ZN10gpt_paramsD2Ev(ptr noundef nonnull align 8 dereferenceable(160) %7) #8
  call void @llvm.lifetime.end.p0(i64 160, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  %452 = load i32, ptr %3, align 4
  ret i32 %452

453:                                              ; preds = %450, %57
  call void @_ZN10gpt_paramsD2Ev(ptr noundef nonnull align 8 dereferenceable(160) %7) #8
  call void @llvm.lifetime.end.p0(i64 160, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %454

454:                                              ; preds = %453
  %455 = load ptr, ptr %8, align 8
  %456 = load i32, ptr %9, align 4
  %457 = insertvalue { ptr, i32 } poison, ptr %455, 0
  %458 = insertvalue { ptr, i32 } %457, i32 %456, 1
  resume { ptr, i32 } %458
}

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 #6 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10gpt2_modelC2Ev(ptr noundef nonnull align 8 dereferenceable(168)) unnamed_addr #7 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 ptr @ggml_gallocr_new(ptr noundef) #3

declare ptr @ggml_backend_cpu_buffer_type() #3

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

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

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

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #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

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

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

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

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

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

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

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

declare i32 @fflush(ptr noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10gpt2_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(168)) unnamed_addr #7 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10gpt_paramsD2Ev(ptr noundef nonnull align 8 dereferenceable(160)) unnamed_addr #7 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 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }

!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 = !{!20, !6, i64 4}
!20 = !{!"_ZTS10gpt2_model", !21, i64 0, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !22, i64 72, !10, i64 96, !10, i64 104, !10, i64 112, !26, i64 120}
!21 = !{!"_ZTS12gpt2_hparams", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !16, i64 24}
!22 = !{!"_ZTSSt6vectorI10gpt2_layerSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseI10gpt2_layerSaIS0_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!26 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP11ggml_tensorSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !27, i64 0}
!27 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !28, i64 0}
!28 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !29, i64 0, !31, i64 8}
!29 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !30, i64 0}
!30 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!31 = !{!"_ZTSSt15_Rb_tree_header", !32, i64 0, !12, i64 32}
!32 = !{!"_ZTSSt18_Rb_tree_node_base", !33, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!33 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!34 = !{!14, !6, i64 8}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!14, !6, i64 4}
!38 = !{!14, !6, i64 32}
!39 = !{!14, !16, i64 36}
!40 = !{!16, !16, i64 0}
!41 = !{!14, !16, i64 40}
!42 = !{!20, !6, i64 0}
!43 = !{!14, !6, i64 16}
!44 = distinct !{!44, !36}
!45 = distinct !{!45, !36}
!46 = !{!20, !10, i64 112}


; 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.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.14", %"class.std::map.19", %"class.std::vector" }
%"class.std::map.14" = type { %"class.std::_Rb_tree.15" }
%"class.std::_Rb_tree.15" = 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.19" = type { %"class.std::_Rb_tree.20" }
%"class.std::_Rb_tree.20" = 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", 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 }
%"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.35" = type { %"struct.std::_Vector_base.36" }
%"struct.std::_Vector_base.36" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.30" = type { %"struct.std::_Vector_base.31" }
%"struct.std::_Vector_base.31" = 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.__gnu_cxx::__normal_iterator" = type { ptr }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.42 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [15 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [3 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.52 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.55 = 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z15gpt2_model_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10gpt2_modelR9gpt_vocab(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(120)) 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_modelii(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @ggml_free(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z9gpt2_evalRK10gpt2_modelP12ggml_gallocriiRKSt6vectorIiSaIiEERS4_IfSaIfEE(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 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 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.35", align 8
  %9 = alloca %"class.std::vector.30", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::vector.30", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i32, align 4
  tail call void @ggml_time_init()
  %18 = 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)
  %19 = getelementptr inbounds i8, ptr %3, i64 56
  %20 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull @.str.42)
          to label %21 unwind label %24

21:                                               ; preds = %2
  %22 = invoke noundef zeroext i1 @_Z16gpt_params_parseiPPcR10gpt_params(i32 noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(160) %3)
          to label %23 unwind label %24

23:                                               ; preds = %21
  br i1 %22, label %26, label %255

24:                                               ; preds = %21, %2
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %256

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

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

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

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

40:                                               ; preds = %37
  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 %41 unwind label %45

41:                                               ; preds = %40
  %42 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %38, 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 %47

43:                                               ; preds = %32
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %254

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

47:                                               ; preds = %41, %37
  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 168, ptr nonnull %7) #9
  call void @_ZN10gpt2_modelC2Ev(ptr noundef nonnull align 8 dereferenceable(168) %7) #9
  %48 = invoke i64 @ggml_time_us()
          to label %49 unwind label %52

49:                                               ; preds = %47
  %50 = invoke noundef zeroext i1 @_Z15gpt2_model_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEER10gpt2_modelR9gpt_vocab(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(168) %7, ptr noundef nonnull align 8 dereferenceable(120) %6)
          to label %51 unwind label %52

51:                                               ; preds = %49
  br i1 %50, label %54, label %58

52:                                               ; preds = %56, %54, %49, %47
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %253

54:                                               ; preds = %51
  %55 = invoke i64 @ggml_time_us()
          to label %56 unwind label %52

56:                                               ; preds = %54
  %57 = 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) %57)
          to label %62 unwind label %52

58:                                               ; preds = %51
  %59 = load ptr, ptr @stderr, align 8, !tbaa !16
  %60 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #9
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef nonnull @.str.44, ptr noundef nonnull @__func__.main, ptr noundef %60) #10
  br label %252

62:                                               ; preds = %56
  %63 = sub nsw i64 %55, %48
  %64 = invoke ptr @ggml_backend_cpu_buffer_type()
          to label %65 unwind label %114

65:                                               ; preds = %62
  %66 = invoke ptr @ggml_gallocr_new(ptr noundef %64)
          to label %67 unwind label %114

67:                                               ; preds = %65
  %68 = getelementptr inbounds i8, ptr %7, i64 4
  %69 = getelementptr inbounds i8, ptr %3, i64 16
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %68, ptr noundef nonnull align 4 dereferenceable(4) %69)
  %71 = load i32, ptr %70, align 4, !tbaa !17
  %72 = load i32, ptr %68, align 4, !tbaa !18
  %73 = sub nsw i32 %72, %71
  %74 = invoke noundef ptr @_Z10gpt2_graphRK10gpt2_modelii(ptr noundef nonnull align 8 dereferenceable(168) %7, i32 noundef %73, i32 noundef %71)
          to label %75 unwind label %116

75:                                               ; preds = %67
  %76 = invoke zeroext i1 @ggml_gallocr_reserve(ptr noundef %66, ptr noundef %74)
          to label %77 unwind label %116

77:                                               ; preds = %75
  %78 = invoke i64 @ggml_gallocr_get_buffer_size(ptr noundef %66, i32 noundef 0)
          to label %79 unwind label %118

79:                                               ; preds = %77
  %80 = load ptr, ptr @stderr, align 8, !tbaa !16
  %81 = uitofp i64 %78 to double
  %82 = fmul double %81, 0x3F50000000000000
  %83 = fmul double %82, 0x3F50000000000000
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef nonnull @.str.45, ptr noundef nonnull @__func__.main, double noundef %83) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #9
  call void @_ZNSt6vectorIfSaIfEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #9
  invoke void @_Z12gpt_tokenizeRK9gpt_vocabRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.30") align 8 %9, ptr noundef nonnull align 8 dereferenceable(120) %6, ptr noundef nonnull align 8 dereferenceable(32) %38)
          to label %85 unwind label %120

85:                                               ; preds = %79
  %86 = getelementptr inbounds i8, ptr %3, i64 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #9
  %87 = load i32, ptr %68, align 4, !tbaa !18
  %88 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #9
  %89 = trunc i64 %88 to i32
  %90 = sub nsw i32 %87, %89
  store i32 %90, ptr %10, align 4, !tbaa !17
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %86, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %92 = load i32, ptr %91, align 4, !tbaa !17
  store i32 %92, ptr %86, align 8, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #9
  %93 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %38) #9
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.46, ptr noundef nonnull @__func__.main, ptr noundef %93)
  %95 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #9
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.47, ptr noundef nonnull @__func__.main, i64 noundef %95)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  store i32 8, ptr %11, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #9
  %97 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #9
  %98 = trunc i64 %97 to i32
  store i32 %98, ptr %12, align 4, !tbaa !17
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %100 = load i32, ptr %99, align 4, !tbaa !17
  %101 = icmp sgt i32 %100, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  br i1 %101, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %85
  %102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.49)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #9
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  %103 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  %104 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #9
  %105 = load i32, ptr %86, align 8, !tbaa !33
  %106 = sext i32 %105 to i64
  %107 = add i64 %104, %106
  %108 = icmp ult i64 %103, %107
  br i1 %108, label %.lr.ph125, label %._crit_edge126

.lr.ph125:                                        ; preds = %._crit_edge
  %109 = getelementptr inbounds i8, ptr %3, i64 4
  %110 = getelementptr inbounds i8, ptr %3, i64 32
  %111 = getelementptr inbounds i8, ptr %3, i64 36
  %112 = getelementptr inbounds i8, ptr %3, i64 40
  %113 = getelementptr inbounds i8, ptr %6, i64 48
  br label %138

114:                                              ; preds = %65, %62
  %115 = landingpad { ptr, i32 }
          cleanup
  br label %253

116:                                              ; preds = %75, %67
  %117 = landingpad { ptr, i32 }
          cleanup
  br label %253

118:                                              ; preds = %77
  %119 = landingpad { ptr, i32 }
          cleanup
  br label %253

120:                                              ; preds = %79
  %121 = landingpad { ptr, i32 }
          cleanup
  br label %251

.lr.ph:                                           ; preds = %85, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %85 ]
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %indvars.iv) #9
  %123 = load i32, ptr %122, align 4, !tbaa !17
  %124 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.48, i32 noundef %123)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  store i32 8, ptr %11, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #9
  %125 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #9
  %126 = trunc i64 %125 to i32
  store i32 %126, ptr %12, align 4, !tbaa !17
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %128 = load i32, ptr %127, align 4, !tbaa !17
  %129 = sext i32 %128 to i64
  %130 = icmp slt i64 %indvars.iv.next, %129
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  br i1 %130, label %.lr.ph, label %._crit_edge, !llvm.loop !34

131:                                              ; preds = %._crit_edge119
  %132 = add i64 %.176, 1
  %133 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #9
  %134 = load i32, ptr %86, align 8, !tbaa !33
  %135 = sext i32 %134 to i64
  %136 = add i64 %133, %135
  %137 = icmp ult i64 %132, %136
  br i1 %137, label %138, label %._crit_edge126.loopexit, !llvm.loop !36

138:                                              ; preds = %.lr.ph125, %131
  %.070123 = phi i32 [ 0, %.lr.ph125 ], [ %155, %131 ]
  %.072122 = phi i64 [ 0, %.lr.ph125 ], [ %.173, %131 ]
  %.075121 = phi i64 [ %103, %.lr.ph125 ], [ %132, %131 ]
  %.078120 = phi i64 [ 0, %.lr.ph125 ], [ %.280, %131 ]
  %139 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  %.not = icmp eq i64 %139, 0
  br i1 %.not, label %152, label %140

140:                                              ; preds = %138
  %141 = invoke i64 @ggml_time_us()
          to label %142 unwind label %146

142:                                              ; preds = %140
  %143 = load i32, ptr %109, align 4, !tbaa !37
  %144 = invoke noundef zeroext i1 @_Z9gpt2_evalRK10gpt2_modelP12ggml_gallocriiRKSt6vectorIiSaIiEERS4_IfSaIfEE(ptr noundef nonnull align 8 dereferenceable(168) %7, ptr noundef %66, i32 noundef %143, i32 noundef %.070123, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %145 unwind label %146

145:                                              ; preds = %142
  br i1 %144, label %148, label %218

146:                                              ; preds = %148, %142, %140
  %147 = landingpad { ptr, i32 }
          cleanup
  br label %250

148:                                              ; preds = %145
  %149 = invoke i64 @ggml_time_us()
          to label %.thread99 unwind label %146

.thread99:                                        ; preds = %148
  %150 = sub i64 %.078120, %141
  %151 = add i64 %150, %149
  br label %152

152:                                              ; preds = %.thread99, %138
  %.280 = phi i64 [ %.078120, %138 ], [ %151, %.thread99 ]
  %153 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  %154 = trunc i64 %153 to i32
  %155 = add i32 %.070123, %154
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  %156 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #9
  %.not83 = icmp ult i64 %.075121, %156
  br i1 %.not83, label %.preheader, label %159

.preheader:                                       ; preds = %152
  %157 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #9
  %158 = icmp ult i64 %.075121, %157
  br i1 %158, label %.lr.ph114, label %._crit_edge115

159:                                              ; preds = %152
  %160 = load i32, ptr %110, align 8, !tbaa !38
  %161 = load float, ptr %111, align 4, !tbaa !39
  %162 = load float, ptr %112, align 8, !tbaa !40
  %163 = load i32, ptr %7, align 8, !tbaa !41
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #9
  store i32 0, ptr %14, align 4, !tbaa !17
  %164 = invoke i64 @ggml_time_us()
          to label %165 unwind label %180

165:                                              ; preds = %159
  %166 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  %167 = call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  %168 = sext i32 %163 to i64
  %169 = sub i64 %167, %168
  %170 = getelementptr inbounds float, ptr %166, i64 %169
  %171 = fpext float %161 to double
  %172 = fpext float %162 to double
  %173 = invoke noundef i32 @_Z22gpt_sample_top_k_top_pRK9gpt_vocabPKfiddRSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE(ptr noundef nonnull align 8 dereferenceable(120) %6, ptr noundef %170, i32 noundef %160, double noundef %171, double noundef %172, ptr noundef nonnull align 8 dereferenceable(5000) %4)
          to label %174 unwind label %180

174:                                              ; preds = %165
  store i32 %173, ptr %14, align 4, !tbaa !17
  %175 = invoke i64 @ggml_time_us()
          to label %176 unwind label %180

176:                                              ; preds = %174
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %177 unwind label %182

177:                                              ; preds = %176
  %178 = sub i64 %.072122, %164
  %179 = add i64 %178, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #9
  br label %199

180:                                              ; preds = %174, %165, %159
  %181 = landingpad { ptr, i32 }
          cleanup
  br label %184

182:                                              ; preds = %176
  %183 = landingpad { ptr, i32 }
          cleanup
  br label %184

184:                                              ; preds = %182, %180
  %.pn85 = phi { ptr, i32 } [ %183, %182 ], [ %181, %180 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #9
  br label %250

185:                                              ; preds = %190
  %186 = add nuw i64 %.056113, 1
  %187 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #9
  %188 = icmp ult i64 %186, %187
  br i1 %188, label %.lr.ph114, label %._crit_edge115, !llvm.loop !42

.lr.ph114:                                        ; preds = %.preheader, %185
  %.056113 = phi i64 [ %186, %185 ], [ %.075121, %.preheader ]
  %189 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.056113) #9
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(4) %189)
          to label %190 unwind label %194

190:                                              ; preds = %.lr.ph114
  %191 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  %192 = trunc i64 %191 to i32
  %193 = load i32, ptr %69, align 8, !tbaa !43
  %.not84 = icmp sgt i32 %193, %192
  br i1 %.not84, label %185, label %._crit_edge115

194:                                              ; preds = %.lr.ph114
  %195 = landingpad { ptr, i32 }
          cleanup
  br label %250

._crit_edge115:                                   ; preds = %185, %190, %.preheader
  %196 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  %197 = add i64 %.075121, -1
  %198 = add i64 %197, %196
  br label %199

199:                                              ; preds = %._crit_edge115, %177
  %.176 = phi i64 [ %.075121, %177 ], [ %198, %._crit_edge115 ]
  %.173 = phi i64 [ %179, %177 ], [ %.072122, %._crit_edge115 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #9
  %200 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  store ptr %200, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #9
  %201 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  store ptr %201, ptr %16, align 8
  %202 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #9
  br i1 %202, label %.lr.ph118, label %._crit_edge119

._crit_edge119:                                   ; preds = %211, %199
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  %203 = load ptr, ptr @stdout, align 8, !tbaa !16
  %204 = call i32 @fflush(ptr noundef %203)
  %205 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  %206 = load i32, ptr %205, align 4, !tbaa !17
  %207 = icmp eq i32 %206, 50256
  br i1 %207, label %._crit_edge126.loopexit, label %131

.lr.ph118:                                        ; preds = %199, %211
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #9
  %208 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #9
  %209 = load i32, ptr %208, align 4, !tbaa !17
  store i32 %209, ptr %17, align 4, !tbaa !17
  %210 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt3mapIiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIiESaISt4pairIKiS5_EEEixERS9_(ptr noundef nonnull align 8 dereferenceable(48) %113, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %211 unwind label %216

211:                                              ; preds = %.lr.ph118
  %212 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %210) #9
  %213 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.51, ptr noundef %212)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #9
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #9
  %215 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #9
  br i1 %215, label %.lr.ph118, label %._crit_edge119

216:                                              ; preds = %.lr.ph118
  %217 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  br label %250

218:                                              ; preds = %145
  %219 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.50)
  br label %249

._crit_edge126.loopexit:                          ; preds = %131, %._crit_edge119
  %220 = sitofp i64 %.173 to float
  %221 = sitofp i64 %.280 to float
  %222 = sitofp i32 %155 to float
  br label %._crit_edge126

._crit_edge126:                                   ; preds = %._crit_edge126.loopexit, %._crit_edge
  %.381.ph = phi float [ 0.000000e+00, %._crit_edge ], [ %221, %._crit_edge126.loopexit ]
  %.274.ph = phi float [ 0.000000e+00, %._crit_edge ], [ %220, %._crit_edge126.loopexit ]
  %.171.ph = phi float [ 0.000000e+00, %._crit_edge ], [ %222, %._crit_edge126.loopexit ]
  %223 = invoke i64 @ggml_time_us()
          to label %224 unwind label %245

224:                                              ; preds = %._crit_edge126
  %225 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.49)
  %226 = sitofp i64 %63 to float
  %227 = fdiv float %226, 1.000000e+03
  %228 = fpext float %227 to double
  %229 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.52, ptr noundef nonnull @__func__.main, double noundef %228)
  %230 = fdiv float %.274.ph, 1.000000e+03
  %231 = fpext float %230 to double
  %232 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.53, ptr noundef nonnull @__func__.main, double noundef %231)
  %233 = fdiv float %.381.ph, 1.000000e+03
  %234 = fpext float %233 to double
  %235 = fdiv float %233, %.171.ph
  %236 = fpext float %235 to double
  %237 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.54, ptr noundef nonnull @__func__.main, double noundef %234, double noundef %236)
  %238 = sub nsw i64 %223, %18
  %239 = sitofp i64 %238 to float
  %240 = fdiv float %239, 1.000000e+03
  %241 = fpext float %240 to double
  %242 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.55, ptr noundef nonnull @__func__.main, double noundef %241)
  %243 = getelementptr inbounds i8, ptr %7, i64 112
  %244 = load ptr, ptr %243, align 8, !tbaa !44
  invoke void @ggml_free(ptr noundef %244)
          to label %249 unwind label %247

245:                                              ; preds = %._crit_edge126
  %246 = landingpad { ptr, i32 }
          cleanup
  br label %250

247:                                              ; preds = %224
  %248 = landingpad { ptr, i32 }
          cleanup
  br label %250

249:                                              ; preds = %218, %224
  %.5 = phi i32 [ 1, %218 ], [ 0, %224 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #9
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #9
  br label %252

250:                                              ; preds = %146, %184, %194, %216, %247, %245
  %.pn87.pn = phi { ptr, i32 } [ %248, %247 ], [ %246, %245 ], [ %217, %216 ], [ %.pn85, %184 ], [ %195, %194 ], [ %147, %146 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #9
  br label %251

251:                                              ; preds = %250, %120
  %.pn87.pn.pn = phi { ptr, i32 } [ %.pn87.pn, %250 ], [ %121, %120 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #9
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #9
  br label %253

252:                                              ; preds = %58, %249
  %.6 = phi i32 [ %.5, %249 ], [ 1, %58 ]
  call void @_ZN10gpt2_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(168) %7) #9
  call void @llvm.lifetime.end.p0(i64 168, 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 %255

253:                                              ; preds = %114, %251, %118, %116, %52
  %.pn87.pn.pn.pn.pn = phi { ptr, i32 } [ %53, %52 ], [ %.pn87.pn.pn, %251 ], [ %115, %114 ], [ %119, %118 ], [ %117, %116 ]
  call void @_ZN10gpt2_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(168) %7) #9
  call void @llvm.lifetime.end.p0(i64 168, 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 %254

254:                                              ; preds = %253, %45, %43
  %.pn87.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn87.pn.pn.pn.pn, %253 ], [ %46, %45 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %4) #9
  br label %256

255:                                              ; preds = %23, %252
  %.7 = phi i32 [ %.6, %252 ], [ 1, %23 ]
  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 %.7

256:                                              ; preds = %254, %24
  %.pn87.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn87.pn.pn.pn.pn.pn, %254 ], [ %25, %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
  resume { ptr, i32 } %.pn87.pn.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

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

declare ptr @ggml_backend_cpu_buffer_type() local_unnamed_addr #4

; 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

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

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

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

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

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

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

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

; 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 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10gpt2_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(168)) 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

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 = !{!14, !14, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !7, i64 4}
!19 = !{!"_ZTS10gpt2_model", !20, i64 0, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !21, i64 72, !14, i64 96, !14, i64 104, !14, i64 112, !25, i64 120}
!20 = !{!"_ZTS12gpt2_hparams", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !11, i64 24}
!21 = !{!"_ZTSSt6vectorI10gpt2_layerSaIS0_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseI10gpt2_layerSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!25 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP11ggml_tensorSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !26, i64 0}
!26 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !27, i64 0}
!27 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !28, i64 0, !30, i64 8}
!28 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !29, i64 0}
!29 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!30 = !{!"_ZTSSt15_Rb_tree_header", !31, i64 0, !15, i64 32}
!31 = !{!"_ZTSSt18_Rb_tree_node_base", !32, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!32 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!33 = !{!6, !7, i64 8}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = distinct !{!36, !35}
!37 = !{!6, !7, i64 4}
!38 = !{!6, !7, i64 32}
!39 = !{!6, !11, i64 36}
!40 = !{!6, !11, i64 40}
!41 = !{!19, !7, i64 0}
!42 = distinct !{!42, !35}
!43 = !{!6, !7, i64 16}
!44 = !{!19, !14, i64 112}


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