; LLVM IR from ggml-org/ggml :: examples/gpt-2/main-ctx.ll (Z9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERm)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ggml_init_params = type { i64, ptr, i8 }
%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" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%struct.ggml_tensor = type { i32, ptr, [4 x i64], [4 x i64], i32, [16 x i32], i32, [10 x ptr], ptr, i64, ptr, [64 x i8], ptr, [8 x i8] }
%struct.gpt2_layer = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@stderr = external global ptr, align 8
@_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size = external hidden global i64, align 8
@_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf = external hidden global ptr, align 8
@_ZGVZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf = external hidden global i64, align 8
@.str.39 = external hidden unnamed_addr constant [34 x i8], align 1
@__func__._Z9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERm = external hidden unnamed_addr constant [10 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

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

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

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

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

declare ptr @ggml_new_tensor_1d(ptr noundef, i32 noundef, i64 noundef) #2

declare ptr @ggml_new_tensor_2d(ptr noundef, i32 noundef, i64 noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERm(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #4 {
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca %struct.ggml_init_params, align 8
  %24 = alloca ptr, align 8
  %25 = alloca %struct.ggml_init_params, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  %39 = alloca ptr, align 8
  %40 = alloca ptr, align 8
  %41 = alloca ptr, align 8
  %42 = alloca ptr, align 8
  %43 = alloca ptr, align 8
  %44 = alloca ptr, align 8
  %45 = alloca ptr, align 8
  %46 = alloca ptr, align 8
  %47 = alloca ptr, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #6
  %50 = trunc i64 %49 to i32
  store i32 %50, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.gpt2_model, ptr %51, i32 0, i32 0
  store ptr %52, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %53 = load ptr, ptr %15, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.gpt2_hparams, ptr %53, i32 0, i32 2
  %55 = load i32, ptr %54, align 4, !tbaa !11
  store i32 %55, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.gpt2_hparams, ptr %56, i32 0, i32 4
  %58 = load i32, ptr %57, align 4, !tbaa !14
  store i32 %58, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %59 = load ptr, ptr %15, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.gpt2_hparams, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !15
  store i32 %61, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %62 = load ptr, ptr %15, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.gpt2_hparams, ptr %62, i32 0, i32 3
  %64 = load i32, ptr %63, align 4, !tbaa !16
  store i32 %64, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %65 = load ptr, ptr %15, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.gpt2_hparams, ptr %65, i32 0, i32 0
  %67 = load i32, ptr %66, align 4, !tbaa !17
  store i32 %67, ptr %20, align 4, !tbaa !9
  %68 = load atomic i8, ptr @_ZGVZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf acquire, align 8
  %69 = icmp eq i8 %68, 0
  br i1 %69, label %70, label %76, !prof !18

70:                                               ; preds = %6
  %71 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf) #6
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %76

73:                                               ; preds = %70
  %74 = load i64, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size, align 8, !tbaa !19
  %75 = call noalias ptr @malloc(i64 noundef %74) #9
  store ptr %75, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf, align 8, !tbaa !5
  call void @__cxa_guard_release(ptr @_ZGVZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf) #6
  br label %76

76:                                               ; preds = %73, %70, %6
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = load i64, ptr %77, align 8, !tbaa !19
  %79 = icmp ugt i64 %78, 0
  br i1 %79, label %80, label %111

80:                                               ; preds = %76
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = load i64, ptr %81, align 8, !tbaa !19
  %83 = load i32, ptr %14, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = mul i64 %82, %84
  %86 = load i64, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size, align 8, !tbaa !19
  %87 = icmp ugt i64 %85, %86
  br i1 %87, label %88, label %111

88:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %89 = load ptr, ptr %13, align 8, !tbaa !5
  %90 = load i64, ptr %89, align 8, !tbaa !19
  %91 = load i32, ptr %14, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = mul i64 %90, %92
  %94 = uitofp i64 %93 to double
  %95 = fmul double 1.100000e+00, %94
  %96 = fptoui double %95 to i64
  store i64 %96, ptr %21, align 8, !tbaa !19
  %97 = load i64, ptr %21, align 8, !tbaa !19
  store i64 %97, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size, align 8, !tbaa !19
  %98 = load ptr, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf, align 8, !tbaa !5
  %99 = load i64, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size, align 8, !tbaa !19
  %100 = call ptr @realloc(ptr noundef %98, i64 noundef %99) #10
  store ptr %100, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf, align 8, !tbaa !5
  %101 = load ptr, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf, align 8, !tbaa !5
  %102 = icmp eq ptr %101, null
  br i1 %102, label %103, label %107

103:                                              ; preds = %88
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = load i64, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size, align 8, !tbaa !19
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str.39, ptr noundef @__func__._Z9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERm, i64 noundef %105) #6
  store i1 false, ptr %7, align 1
  store i32 1, ptr %22, align 4
  br label %108

107:                                              ; preds = %88
  store i32 0, ptr %22, align 4
  br label %108

108:                                              ; preds = %107, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  %109 = load i32, ptr %22, align 4
  switch i32 %109, label %659 [
    i32 0, label %110
  ]

110:                                              ; preds = %108
  br label %111

111:                                              ; preds = %110, %80, %76
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #6
  %112 = getelementptr inbounds %struct.ggml_init_params, ptr %23, i32 0, i32 0
  %113 = load i64, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size, align 8, !tbaa !19
  store i64 %113, ptr %112, align 8, !tbaa !21
  %114 = getelementptr inbounds %struct.ggml_init_params, ptr %23, i32 0, i32 1
  %115 = load ptr, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf, align 8, !tbaa !5
  store ptr %115, ptr %114, align 8, !tbaa !24
  %116 = getelementptr inbounds %struct.ggml_init_params, ptr %23, i32 0, i32 2
  store i8 0, ptr %116, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %23, i64 24, i1 false), !tbaa.struct !26
  %117 = call ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8 %25)
  store ptr %117, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %118 = load ptr, ptr %24, align 8, !tbaa !5
  %119 = call ptr @ggml_new_graph(ptr noundef %118)
  store ptr %119, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %120 = load ptr, ptr %24, align 8, !tbaa !5
  %121 = load i32, ptr %14, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = call ptr @ggml_new_tensor_1d(ptr noundef %120, i32 noundef 26, i64 noundef %122)
  store ptr %123, ptr %27, align 8, !tbaa !5
  %124 = load ptr, ptr %27, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.ggml_tensor, ptr %124, i32 0, i32 10
  %126 = load ptr, ptr %125, align 8, !tbaa !28
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = call noundef ptr @_ZNKSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %127) #6
  %129 = load i32, ptr %14, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = load ptr, ptr %27, align 8, !tbaa !5
  %132 = call i64 @ggml_element_size(ptr noundef %131)
  %133 = mul i64 %130, %132
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %126, ptr align 4 %128, i64 %133, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %134 = load ptr, ptr %24, align 8, !tbaa !5
  %135 = load i32, ptr %14, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = call ptr @ggml_new_tensor_1d(ptr noundef %134, i32 noundef 26, i64 noundef %136)
  store ptr %137, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %138

138:                                              ; preds = %153, %111
  %139 = load i32, ptr %29, align 4, !tbaa !9
  %140 = load i32, ptr %14, align 4, !tbaa !9
  %141 = icmp slt i32 %139, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %138
  store i32 2, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %156

143:                                              ; preds = %138
  %144 = load i32, ptr %10, align 4, !tbaa !9
  %145 = load i32, ptr %29, align 4, !tbaa !9
  %146 = add nsw i32 %144, %145
  %147 = load ptr, ptr %28, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ggml_tensor, ptr %147, i32 0, i32 10
  %149 = load ptr, ptr %148, align 8, !tbaa !28
  %150 = load i32, ptr %29, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds i32, ptr %149, i64 %151
  store i32 %146, ptr %152, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %143
  %154 = load i32, ptr %29, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %29, align 4, !tbaa !9
  br label %138, !llvm.loop !32

156:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %157 = load ptr, ptr %24, align 8, !tbaa !5
  %158 = load ptr, ptr %24, align 8, !tbaa !5
  %159 = load ptr, ptr %8, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.gpt2_model, ptr %159, i32 0, i32 3
  %161 = load ptr, ptr %160, align 8, !tbaa !34
  %162 = load ptr, ptr %27, align 8, !tbaa !5
  %163 = call ptr @ggml_get_rows(ptr noundef %158, ptr noundef %161, ptr noundef %162)
  %164 = load ptr, ptr %24, align 8, !tbaa !5
  %165 = load ptr, ptr %8, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.gpt2_model, ptr %165, i32 0, i32 4
  %167 = load ptr, ptr %166, align 8, !tbaa !48
  %168 = load ptr, ptr %28, align 8, !tbaa !5
  %169 = call ptr @ggml_get_rows(ptr noundef %164, ptr noundef %167, ptr noundef %168)
  %170 = call ptr @ggml_add(ptr noundef %157, ptr noundef %163, ptr noundef %169)
  store ptr %170, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %171

171:                                              ; preds = %592, %156
  %172 = load i32, ptr %31, align 4, !tbaa !9
  %173 = load i32, ptr %17, align 4, !tbaa !9
  %174 = icmp slt i32 %172, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %171
  store i32 5, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  br label %595

176:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %177 = load ptr, ptr %24, align 8, !tbaa !5
  %178 = load ptr, ptr %30, align 8, !tbaa !5
  %179 = load ptr, ptr %15, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.gpt2_hparams, ptr %179, i32 0, i32 6
  %181 = load float, ptr %180, align 4, !tbaa !49
  %182 = call ptr @ggml_norm(ptr noundef %177, ptr noundef %178, float noundef %181)
  store ptr %182, ptr %32, align 8, !tbaa !5
  %183 = load ptr, ptr %24, align 8, !tbaa !5
  %184 = load ptr, ptr %24, align 8, !tbaa !5
  %185 = load ptr, ptr %24, align 8, !tbaa !5
  %186 = load ptr, ptr %8, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.gpt2_model, ptr %186, i32 0, i32 6
  %188 = load i32, ptr %31, align 4, !tbaa !9
  %189 = sext i32 %188 to i64
  %190 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %187, i64 noundef %189) #6
  %191 = getelementptr inbounds %struct.gpt2_layer, ptr %190, i32 0, i32 0
  %192 = load ptr, ptr %191, align 8, !tbaa !50
  %193 = load ptr, ptr %32, align 8, !tbaa !5
  %194 = call ptr @ggml_repeat(ptr noundef %185, ptr noundef %192, ptr noundef %193)
  %195 = load ptr, ptr %32, align 8, !tbaa !5
  %196 = call ptr @ggml_mul(ptr noundef %184, ptr noundef %194, ptr noundef %195)
  %197 = load ptr, ptr %24, align 8, !tbaa !5
  %198 = load ptr, ptr %8, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.gpt2_model, ptr %198, i32 0, i32 6
  %200 = load i32, ptr %31, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  %202 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %199, i64 noundef %201) #6
  %203 = getelementptr inbounds %struct.gpt2_layer, ptr %202, i32 0, i32 1
  %204 = load ptr, ptr %203, align 8, !tbaa !52
  %205 = load ptr, ptr %32, align 8, !tbaa !5
  %206 = call ptr @ggml_repeat(ptr noundef %197, ptr noundef %204, ptr noundef %205)
  %207 = call ptr @ggml_add(ptr noundef %183, ptr noundef %196, ptr noundef %206)
  store ptr %207, ptr %32, align 8, !tbaa !5
  %208 = load ptr, ptr %24, align 8, !tbaa !5
  %209 = load ptr, ptr %8, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.gpt2_model, ptr %209, i32 0, i32 6
  %211 = load i32, ptr %31, align 4, !tbaa !9
  %212 = sext i32 %211 to i64
  %213 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %210, i64 noundef %212) #6
  %214 = getelementptr inbounds %struct.gpt2_layer, ptr %213, i32 0, i32 4
  %215 = load ptr, ptr %214, align 8, !tbaa !53
  %216 = load ptr, ptr %32, align 8, !tbaa !5
  %217 = call ptr @ggml_mul_mat(ptr noundef %208, ptr noundef %215, ptr noundef %216)
  store ptr %217, ptr %32, align 8, !tbaa !5
  %218 = load ptr, ptr %24, align 8, !tbaa !5
  %219 = load ptr, ptr %24, align 8, !tbaa !5
  %220 = load ptr, ptr %8, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.gpt2_model, ptr %220, i32 0, i32 6
  %222 = load i32, ptr %31, align 4, !tbaa !9
  %223 = sext i32 %222 to i64
  %224 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %221, i64 noundef %223) #6
  %225 = getelementptr inbounds %struct.gpt2_layer, ptr %224, i32 0, i32 5
  %226 = load ptr, ptr %225, align 8, !tbaa !54
  %227 = load ptr, ptr %32, align 8, !tbaa !5
  %228 = call ptr @ggml_repeat(ptr noundef %219, ptr noundef %226, ptr noundef %227)
  %229 = load ptr, ptr %32, align 8, !tbaa !5
  %230 = call ptr @ggml_add(ptr noundef %218, ptr noundef %228, ptr noundef %229)
  store ptr %230, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  %231 = load ptr, ptr %24, align 8, !tbaa !5
  %232 = load ptr, ptr %32, align 8, !tbaa !5
  %233 = load i32, ptr %16, align 4, !tbaa !9
  %234 = sext i32 %233 to i64
  %235 = load i32, ptr %14, align 4, !tbaa !9
  %236 = sext i32 %235 to i64
  %237 = load ptr, ptr %32, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.ggml_tensor, ptr %237, i32 0, i32 3
  %239 = getelementptr inbounds [4 x i64], ptr %238, i64 0, i64 1
  %240 = load i64, ptr %239, align 8, !tbaa !19
  %241 = load i32, ptr %16, align 4, !tbaa !9
  %242 = sext i32 %241 to i64
  %243 = mul i64 0, %242
  %244 = call ptr @ggml_view_2d(ptr noundef %231, ptr noundef %232, i64 noundef %234, i64 noundef %236, i64 noundef %240, i64 noundef %243)
  store ptr %244, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  %245 = load ptr, ptr %24, align 8, !tbaa !5
  %246 = load ptr, ptr %32, align 8, !tbaa !5
  %247 = load i32, ptr %16, align 4, !tbaa !9
  %248 = sext i32 %247 to i64
  %249 = load i32, ptr %14, align 4, !tbaa !9
  %250 = sext i32 %249 to i64
  %251 = load ptr, ptr %32, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.ggml_tensor, ptr %251, i32 0, i32 3
  %253 = getelementptr inbounds [4 x i64], ptr %252, i64 0, i64 1
  %254 = load i64, ptr %253, align 8, !tbaa !19
  %255 = load i32, ptr %16, align 4, !tbaa !9
  %256 = sext i32 %255 to i64
  %257 = mul i64 4, %256
  %258 = call ptr @ggml_view_2d(ptr noundef %245, ptr noundef %246, i64 noundef %248, i64 noundef %250, i64 noundef %254, i64 noundef %257)
  store ptr %258, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  %259 = load ptr, ptr %24, align 8, !tbaa !5
  %260 = load ptr, ptr %32, align 8, !tbaa !5
  %261 = load i32, ptr %16, align 4, !tbaa !9
  %262 = sext i32 %261 to i64
  %263 = load i32, ptr %14, align 4, !tbaa !9
  %264 = sext i32 %263 to i64
  %265 = load ptr, ptr %32, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.ggml_tensor, ptr %265, i32 0, i32 3
  %267 = getelementptr inbounds [4 x i64], ptr %266, i64 0, i64 1
  %268 = load i64, ptr %267, align 8, !tbaa !19
  %269 = load i32, ptr %16, align 4, !tbaa !9
  %270 = sext i32 %269 to i64
  %271 = mul i64 8, %270
  %272 = call ptr @ggml_view_2d(ptr noundef %259, ptr noundef %260, i64 noundef %262, i64 noundef %264, i64 noundef %268, i64 noundef %271)
  store ptr %272, ptr %35, align 8, !tbaa !5
  %273 = load i32, ptr %14, align 4, !tbaa !9
  %274 = icmp sge i32 %273, 1
  br i1 %274, label %275, label %332

275:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #6
  %276 = load ptr, ptr %24, align 8, !tbaa !5
  %277 = load ptr, ptr %8, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.gpt2_model, ptr %277, i32 0, i32 7
  %279 = load ptr, ptr %278, align 8, !tbaa !55
  %280 = load i32, ptr %14, align 4, !tbaa !9
  %281 = load i32, ptr %16, align 4, !tbaa !9
  %282 = mul nsw i32 %280, %281
  %283 = sext i32 %282 to i64
  %284 = load ptr, ptr %8, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.gpt2_model, ptr %284, i32 0, i32 7
  %286 = load ptr, ptr %285, align 8, !tbaa !55
  %287 = call i64 @ggml_element_size(ptr noundef %286)
  %288 = load i32, ptr %16, align 4, !tbaa !9
  %289 = sext i32 %288 to i64
  %290 = mul i64 %287, %289
  %291 = load i32, ptr %31, align 4, !tbaa !9
  %292 = load i32, ptr %18, align 4, !tbaa !9
  %293 = mul nsw i32 %291, %292
  %294 = load i32, ptr %10, align 4, !tbaa !9
  %295 = add nsw i32 %293, %294
  %296 = sext i32 %295 to i64
  %297 = mul i64 %290, %296
  %298 = call ptr @ggml_view_1d(ptr noundef %276, ptr noundef %279, i64 noundef %283, i64 noundef %297)
  store ptr %298, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  %299 = load ptr, ptr %24, align 8, !tbaa !5
  %300 = load ptr, ptr %8, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.gpt2_model, ptr %300, i32 0, i32 8
  %302 = load ptr, ptr %301, align 8, !tbaa !56
  %303 = load i32, ptr %14, align 4, !tbaa !9
  %304 = load i32, ptr %16, align 4, !tbaa !9
  %305 = mul nsw i32 %303, %304
  %306 = sext i32 %305 to i64
  %307 = load ptr, ptr %8, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct.gpt2_model, ptr %307, i32 0, i32 8
  %309 = load ptr, ptr %308, align 8, !tbaa !56
  %310 = call i64 @ggml_element_size(ptr noundef %309)
  %311 = load i32, ptr %16, align 4, !tbaa !9
  %312 = sext i32 %311 to i64
  %313 = mul i64 %310, %312
  %314 = load i32, ptr %31, align 4, !tbaa !9
  %315 = load i32, ptr %18, align 4, !tbaa !9
  %316 = mul nsw i32 %314, %315
  %317 = load i32, ptr %10, align 4, !tbaa !9
  %318 = add nsw i32 %316, %317
  %319 = sext i32 %318 to i64
  %320 = mul i64 %313, %319
  %321 = call ptr @ggml_view_1d(ptr noundef %299, ptr noundef %302, i64 noundef %306, i64 noundef %320)
  store ptr %321, ptr %37, align 8, !tbaa !5
  %322 = load ptr, ptr %26, align 8, !tbaa !5
  %323 = load ptr, ptr %24, align 8, !tbaa !5
  %324 = load ptr, ptr %34, align 8, !tbaa !5
  %325 = load ptr, ptr %36, align 8, !tbaa !5
  %326 = call ptr @ggml_cpy(ptr noundef %323, ptr noundef %324, ptr noundef %325)
  call void @ggml_build_forward_expand(ptr noundef %322, ptr noundef %326)
  %327 = load ptr, ptr %26, align 8, !tbaa !5
  %328 = load ptr, ptr %24, align 8, !tbaa !5
  %329 = load ptr, ptr %35, align 8, !tbaa !5
  %330 = load ptr, ptr %37, align 8, !tbaa !5
  %331 = call ptr @ggml_cpy(ptr noundef %328, ptr noundef %329, ptr noundef %330)
  call void @ggml_build_forward_expand(ptr noundef %327, ptr noundef %331)
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #6
  br label %332

332:                                              ; preds = %275, %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #6
  %333 = load ptr, ptr %24, align 8, !tbaa !5
  %334 = load ptr, ptr %24, align 8, !tbaa !5
  %335 = load ptr, ptr %33, align 8, !tbaa !5
  %336 = load ptr, ptr %24, align 8, !tbaa !5
  %337 = load i32, ptr %16, align 4, !tbaa !9
  %338 = load i32, ptr %19, align 4, !tbaa !9
  %339 = sdiv i32 %337, %338
  %340 = sext i32 %339 to i64
  %341 = load i32, ptr %19, align 4, !tbaa !9
  %342 = sext i32 %341 to i64
  %343 = load i32, ptr %14, align 4, !tbaa !9
  %344 = sext i32 %343 to i64
  %345 = call ptr @ggml_new_tensor_3d(ptr noundef %336, i32 noundef 0, i64 noundef %340, i64 noundef %342, i64 noundef %344)
  %346 = call ptr @ggml_cpy(ptr noundef %334, ptr noundef %335, ptr noundef %345)
  %347 = call ptr @ggml_permute(ptr noundef %333, ptr noundef %346, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  store ptr %347, ptr %38, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #6
  %348 = load ptr, ptr %24, align 8, !tbaa !5
  %349 = load ptr, ptr %24, align 8, !tbaa !5
  %350 = load ptr, ptr %24, align 8, !tbaa !5
  %351 = load ptr, ptr %8, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct.gpt2_model, ptr %351, i32 0, i32 7
  %353 = load ptr, ptr %352, align 8, !tbaa !55
  %354 = load i32, ptr %10, align 4, !tbaa !9
  %355 = load i32, ptr %14, align 4, !tbaa !9
  %356 = add nsw i32 %354, %355
  %357 = load i32, ptr %16, align 4, !tbaa !9
  %358 = mul nsw i32 %356, %357
  %359 = sext i32 %358 to i64
  %360 = load i32, ptr %31, align 4, !tbaa !9
  %361 = load i32, ptr %18, align 4, !tbaa !9
  %362 = mul nsw i32 %360, %361
  %363 = sext i32 %362 to i64
  %364 = load ptr, ptr %8, align 8, !tbaa !5
  %365 = getelementptr inbounds %struct.gpt2_model, ptr %364, i32 0, i32 7
  %366 = load ptr, ptr %365, align 8, !tbaa !55
  %367 = call i64 @ggml_element_size(ptr noundef %366)
  %368 = mul i64 %363, %367
  %369 = load i32, ptr %16, align 4, !tbaa !9
  %370 = sext i32 %369 to i64
  %371 = mul i64 %368, %370
  %372 = call ptr @ggml_view_1d(ptr noundef %350, ptr noundef %353, i64 noundef %359, i64 noundef %371)
  %373 = load i32, ptr %16, align 4, !tbaa !9
  %374 = load i32, ptr %19, align 4, !tbaa !9
  %375 = sdiv i32 %373, %374
  %376 = sext i32 %375 to i64
  %377 = load i32, ptr %19, align 4, !tbaa !9
  %378 = sext i32 %377 to i64
  %379 = load i32, ptr %10, align 4, !tbaa !9
  %380 = load i32, ptr %14, align 4, !tbaa !9
  %381 = add nsw i32 %379, %380
  %382 = sext i32 %381 to i64
  %383 = call ptr @ggml_reshape_3d(ptr noundef %349, ptr noundef %372, i64 noundef %376, i64 noundef %378, i64 noundef %382)
  %384 = call ptr @ggml_permute(ptr noundef %348, ptr noundef %383, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  store ptr %384, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #6
  %385 = load ptr, ptr %24, align 8, !tbaa !5
  %386 = load ptr, ptr %39, align 8, !tbaa !5
  %387 = load ptr, ptr %38, align 8, !tbaa !5
  %388 = call ptr @ggml_mul_mat(ptr noundef %385, ptr noundef %386, ptr noundef %387)
  store ptr %388, ptr %40, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #6
  %389 = load ptr, ptr %24, align 8, !tbaa !5
  %390 = load ptr, ptr %40, align 8, !tbaa !5
  %391 = load i32, ptr %16, align 4, !tbaa !9
  %392 = sitofp i32 %391 to float
  %393 = load i32, ptr %19, align 4, !tbaa !9
  %394 = sitofp i32 %393 to float
  %395 = fdiv float %392, %394
  %396 = fpext float %395 to double
  %397 = call double @sqrt(double noundef %396) #6
  %398 = fdiv double 1.000000e+00, %397
  %399 = fptrunc double %398 to float
  %400 = call ptr @ggml_scale_inplace(ptr noundef %389, ptr noundef %390, float noundef %399)
  store ptr %400, ptr %41, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #6
  %401 = load ptr, ptr %24, align 8, !tbaa !5
  %402 = load ptr, ptr %41, align 8, !tbaa !5
  %403 = load i32, ptr %10, align 4, !tbaa !9
  %404 = call ptr @ggml_diag_mask_inf_inplace(ptr noundef %401, ptr noundef %402, i32 noundef %403)
  store ptr %404, ptr %42, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #6
  %405 = load ptr, ptr %24, align 8, !tbaa !5
  %406 = load ptr, ptr %42, align 8, !tbaa !5
  %407 = call ptr @ggml_soft_max_inplace(ptr noundef %405, ptr noundef %406)
  store ptr %407, ptr %43, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #6
  %408 = load ptr, ptr %24, align 8, !tbaa !5
  %409 = load ptr, ptr %24, align 8, !tbaa !5
  %410 = load ptr, ptr %24, align 8, !tbaa !5
  %411 = load ptr, ptr %24, align 8, !tbaa !5
  %412 = load ptr, ptr %8, align 8, !tbaa !5
  %413 = getelementptr inbounds %struct.gpt2_model, ptr %412, i32 0, i32 8
  %414 = load ptr, ptr %413, align 8, !tbaa !56
  %415 = load i32, ptr %10, align 4, !tbaa !9
  %416 = load i32, ptr %14, align 4, !tbaa !9
  %417 = add nsw i32 %415, %416
  %418 = load i32, ptr %16, align 4, !tbaa !9
  %419 = mul nsw i32 %417, %418
  %420 = sext i32 %419 to i64
  %421 = load i32, ptr %31, align 4, !tbaa !9
  %422 = load i32, ptr %18, align 4, !tbaa !9
  %423 = mul nsw i32 %421, %422
  %424 = sext i32 %423 to i64
  %425 = load ptr, ptr %8, align 8, !tbaa !5
  %426 = getelementptr inbounds %struct.gpt2_model, ptr %425, i32 0, i32 8
  %427 = load ptr, ptr %426, align 8, !tbaa !56
  %428 = call i64 @ggml_element_size(ptr noundef %427)
  %429 = mul i64 %424, %428
  %430 = load i32, ptr %16, align 4, !tbaa !9
  %431 = sext i32 %430 to i64
  %432 = mul i64 %429, %431
  %433 = call ptr @ggml_view_1d(ptr noundef %411, ptr noundef %414, i64 noundef %420, i64 noundef %432)
  %434 = load i32, ptr %16, align 4, !tbaa !9
  %435 = load i32, ptr %19, align 4, !tbaa !9
  %436 = sdiv i32 %434, %435
  %437 = sext i32 %436 to i64
  %438 = load i32, ptr %19, align 4, !tbaa !9
  %439 = sext i32 %438 to i64
  %440 = load i32, ptr %10, align 4, !tbaa !9
  %441 = load i32, ptr %14, align 4, !tbaa !9
  %442 = add nsw i32 %440, %441
  %443 = sext i32 %442 to i64
  %444 = call ptr @ggml_reshape_3d(ptr noundef %410, ptr noundef %433, i64 noundef %437, i64 noundef %439, i64 noundef %443)
  %445 = call ptr @ggml_permute(ptr noundef %409, ptr noundef %444, i32 noundef 1, i32 noundef 2, i32 noundef 0, i32 noundef 3)
  %446 = load ptr, ptr %24, align 8, !tbaa !5
  %447 = load ptr, ptr %8, align 8, !tbaa !5
  %448 = getelementptr inbounds %struct.gpt2_model, ptr %447, i32 0, i32 8
  %449 = load ptr, ptr %448, align 8, !tbaa !56
  %450 = getelementptr inbounds %struct.ggml_tensor, ptr %449, i32 0, i32 0
  %451 = load i32, ptr %450, align 8, !tbaa !57
  %452 = load i32, ptr %10, align 4, !tbaa !9
  %453 = load i32, ptr %14, align 4, !tbaa !9
  %454 = add nsw i32 %452, %453
  %455 = sext i32 %454 to i64
  %456 = load i32, ptr %16, align 4, !tbaa !9
  %457 = load i32, ptr %19, align 4, !tbaa !9
  %458 = sdiv i32 %456, %457
  %459 = sext i32 %458 to i64
  %460 = load i32, ptr %19, align 4, !tbaa !9
  %461 = sext i32 %460 to i64
  %462 = call ptr @ggml_new_tensor_3d(ptr noundef %446, i32 noundef %451, i64 noundef %455, i64 noundef %459, i64 noundef %461)
  %463 = call ptr @ggml_cpy(ptr noundef %408, ptr noundef %445, ptr noundef %462)
  store ptr %463, ptr %44, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #6
  %464 = load ptr, ptr %24, align 8, !tbaa !5
  %465 = load ptr, ptr %44, align 8, !tbaa !5
  %466 = load ptr, ptr %43, align 8, !tbaa !5
  %467 = call ptr @ggml_mul_mat(ptr noundef %464, ptr noundef %465, ptr noundef %466)
  store ptr %467, ptr %45, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #6
  %468 = load ptr, ptr %24, align 8, !tbaa !5
  %469 = load ptr, ptr %45, align 8, !tbaa !5
  %470 = call ptr @ggml_permute(ptr noundef %468, ptr noundef %469, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  store ptr %470, ptr %46, align 8, !tbaa !5
  %471 = load ptr, ptr %24, align 8, !tbaa !5
  %472 = load ptr, ptr %46, align 8, !tbaa !5
  %473 = load ptr, ptr %24, align 8, !tbaa !5
  %474 = load i32, ptr %16, align 4, !tbaa !9
  %475 = sext i32 %474 to i64
  %476 = load i32, ptr %14, align 4, !tbaa !9
  %477 = sext i32 %476 to i64
  %478 = call ptr @ggml_new_tensor_2d(ptr noundef %473, i32 noundef 0, i64 noundef %475, i64 noundef %477)
  %479 = call ptr @ggml_cpy(ptr noundef %471, ptr noundef %472, ptr noundef %478)
  store ptr %479, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  %480 = load ptr, ptr %24, align 8, !tbaa !5
  %481 = load ptr, ptr %8, align 8, !tbaa !5
  %482 = getelementptr inbounds %struct.gpt2_model, ptr %481, i32 0, i32 6
  %483 = load i32, ptr %31, align 4, !tbaa !9
  %484 = sext i32 %483 to i64
  %485 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %482, i64 noundef %484) #6
  %486 = getelementptr inbounds %struct.gpt2_layer, ptr %485, i32 0, i32 6
  %487 = load ptr, ptr %486, align 8, !tbaa !58
  %488 = load ptr, ptr %32, align 8, !tbaa !5
  %489 = call ptr @ggml_mul_mat(ptr noundef %480, ptr noundef %487, ptr noundef %488)
  store ptr %489, ptr %32, align 8, !tbaa !5
  %490 = load ptr, ptr %24, align 8, !tbaa !5
  %491 = load ptr, ptr %24, align 8, !tbaa !5
  %492 = load ptr, ptr %8, align 8, !tbaa !5
  %493 = getelementptr inbounds %struct.gpt2_model, ptr %492, i32 0, i32 6
  %494 = load i32, ptr %31, align 4, !tbaa !9
  %495 = sext i32 %494 to i64
  %496 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %493, i64 noundef %495) #6
  %497 = getelementptr inbounds %struct.gpt2_layer, ptr %496, i32 0, i32 7
  %498 = load ptr, ptr %497, align 8, !tbaa !59
  %499 = load ptr, ptr %32, align 8, !tbaa !5
  %500 = call ptr @ggml_repeat(ptr noundef %491, ptr noundef %498, ptr noundef %499)
  %501 = load ptr, ptr %32, align 8, !tbaa !5
  %502 = call ptr @ggml_add(ptr noundef %490, ptr noundef %500, ptr noundef %501)
  store ptr %502, ptr %32, align 8, !tbaa !5
  %503 = load ptr, ptr %24, align 8, !tbaa !5
  %504 = load ptr, ptr %32, align 8, !tbaa !5
  %505 = load ptr, ptr %30, align 8, !tbaa !5
  %506 = call ptr @ggml_add(ptr noundef %503, ptr noundef %504, ptr noundef %505)
  store ptr %506, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #6
  %507 = load ptr, ptr %32, align 8, !tbaa !5
  store ptr %507, ptr %47, align 8, !tbaa !5
  %508 = load ptr, ptr %24, align 8, !tbaa !5
  %509 = load ptr, ptr %47, align 8, !tbaa !5
  %510 = load ptr, ptr %15, align 8, !tbaa !5
  %511 = getelementptr inbounds %struct.gpt2_hparams, ptr %510, i32 0, i32 6
  %512 = load float, ptr %511, align 4, !tbaa !49
  %513 = call ptr @ggml_norm(ptr noundef %508, ptr noundef %509, float noundef %512)
  store ptr %513, ptr %32, align 8, !tbaa !5
  %514 = load ptr, ptr %24, align 8, !tbaa !5
  %515 = load ptr, ptr %24, align 8, !tbaa !5
  %516 = load ptr, ptr %24, align 8, !tbaa !5
  %517 = load ptr, ptr %8, align 8, !tbaa !5
  %518 = getelementptr inbounds %struct.gpt2_model, ptr %517, i32 0, i32 6
  %519 = load i32, ptr %31, align 4, !tbaa !9
  %520 = sext i32 %519 to i64
  %521 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %518, i64 noundef %520) #6
  %522 = getelementptr inbounds %struct.gpt2_layer, ptr %521, i32 0, i32 2
  %523 = load ptr, ptr %522, align 8, !tbaa !60
  %524 = load ptr, ptr %32, align 8, !tbaa !5
  %525 = call ptr @ggml_repeat(ptr noundef %516, ptr noundef %523, ptr noundef %524)
  %526 = load ptr, ptr %32, align 8, !tbaa !5
  %527 = call ptr @ggml_mul(ptr noundef %515, ptr noundef %525, ptr noundef %526)
  %528 = load ptr, ptr %24, align 8, !tbaa !5
  %529 = load ptr, ptr %8, align 8, !tbaa !5
  %530 = getelementptr inbounds %struct.gpt2_model, ptr %529, i32 0, i32 6
  %531 = load i32, ptr %31, align 4, !tbaa !9
  %532 = sext i32 %531 to i64
  %533 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %530, i64 noundef %532) #6
  %534 = getelementptr inbounds %struct.gpt2_layer, ptr %533, i32 0, i32 3
  %535 = load ptr, ptr %534, align 8, !tbaa !61
  %536 = load ptr, ptr %32, align 8, !tbaa !5
  %537 = call ptr @ggml_repeat(ptr noundef %528, ptr noundef %535, ptr noundef %536)
  %538 = call ptr @ggml_add(ptr noundef %514, ptr noundef %527, ptr noundef %537)
  store ptr %538, ptr %32, align 8, !tbaa !5
  %539 = load ptr, ptr %24, align 8, !tbaa !5
  %540 = load ptr, ptr %8, align 8, !tbaa !5
  %541 = getelementptr inbounds %struct.gpt2_model, ptr %540, i32 0, i32 6
  %542 = load i32, ptr %31, align 4, !tbaa !9
  %543 = sext i32 %542 to i64
  %544 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %541, i64 noundef %543) #6
  %545 = getelementptr inbounds %struct.gpt2_layer, ptr %544, i32 0, i32 8
  %546 = load ptr, ptr %545, align 8, !tbaa !62
  %547 = load ptr, ptr %32, align 8, !tbaa !5
  %548 = call ptr @ggml_mul_mat(ptr noundef %539, ptr noundef %546, ptr noundef %547)
  store ptr %548, ptr %32, align 8, !tbaa !5
  %549 = load ptr, ptr %24, align 8, !tbaa !5
  %550 = load ptr, ptr %24, align 8, !tbaa !5
  %551 = load ptr, ptr %8, align 8, !tbaa !5
  %552 = getelementptr inbounds %struct.gpt2_model, ptr %551, i32 0, i32 6
  %553 = load i32, ptr %31, align 4, !tbaa !9
  %554 = sext i32 %553 to i64
  %555 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %552, i64 noundef %554) #6
  %556 = getelementptr inbounds %struct.gpt2_layer, ptr %555, i32 0, i32 9
  %557 = load ptr, ptr %556, align 8, !tbaa !63
  %558 = load ptr, ptr %32, align 8, !tbaa !5
  %559 = call ptr @ggml_repeat(ptr noundef %550, ptr noundef %557, ptr noundef %558)
  %560 = load ptr, ptr %32, align 8, !tbaa !5
  %561 = call ptr @ggml_add(ptr noundef %549, ptr noundef %559, ptr noundef %560)
  store ptr %561, ptr %32, align 8, !tbaa !5
  %562 = load ptr, ptr %24, align 8, !tbaa !5
  %563 = load ptr, ptr %32, align 8, !tbaa !5
  %564 = call ptr @ggml_gelu(ptr noundef %562, ptr noundef %563)
  store ptr %564, ptr %32, align 8, !tbaa !5
  %565 = load ptr, ptr %24, align 8, !tbaa !5
  %566 = load ptr, ptr %8, align 8, !tbaa !5
  %567 = getelementptr inbounds %struct.gpt2_model, ptr %566, i32 0, i32 6
  %568 = load i32, ptr %31, align 4, !tbaa !9
  %569 = sext i32 %568 to i64
  %570 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %567, i64 noundef %569) #6
  %571 = getelementptr inbounds %struct.gpt2_layer, ptr %570, i32 0, i32 10
  %572 = load ptr, ptr %571, align 8, !tbaa !64
  %573 = load ptr, ptr %32, align 8, !tbaa !5
  %574 = call ptr @ggml_mul_mat(ptr noundef %565, ptr noundef %572, ptr noundef %573)
  store ptr %574, ptr %32, align 8, !tbaa !5
  %575 = load ptr, ptr %24, align 8, !tbaa !5
  %576 = load ptr, ptr %24, align 8, !tbaa !5
  %577 = load ptr, ptr %8, align 8, !tbaa !5
  %578 = getelementptr inbounds %struct.gpt2_model, ptr %577, i32 0, i32 6
  %579 = load i32, ptr %31, align 4, !tbaa !9
  %580 = sext i32 %579 to i64
  %581 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %578, i64 noundef %580) #6
  %582 = getelementptr inbounds %struct.gpt2_layer, ptr %581, i32 0, i32 11
  %583 = load ptr, ptr %582, align 8, !tbaa !65
  %584 = load ptr, ptr %32, align 8, !tbaa !5
  %585 = call ptr @ggml_repeat(ptr noundef %576, ptr noundef %583, ptr noundef %584)
  %586 = load ptr, ptr %32, align 8, !tbaa !5
  %587 = call ptr @ggml_add(ptr noundef %575, ptr noundef %585, ptr noundef %586)
  store ptr %587, ptr %32, align 8, !tbaa !5
  %588 = load ptr, ptr %24, align 8, !tbaa !5
  %589 = load ptr, ptr %32, align 8, !tbaa !5
  %590 = load ptr, ptr %47, align 8, !tbaa !5
  %591 = call ptr @ggml_add(ptr noundef %588, ptr noundef %589, ptr noundef %590)
  store ptr %591, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  br label %592

592:                                              ; preds = %332
  %593 = load i32, ptr %31, align 4, !tbaa !9
  %594 = add nsw i32 %593, 1
  store i32 %594, ptr %31, align 4, !tbaa !9
  br label %171, !llvm.loop !66

595:                                              ; preds = %175
  %596 = load ptr, ptr %24, align 8, !tbaa !5
  %597 = load ptr, ptr %30, align 8, !tbaa !5
  %598 = load ptr, ptr %15, align 8, !tbaa !5
  %599 = getelementptr inbounds %struct.gpt2_hparams, ptr %598, i32 0, i32 6
  %600 = load float, ptr %599, align 4, !tbaa !49
  %601 = call ptr @ggml_norm(ptr noundef %596, ptr noundef %597, float noundef %600)
  store ptr %601, ptr %30, align 8, !tbaa !5
  %602 = load ptr, ptr %24, align 8, !tbaa !5
  %603 = load ptr, ptr %24, align 8, !tbaa !5
  %604 = load ptr, ptr %24, align 8, !tbaa !5
  %605 = load ptr, ptr %8, align 8, !tbaa !5
  %606 = getelementptr inbounds %struct.gpt2_model, ptr %605, i32 0, i32 1
  %607 = load ptr, ptr %606, align 8, !tbaa !67
  %608 = load ptr, ptr %30, align 8, !tbaa !5
  %609 = call ptr @ggml_repeat(ptr noundef %604, ptr noundef %607, ptr noundef %608)
  %610 = load ptr, ptr %30, align 8, !tbaa !5
  %611 = call ptr @ggml_mul(ptr noundef %603, ptr noundef %609, ptr noundef %610)
  %612 = load ptr, ptr %24, align 8, !tbaa !5
  %613 = load ptr, ptr %8, align 8, !tbaa !5
  %614 = getelementptr inbounds %struct.gpt2_model, ptr %613, i32 0, i32 2
  %615 = load ptr, ptr %614, align 8, !tbaa !68
  %616 = load ptr, ptr %30, align 8, !tbaa !5
  %617 = call ptr @ggml_repeat(ptr noundef %612, ptr noundef %615, ptr noundef %616)
  %618 = call ptr @ggml_add(ptr noundef %602, ptr noundef %611, ptr noundef %617)
  store ptr %618, ptr %30, align 8, !tbaa !5
  %619 = load ptr, ptr %24, align 8, !tbaa !5
  %620 = load ptr, ptr %8, align 8, !tbaa !5
  %621 = getelementptr inbounds %struct.gpt2_model, ptr %620, i32 0, i32 5
  %622 = load ptr, ptr %621, align 8, !tbaa !69
  %623 = load ptr, ptr %30, align 8, !tbaa !5
  %624 = call ptr @ggml_mul_mat(ptr noundef %619, ptr noundef %622, ptr noundef %623)
  store ptr %624, ptr %30, align 8, !tbaa !5
  %625 = load ptr, ptr %26, align 8, !tbaa !5
  %626 = load ptr, ptr %30, align 8, !tbaa !5
  call void @ggml_build_forward_expand(ptr noundef %625, ptr noundef %626)
  %627 = load ptr, ptr %24, align 8, !tbaa !5
  %628 = load ptr, ptr %26, align 8, !tbaa !5
  %629 = load i32, ptr %9, align 4, !tbaa !9
  %630 = call i32 @ggml_graph_compute_with_ctx(ptr noundef %627, ptr noundef %628, i32 noundef %629)
  %631 = load ptr, ptr %12, align 8, !tbaa !5
  %632 = load i32, ptr %20, align 4, !tbaa !9
  %633 = sext i32 %632 to i64
  call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %631, i64 noundef %633)
  %634 = load ptr, ptr %12, align 8, !tbaa !5
  %635 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %634) #6
  %636 = load ptr, ptr %30, align 8, !tbaa !5
  %637 = call ptr @ggml_get_data(ptr noundef %636)
  %638 = load i32, ptr %20, align 4, !tbaa !9
  %639 = load i32, ptr %14, align 4, !tbaa !9
  %640 = sub nsw i32 %639, 1
  %641 = mul nsw i32 %638, %640
  %642 = sext i32 %641 to i64
  %643 = getelementptr inbounds float, ptr %637, i64 %642
  %644 = load i32, ptr %20, align 4, !tbaa !9
  %645 = sext i32 %644 to i64
  %646 = mul i64 4, %645
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %635, ptr align 4 %643, i64 %646, i1 false)
  %647 = load ptr, ptr %13, align 8, !tbaa !5
  %648 = load i64, ptr %647, align 8, !tbaa !19
  %649 = icmp eq i64 %648, 0
  br i1 %649, label %650, label %657

650:                                              ; preds = %595
  %651 = load ptr, ptr %24, align 8, !tbaa !5
  %652 = call i64 @ggml_used_mem(ptr noundef %651)
  %653 = load i32, ptr %14, align 4, !tbaa !9
  %654 = sext i32 %653 to i64
  %655 = udiv i64 %652, %654
  %656 = load ptr, ptr %13, align 8, !tbaa !5
  store i64 %655, ptr %656, align 8, !tbaa !19
  br label %657

657:                                              ; preds = %650, %595
  %658 = load ptr, ptr %24, align 8, !tbaa !5
  call void @ggml_free(ptr noundef %658)
  store i1 true, ptr %7, align 1
  store i32 1, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #6
  br label %659

659:                                              ; preds = %657, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  %660 = load i1, ptr %7, align 1
  ret i1 %660
}

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

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #6

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #7

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #6

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #8

declare ptr @ggml_new_graph(ptr noundef) #2

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

declare i64 @ggml_element_size(ptr noundef) #2

declare ptr @ggml_add(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @ggml_get_rows(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @ggml_norm(ptr noundef, ptr noundef, float noundef) #2

declare ptr @ggml_mul(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @ggml_repeat(ptr noundef, ptr noundef, ptr noundef) #2

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

declare ptr @ggml_mul_mat(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @ggml_view_2d(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #2

declare ptr @ggml_view_1d(ptr noundef, ptr noundef, i64 noundef, i64 noundef) #2

declare void @ggml_build_forward_expand(ptr noundef, ptr noundef) #2

declare ptr @ggml_cpy(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @ggml_permute(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare ptr @ggml_new_tensor_3d(ptr noundef, i32 noundef, i64 noundef, i64 noundef, i64 noundef) #2

declare ptr @ggml_reshape_3d(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef) #2

declare ptr @ggml_scale_inplace(ptr noundef, ptr noundef, float noundef) #2

; Function Attrs: nounwind
declare double @sqrt(double noundef) #1

declare ptr @ggml_diag_mask_inf_inplace(ptr noundef, ptr noundef, i32 noundef) #2

declare ptr @ggml_soft_max_inplace(ptr noundef, ptr noundef) #2

declare ptr @ggml_gelu(ptr noundef, ptr noundef) #2

declare i32 @ggml_graph_compute_with_ctx(ptr noundef, ptr noundef, i32 noundef) #2

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

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

declare ptr @ggml_get_data(ptr noundef) #2

declare i64 @ggml_used_mem(ptr noundef) #2

declare void @ggml_free(ptr noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTS12gpt2_hparams", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !13, i64 24}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !10, i64 16}
!15 = !{!12, !10, i64 4}
!16 = !{!12, !10, i64 12}
!17 = !{!12, !10, i64 0}
!18 = !{!"branch_weights", i32 1, i32 1048575}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!22, !20, i64 0}
!22 = !{!"_ZTS16ggml_init_params", !20, i64 0, !6, i64 8, !23, i64 16}
!23 = !{!"bool", !7, i64 0}
!24 = !{!22, !6, i64 8}
!25 = !{!22, !23, i64 16}
!26 = !{i64 0, i64 8, !19, i64 8, i64 8, !5, i64 16, i64 1, !27}
!27 = !{!23, !23, i64 0}
!28 = !{!29, !6, i64 248}
!29 = !{!"_ZTS11ggml_tensor", !30, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !31, i64 80, !7, i64 84, !10, i64 148, !7, i64 152, !6, i64 232, !20, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}
!30 = !{!"_ZTS9ggml_type", !7, i64 0}
!31 = !{!"_ZTS7ggml_op", !7, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!35, !6, i64 48}
!35 = !{!"_ZTS10gpt2_model", !12, i64 0, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !36, i64 72, !6, i64 96, !6, i64 104, !6, i64 112, !40, i64 120}
!36 = !{!"_ZTSSt6vectorI10gpt2_layerSaIS0_EE", !37, i64 0}
!37 = !{!"_ZTSSt12_Vector_baseI10gpt2_layerSaIS0_EE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE12_Vector_implE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!40 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP11ggml_tensorSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !41, i64 0}
!41 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !42, i64 0}
!42 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !43, i64 0, !45, i64 8}
!43 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !44, i64 0}
!44 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!45 = !{!"_ZTSSt15_Rb_tree_header", !46, i64 0, !20, i64 32}
!46 = !{!"_ZTSSt18_Rb_tree_node_base", !47, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!47 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!48 = !{!35, !6, i64 56}
!49 = !{!12, !13, i64 24}
!50 = !{!51, !6, i64 0}
!51 = !{!"_ZTS10gpt2_layer", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!52 = !{!51, !6, i64 8}
!53 = !{!51, !6, i64 32}
!54 = !{!51, !6, i64 40}
!55 = !{!35, !6, i64 96}
!56 = !{!35, !6, i64 104}
!57 = !{!29, !30, i64 0}
!58 = !{!51, !6, i64 48}
!59 = !{!51, !6, i64 56}
!60 = !{!51, !6, i64 16}
!61 = !{!51, !6, i64 24}
!62 = !{!51, !6, i64 64}
!63 = !{!51, !6, i64 72}
!64 = !{!51, !6, i64 80}
!65 = !{!51, !6, i64 88}
!66 = distinct !{!66, !33}
!67 = !{!35, !6, i64 32}
!68 = !{!35, !6, i64 40}
!69 = !{!35, !6, i64 64}


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

%struct.ggml_init_params = type { i64, ptr, i8 }

@stderr = external local_unnamed_addr global ptr, align 8
@_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size = external hidden local_unnamed_addr global i64, align 8
@_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf = external hidden local_unnamed_addr global ptr, align 8
@_ZGVZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf = external hidden global i64, align 8
@.str.39 = external hidden unnamed_addr constant [34 x i8], align 1
@__func__._Z9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERm = external hidden unnamed_addr constant [10 x i8], align 1

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

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

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

declare ptr @ggml_new_tensor_1d(ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #1

declare ptr @ggml_new_tensor_2d(ptr noundef, i32 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERm(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr nocapture noundef nonnull align 8 dereferenceable(8) %5) local_unnamed_addr #3 {
  %7 = alloca %struct.ggml_init_params, align 8
  %8 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #9
  %9 = trunc i64 %8 to i32
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = load i32, ptr %12, align 8, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %0, i64 4
  %15 = load i32, ptr %14, align 4, !tbaa !12
  %16 = getelementptr inbounds i8, ptr %0, i64 12
  %17 = load i32, ptr %16, align 4, !tbaa !13
  %18 = load i32, ptr %0, align 8, !tbaa !14
  %19 = load atomic i8, ptr @_ZGVZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf acquire, align 8
  %20 = icmp eq i8 %19, 0
  br i1 %20, label %21, label %26, !prof !15

21:                                               ; preds = %6
  %22 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf) #9
  %.not = icmp eq i32 %22, 0
  br i1 %.not, label %26, label %23

23:                                               ; preds = %21
  %24 = load i64, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size, align 8, !tbaa !16
  %25 = tail call noalias ptr @malloc(i64 noundef %24) #10
  store ptr %25, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf, align 8, !tbaa !18
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf) #9
  br label %26

26:                                               ; preds = %23, %21, %6
  %27 = load i64, ptr %5, align 8, !tbaa !16
  %.not270 = icmp eq i64 %27, 0
  %.pre285 = load i64, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size, align 8, !tbaa !16
  br i1 %.not270, label %..critedge_crit_edge, label %28

..critedge_crit_edge:                             ; preds = %26
  %.pre286 = load ptr, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf, align 8, !tbaa !18
  %.pre288 = shl i64 %8, 32
  %.pre289 = ashr exact i64 %.pre288, 32
  br label %.critedge

28:                                               ; preds = %26
  %sext = shl i64 %8, 32
  %29 = ashr exact i64 %sext, 32
  %30 = mul i64 %27, %29
  %31 = icmp ugt i64 %30, %.pre285
  %.pre287 = load ptr, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf, align 8, !tbaa !18
  br i1 %31, label %32, label %.critedge

32:                                               ; preds = %28
  %33 = uitofp i64 %30 to double
  %34 = fmul double %33, 1.100000e+00
  %35 = fptoui double %34 to i64
  store i64 %35, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size, align 8, !tbaa !16
  %36 = tail call ptr @realloc(ptr noundef %.pre287, i64 noundef %35) #11
  store ptr %36, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE3buf, align 8, !tbaa !18
  %.not271 = icmp eq ptr %36, null
  %.pre = load i64, ptr @_ZZ9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERmE8buf_size, align 8, !tbaa !16
  br i1 %.not271, label %37, label %.critedge

37:                                               ; preds = %32
  %38 = load ptr, ptr @stderr, align 8, !tbaa !18
  %39 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.39, ptr noundef nonnull @__func__._Z9gpt2_evalRK10gpt2_modeliiRKSt6vectorIiSaIiEERS2_IfSaIfEERm, i64 noundef %.pre) #12
  br label %237

.critedge:                                        ; preds = %..critedge_crit_edge, %32, %28
  %.pre-phi = phi i64 [ %.pre289, %..critedge_crit_edge ], [ %29, %32 ], [ %29, %28 ]
  %40 = phi ptr [ %.pre286, %..critedge_crit_edge ], [ %36, %32 ], [ %.pre287, %28 ]
  %41 = phi i64 [ %.pre285, %..critedge_crit_edge ], [ %.pre, %32 ], [ %.pre285, %28 ]
  store i64 %41, ptr %7, align 8, !tbaa !16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %40, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !18
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 16
  store i8 0, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !20
  %42 = tail call ptr @ggml_init(ptr noundef nonnull byval(%struct.ggml_init_params) align 8 %7)
  %43 = tail call ptr @ggml_new_graph(ptr noundef %42)
  %44 = tail call ptr @ggml_new_tensor_1d(ptr noundef %42, i32 noundef 26, i64 noundef %.pre-phi)
  %45 = getelementptr inbounds i8, ptr %44, i64 248
  %46 = load ptr, ptr %45, align 8, !tbaa !22
  %47 = tail call noundef ptr @_ZNKSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #9
  %48 = tail call i64 @ggml_element_size(ptr noundef %44)
  %49 = mul i64 %48, %.pre-phi
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %46, ptr align 4 %47, i64 %49, i1 false)
  %50 = tail call ptr @ggml_new_tensor_1d(ptr noundef %42, i32 noundef 26, i64 noundef %.pre-phi)
  %51 = icmp sgt i32 %9, 0
  br i1 %51, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.critedge
  %52 = getelementptr inbounds i8, ptr %50, i64 248
  %53 = load ptr, ptr %52, align 8, !tbaa !22
  %wide.trip.count = and i64 %8, 2147483647
  %min.iters.check = icmp ult i64 %wide.trip.count, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.mod.vf = and i64 %8, 7
  %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %2, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %54 = getelementptr inbounds i32, ptr %53, i64 %index
  %55 = add <4 x i32> %vec.ind, %broadcast.splat
  %56 = add <4 x i32> %step.add, %broadcast.splat
  %57 = getelementptr inbounds i8, ptr %54, i64 16
  store <4 x i32> %55, ptr %54, align 4, !tbaa !26
  store <4 x i32> %56, ptr %57, align 4, !tbaa !26
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %58 = icmp eq i64 %index.next, %n.vec
  br i1 %58, label %middle.block, label %vector.body, !llvm.loop !27

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.mod.vf, 0
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %.critedge
  %59 = getelementptr inbounds i8, ptr %0, i64 48
  %60 = load ptr, ptr %59, align 8, !tbaa !31
  %61 = tail call ptr @ggml_get_rows(ptr noundef %42, ptr noundef %60, ptr noundef %44)
  %62 = getelementptr inbounds i8, ptr %0, i64 56
  %63 = load ptr, ptr %62, align 8, !tbaa !45
  %64 = tail call ptr @ggml_get_rows(ptr noundef %42, ptr noundef %63, ptr noundef %50)
  %65 = tail call ptr @ggml_add(ptr noundef %42, ptr noundef %61, ptr noundef %64)
  %66 = icmp sgt i32 %13, 0
  br i1 %66, label %.lr.ph277, label %._crit_edge278

.lr.ph277:                                        ; preds = %._crit_edge
  %67 = getelementptr inbounds i8, ptr %0, i64 24
  %68 = getelementptr inbounds i8, ptr %0, i64 72
  %69 = sext i32 %11 to i64
  %70 = shl nsw i64 %69, 2
  %71 = shl nsw i64 %69, 3
  %72 = getelementptr inbounds i8, ptr %0, i64 96
  %73 = mul nsw i32 %11, %9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %0, i64 104
  %76 = sext i32 %17 to i64
  %77 = add nsw i32 %9, %2
  %78 = mul nsw i32 %77, %11
  %79 = sext i32 %78 to i64
  %80 = sext i32 %77 to i64
  %81 = sitofp i32 %11 to float
  %82 = sitofp i32 %17 to float
  %83 = fdiv float %81, %82
  %84 = fpext float %83 to double
  %85 = sext i32 %15 to i64
  %86 = sext i32 %2 to i64
  %wide.trip.count283 = zext nneg i32 %13 to i64
  br label %115

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %87 = getelementptr inbounds i32, ptr %53, i64 %indvars.iv
  %88 = trunc i64 %indvars.iv to i32
  %89 = add i32 %88, %2
  store i32 %89, ptr %87, align 4, !tbaa !26
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !46

._crit_edge278:                                   ; preds = %157, %._crit_edge
  %.0266.lcssa = phi ptr [ %65, %._crit_edge ], [ %232, %157 ]
  %90 = getelementptr inbounds i8, ptr %0, i64 24
  %91 = load float, ptr %90, align 8, !tbaa !47
  %92 = tail call ptr @ggml_norm(ptr noundef %42, ptr noundef %.0266.lcssa, float noundef %91)
  %93 = getelementptr inbounds i8, ptr %0, i64 32
  %94 = load ptr, ptr %93, align 8, !tbaa !48
  %95 = tail call ptr @ggml_repeat(ptr noundef %42, ptr noundef %94, ptr noundef %92)
  %96 = tail call ptr @ggml_mul(ptr noundef %42, ptr noundef %95, ptr noundef %92)
  %97 = getelementptr inbounds i8, ptr %0, i64 40
  %98 = load ptr, ptr %97, align 8, !tbaa !49
  %99 = tail call ptr @ggml_repeat(ptr noundef %42, ptr noundef %98, ptr noundef %92)
  %100 = tail call ptr @ggml_add(ptr noundef %42, ptr noundef %96, ptr noundef %99)
  %101 = getelementptr inbounds i8, ptr %0, i64 64
  %102 = load ptr, ptr %101, align 8, !tbaa !50
  %103 = tail call ptr @ggml_mul_mat(ptr noundef %42, ptr noundef %102, ptr noundef %100)
  tail call void @ggml_build_forward_expand(ptr noundef %43, ptr noundef %103)
  %104 = tail call i32 @ggml_graph_compute_with_ctx(ptr noundef %42, ptr noundef %43, i32 noundef %1)
  %105 = sext i32 %18 to i64
  tail call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %105)
  %106 = tail call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #9
  %107 = tail call ptr @ggml_get_data(ptr noundef %103)
  %108 = add nsw i32 %9, -1
  %109 = mul nsw i32 %18, %108
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds float, ptr %107, i64 %110
  %112 = shl nsw i64 %105, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %106, ptr align 4 %111, i64 %112, i1 false)
  %113 = load i64, ptr %5, align 8, !tbaa !16
  %114 = icmp eq i64 %113, 0
  br i1 %114, label %233, label %236

115:                                              ; preds = %.lr.ph277, %157
  %indvars.iv280 = phi i64 [ 0, %.lr.ph277 ], [ %indvars.iv.next281, %157 ]
  %.0266275 = phi ptr [ %65, %.lr.ph277 ], [ %232, %157 ]
  %116 = load float, ptr %67, align 8, !tbaa !47
  %117 = tail call ptr @ggml_norm(ptr noundef %42, ptr noundef %.0266275, float noundef %116)
  %118 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %119 = load ptr, ptr %118, align 8, !tbaa !51
  %120 = tail call ptr @ggml_repeat(ptr noundef %42, ptr noundef %119, ptr noundef %117)
  %121 = tail call ptr @ggml_mul(ptr noundef %42, ptr noundef %120, ptr noundef %117)
  %122 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %123 = getelementptr inbounds i8, ptr %122, i64 8
  %124 = load ptr, ptr %123, align 8, !tbaa !53
  %125 = tail call ptr @ggml_repeat(ptr noundef %42, ptr noundef %124, ptr noundef %117)
  %126 = tail call ptr @ggml_add(ptr noundef %42, ptr noundef %121, ptr noundef %125)
  %127 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %128 = getelementptr inbounds i8, ptr %127, i64 32
  %129 = load ptr, ptr %128, align 8, !tbaa !54
  %130 = tail call ptr @ggml_mul_mat(ptr noundef %42, ptr noundef %129, ptr noundef %126)
  %131 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %132 = getelementptr inbounds i8, ptr %131, i64 40
  %133 = load ptr, ptr %132, align 8, !tbaa !55
  %134 = tail call ptr @ggml_repeat(ptr noundef %42, ptr noundef %133, ptr noundef %130)
  %135 = tail call ptr @ggml_add(ptr noundef %42, ptr noundef %134, ptr noundef %130)
  %136 = getelementptr inbounds i8, ptr %135, i64 56
  %137 = load i64, ptr %136, align 8, !tbaa !16
  %138 = tail call ptr @ggml_view_2d(ptr noundef %42, ptr noundef %135, i64 noundef %69, i64 noundef %.pre-phi, i64 noundef %137, i64 noundef 0)
  %139 = load i64, ptr %136, align 8, !tbaa !16
  %140 = tail call ptr @ggml_view_2d(ptr noundef %42, ptr noundef %135, i64 noundef %69, i64 noundef %.pre-phi, i64 noundef %139, i64 noundef %70)
  %141 = load i64, ptr %136, align 8, !tbaa !16
  %142 = tail call ptr @ggml_view_2d(ptr noundef %42, ptr noundef %135, i64 noundef %69, i64 noundef %.pre-phi, i64 noundef %141, i64 noundef %71)
  br i1 %51, label %143, label %._crit_edge290

._crit_edge290:                                   ; preds = %115
  %.pre291 = mul nsw i64 %indvars.iv280, %85
  br label %157

143:                                              ; preds = %115
  %144 = load ptr, ptr %72, align 8, !tbaa !56
  %145 = tail call i64 @ggml_element_size(ptr noundef %144)
  %146 = mul nsw i64 %indvars.iv280, %85
  %147 = add nsw i64 %146, %86
  %148 = mul nsw i64 %147, %69
  %149 = mul i64 %148, %145
  %150 = tail call ptr @ggml_view_1d(ptr noundef %42, ptr noundef %144, i64 noundef %74, i64 noundef %149)
  %151 = load ptr, ptr %75, align 8, !tbaa !57
  %152 = tail call i64 @ggml_element_size(ptr noundef %151)
  %153 = mul i64 %148, %152
  %154 = tail call ptr @ggml_view_1d(ptr noundef %42, ptr noundef %151, i64 noundef %74, i64 noundef %153)
  %155 = tail call ptr @ggml_cpy(ptr noundef %42, ptr noundef %140, ptr noundef %150)
  tail call void @ggml_build_forward_expand(ptr noundef %43, ptr noundef %155)
  %156 = tail call ptr @ggml_cpy(ptr noundef %42, ptr noundef %142, ptr noundef %154)
  tail call void @ggml_build_forward_expand(ptr noundef %43, ptr noundef %156)
  br label %157

157:                                              ; preds = %._crit_edge290, %143
  %.pre-phi292 = phi i64 [ %.pre291, %._crit_edge290 ], [ %146, %143 ]
  %158 = sdiv i32 %11, %17
  %159 = sext i32 %158 to i64
  %160 = tail call ptr @ggml_new_tensor_3d(ptr noundef %42, i32 noundef 0, i64 noundef %159, i64 noundef %76, i64 noundef %.pre-phi)
  %161 = tail call ptr @ggml_cpy(ptr noundef %42, ptr noundef %138, ptr noundef %160)
  %162 = tail call ptr @ggml_permute(ptr noundef %42, ptr noundef %161, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  %163 = load ptr, ptr %72, align 8, !tbaa !56
  %164 = tail call i64 @ggml_element_size(ptr noundef %163)
  %165 = mul nsw i64 %.pre-phi292, %69
  %166 = mul i64 %165, %164
  %167 = tail call ptr @ggml_view_1d(ptr noundef %42, ptr noundef %163, i64 noundef %79, i64 noundef %166)
  %168 = tail call ptr @ggml_reshape_3d(ptr noundef %42, ptr noundef %167, i64 noundef %159, i64 noundef %76, i64 noundef %80)
  %169 = tail call ptr @ggml_permute(ptr noundef %42, ptr noundef %168, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  %170 = tail call ptr @ggml_mul_mat(ptr noundef %42, ptr noundef %169, ptr noundef %162)
  %171 = tail call double @sqrt(double noundef %84) #9
  %172 = fdiv double 1.000000e+00, %171
  %173 = fptrunc double %172 to float
  %174 = tail call ptr @ggml_scale_inplace(ptr noundef %42, ptr noundef %170, float noundef %173)
  %175 = tail call ptr @ggml_diag_mask_inf_inplace(ptr noundef %42, ptr noundef %174, i32 noundef %2)
  %176 = tail call ptr @ggml_soft_max_inplace(ptr noundef %42, ptr noundef %175)
  %177 = load ptr, ptr %75, align 8, !tbaa !57
  %178 = tail call i64 @ggml_element_size(ptr noundef %177)
  %179 = mul i64 %165, %178
  %180 = tail call ptr @ggml_view_1d(ptr noundef %42, ptr noundef %177, i64 noundef %79, i64 noundef %179)
  %181 = tail call ptr @ggml_reshape_3d(ptr noundef %42, ptr noundef %180, i64 noundef %159, i64 noundef %76, i64 noundef %80)
  %182 = tail call ptr @ggml_permute(ptr noundef %42, ptr noundef %181, i32 noundef 1, i32 noundef 2, i32 noundef 0, i32 noundef 3)
  %183 = load ptr, ptr %75, align 8, !tbaa !57
  %184 = load i32, ptr %183, align 8, !tbaa !58
  %185 = tail call ptr @ggml_new_tensor_3d(ptr noundef %42, i32 noundef %184, i64 noundef %80, i64 noundef %159, i64 noundef %76)
  %186 = tail call ptr @ggml_cpy(ptr noundef %42, ptr noundef %182, ptr noundef %185)
  %187 = tail call ptr @ggml_mul_mat(ptr noundef %42, ptr noundef %186, ptr noundef %176)
  %188 = tail call ptr @ggml_permute(ptr noundef %42, ptr noundef %187, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  %189 = tail call ptr @ggml_new_tensor_2d(ptr noundef %42, i32 noundef 0, i64 noundef %69, i64 noundef %.pre-phi)
  %190 = tail call ptr @ggml_cpy(ptr noundef %42, ptr noundef %188, ptr noundef %189)
  %191 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %192 = getelementptr inbounds i8, ptr %191, i64 48
  %193 = load ptr, ptr %192, align 8, !tbaa !59
  %194 = tail call ptr @ggml_mul_mat(ptr noundef %42, ptr noundef %193, ptr noundef %190)
  %195 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %196 = getelementptr inbounds i8, ptr %195, i64 56
  %197 = load ptr, ptr %196, align 8, !tbaa !60
  %198 = tail call ptr @ggml_repeat(ptr noundef %42, ptr noundef %197, ptr noundef %194)
  %199 = tail call ptr @ggml_add(ptr noundef %42, ptr noundef %198, ptr noundef %194)
  %200 = tail call ptr @ggml_add(ptr noundef %42, ptr noundef %199, ptr noundef %.0266275)
  %201 = load float, ptr %67, align 8, !tbaa !47
  %202 = tail call ptr @ggml_norm(ptr noundef %42, ptr noundef %200, float noundef %201)
  %203 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %204 = getelementptr inbounds i8, ptr %203, i64 16
  %205 = load ptr, ptr %204, align 8, !tbaa !61
  %206 = tail call ptr @ggml_repeat(ptr noundef %42, ptr noundef %205, ptr noundef %202)
  %207 = tail call ptr @ggml_mul(ptr noundef %42, ptr noundef %206, ptr noundef %202)
  %208 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %209 = getelementptr inbounds i8, ptr %208, i64 24
  %210 = load ptr, ptr %209, align 8, !tbaa !62
  %211 = tail call ptr @ggml_repeat(ptr noundef %42, ptr noundef %210, ptr noundef %202)
  %212 = tail call ptr @ggml_add(ptr noundef %42, ptr noundef %207, ptr noundef %211)
  %213 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %214 = getelementptr inbounds i8, ptr %213, i64 64
  %215 = load ptr, ptr %214, align 8, !tbaa !63
  %216 = tail call ptr @ggml_mul_mat(ptr noundef %42, ptr noundef %215, ptr noundef %212)
  %217 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %218 = getelementptr inbounds i8, ptr %217, i64 72
  %219 = load ptr, ptr %218, align 8, !tbaa !64
  %220 = tail call ptr @ggml_repeat(ptr noundef %42, ptr noundef %219, ptr noundef %216)
  %221 = tail call ptr @ggml_add(ptr noundef %42, ptr noundef %220, ptr noundef %216)
  %222 = tail call ptr @ggml_gelu(ptr noundef %42, ptr noundef %221)
  %223 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %224 = getelementptr inbounds i8, ptr %223, i64 80
  %225 = load ptr, ptr %224, align 8, !tbaa !65
  %226 = tail call ptr @ggml_mul_mat(ptr noundef %42, ptr noundef %225, ptr noundef %222)
  %227 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv280) #9
  %228 = getelementptr inbounds i8, ptr %227, i64 88
  %229 = load ptr, ptr %228, align 8, !tbaa !66
  %230 = tail call ptr @ggml_repeat(ptr noundef %42, ptr noundef %229, ptr noundef %226)
  %231 = tail call ptr @ggml_add(ptr noundef %42, ptr noundef %230, ptr noundef %226)
  %232 = tail call ptr @ggml_add(ptr noundef %42, ptr noundef %231, ptr noundef %200)
  %indvars.iv.next281 = add nuw nsw i64 %indvars.iv280, 1
  %exitcond284.not = icmp eq i64 %indvars.iv.next281, %wide.trip.count283
  br i1 %exitcond284.not, label %._crit_edge278, label %115, !llvm.loop !67

233:                                              ; preds = %._crit_edge278
  %234 = tail call i64 @ggml_used_mem(ptr noundef %42)
  %235 = udiv i64 %234, %.pre-phi
  store i64 %235, ptr %5, align 8, !tbaa !16
  br label %236

236:                                              ; preds = %233, %._crit_edge278
  tail call void @ggml_free(ptr noundef %42)
  br label %237

237:                                              ; preds = %37, %236
  %.1 = phi i1 [ true, %236 ], [ false, %37 ]
  ret i1 %.1
}

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

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #7

declare ptr @ggml_new_graph(ptr noundef) local_unnamed_addr #1

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

declare i64 @ggml_element_size(ptr noundef) local_unnamed_addr #1

declare ptr @ggml_add(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ggml_get_rows(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ggml_norm(ptr noundef, ptr noundef, float noundef) local_unnamed_addr #1

declare ptr @ggml_mul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ggml_repeat(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare ptr @ggml_mul_mat(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ggml_view_2d(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

declare ptr @ggml_view_1d(ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

declare void @ggml_build_forward_expand(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ggml_cpy(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ggml_permute(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare ptr @ggml_new_tensor_3d(ptr noundef, i32 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

declare ptr @ggml_reshape_3d(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

declare ptr @ggml_scale_inplace(ptr noundef, ptr noundef, float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #8

declare ptr @ggml_diag_mask_inf_inplace(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @ggml_soft_max_inplace(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ggml_gelu(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @ggml_graph_compute_with_ctx(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

declare ptr @ggml_get_data(ptr noundef) local_unnamed_addr #1

declare i64 @ggml_used_mem(ptr noundef) local_unnamed_addr #1

declare void @ggml_free(ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { nounwind allocsize(0) }
attributes #11 = { nounwind allocsize(1) }
attributes #12 = { 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 8}
!6 = !{!"_ZTS12gpt2_hparams", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!6, !7, i64 16}
!12 = !{!6, !7, i64 4}
!13 = !{!6, !7, i64 12}
!14 = !{!6, !7, i64 0}
!15 = !{!"branch_weights", i32 1, i32 1048575}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !8, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"any pointer", !8, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"bool", !8, i64 0}
!22 = !{!23, !19, i64 248}
!23 = !{!"_ZTS11ggml_tensor", !24, i64 0, !19, i64 8, !8, i64 16, !8, i64 48, !25, i64 80, !8, i64 84, !7, i64 148, !8, i64 152, !19, i64 232, !17, i64 240, !19, i64 248, !8, i64 256, !19, i64 320, !8, i64 328}
!24 = !{!"_ZTS9ggml_type", !8, i64 0}
!25 = !{!"_ZTS7ggml_op", !8, i64 0}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !28, !29, !30}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!"llvm.loop.isvectorized", i32 1}
!30 = !{!"llvm.loop.unroll.runtime.disable"}
!31 = !{!32, !19, i64 48}
!32 = !{!"_ZTS10gpt2_model", !6, i64 0, !19, i64 32, !19, i64 40, !19, i64 48, !19, i64 56, !19, i64 64, !33, i64 72, !19, i64 96, !19, i64 104, !19, i64 112, !37, i64 120}
!33 = !{!"_ZTSSt6vectorI10gpt2_layerSaIS0_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseI10gpt2_layerSaIS0_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!37 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP11ggml_tensorSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !38, i64 0}
!38 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !39, i64 0}
!39 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !40, i64 0, !42, i64 8}
!40 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !41, i64 0}
!41 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!42 = !{!"_ZTSSt15_Rb_tree_header", !43, i64 0, !17, i64 32}
!43 = !{!"_ZTSSt18_Rb_tree_node_base", !44, i64 0, !19, i64 8, !19, i64 16, !19, i64 24}
!44 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!45 = !{!32, !19, i64 56}
!46 = distinct !{!46, !28, !30, !29}
!47 = !{!6, !10, i64 24}
!48 = !{!32, !19, i64 32}
!49 = !{!32, !19, i64 40}
!50 = !{!32, !19, i64 64}
!51 = !{!52, !19, i64 0}
!52 = !{!"_ZTS10gpt2_layer", !19, i64 0, !19, i64 8, !19, i64 16, !19, i64 24, !19, i64 32, !19, i64 40, !19, i64 48, !19, i64 56, !19, i64 64, !19, i64 72, !19, i64 80, !19, i64 88}
!53 = !{!52, !19, i64 8}
!54 = !{!52, !19, i64 32}
!55 = !{!52, !19, i64 40}
!56 = !{!32, !19, i64 96}
!57 = !{!32, !19, i64 104}
!58 = !{!23, !24, i64 0}
!59 = !{!52, !19, i64 48}
!60 = !{!52, !19, i64 56}
!61 = !{!52, !19, i64 16}
!62 = !{!52, !19, i64 24}
!63 = !{!52, !19, i64 64}
!64 = !{!52, !19, i64 72}
!65 = !{!52, !19, i64 80}
!66 = !{!52, !19, i64 88}
!67 = distinct !{!67, !28}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass