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

; 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"

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

@__dso_handle = external hidden global i8
@_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size = external hidden global i64, align 8
@_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size = external hidden global i64, align 8
@_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf = external hidden global %"class.std::vector.30", align 8
@_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf = external hidden global i64, align 8
@.str.41 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [8 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) #1

declare i64 @ggml_tensor_overhead() #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z10gpt2_graphRK10gpt2_modelRK10gpt2_batchb(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, i1 noundef zeroext %2) #4 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::allocator.32", align 1
  %19 = alloca %struct.ggml_init_params, align 8
  %20 = alloca ptr, align 8
  %21 = alloca %struct.ggml_init_params, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %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
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %44 = zext i1 %2 to i8
  store i8 %44, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #1
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.gpt2_model, ptr %45, i32 0, i32 0
  store ptr %46, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #1
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.gpt2_hparams, ptr %47, i32 0, i32 2
  %49 = load i32, ptr %48, align 4, !tbaa !11
  store i32 %49, ptr %8, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #1
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.gpt2_hparams, ptr %50, i32 0, i32 4
  %52 = load i32, ptr %51, align 4, !tbaa !16
  store i32 %52, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #1
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.gpt2_hparams, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !17
  store i32 %55, ptr %10, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #1
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.gpt2_hparams, ptr %56, i32 0, i32 3
  %58 = load i32, ptr %57, align 4, !tbaa !18
  store i32 %58, ptr %11, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #1
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.gpt2_model, ptr %59, i32 0, i32 7
  store ptr %60, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #1
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.gpt2_batch, ptr %61, i32 0, i32 0
  %63 = load i32, ptr %62, align 8, !tbaa !19
  store i32 %63, ptr %13, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #1
  %64 = load i8, ptr %6, align 1, !tbaa !9, !range !21, !noundef !22
  %65 = trunc i8 %64 to i1
  br i1 %65, label %66, label %68

66:                                               ; preds = %3
  %67 = load i32, ptr %10, align 4, !tbaa !15
  br label %72

68:                                               ; preds = %3
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %69, i32 0, i32 4
  %71 = load i32, ptr %70, align 8, !tbaa !23
  br label %72

72:                                               ; preds = %68, %66
  %73 = phi i32 [ %67, %66 ], [ %71, %68 ]
  store i32 %73, ptr %14, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #1
  %74 = load i8, ptr %6, align 1, !tbaa !9, !range !21, !noundef !22
  %75 = trunc i8 %74 to i1
  br i1 %75, label %76, label %80

76:                                               ; preds = %72
  %77 = load i32, ptr %10, align 4, !tbaa !15
  %78 = load i32, ptr %13, align 4, !tbaa !15
  %79 = sub nsw i32 %77, %78
  br label %84

80:                                               ; preds = %72
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %81, i32 0, i32 2
  %83 = load i32, ptr %82, align 8, !tbaa !29
  br label %84

84:                                               ; preds = %80, %76
  %85 = phi i32 [ %79, %76 ], [ %83, %80 ]
  store i32 %85, ptr %15, align 4, !tbaa !15
  %86 = load atomic i8, ptr @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size acquire, align 8
  %87 = icmp eq i8 %86, 0
  br i1 %87, label %88, label %98, !prof !30

88:                                               ; preds = %84
  %89 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size) #1
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %98

91:                                               ; preds = %88
  %92 = invoke i64 @ggml_tensor_overhead()
          to label %93 unwind label %150

93:                                               ; preds = %91
  %94 = mul i64 %92, 4096
  %95 = invoke i64 @ggml_graph_overhead_custom(i64 noundef 4096, i1 noundef zeroext false)
          to label %96 unwind label %150

96:                                               ; preds = %93
  %97 = add i64 %94, %95
  store i64 %97, ptr @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size, align 8, !tbaa !31
  call void @__cxa_guard_release(ptr @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size) #1
  br label %98

98:                                               ; preds = %96, %88, %84
  %99 = load atomic i8, ptr @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf acquire, align 8
  %100 = icmp eq i8 %99, 0
  br i1 %100, label %101, label %108, !prof !30

101:                                              ; preds = %98
  %102 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf) #1
  %103 = icmp ne i32 %102, 0
  br i1 %103, label %104, label %108

104:                                              ; preds = %101
  %105 = load i64, ptr @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size, align 8, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #1
  call void @_ZNSaIhEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #1
  invoke void @_ZNSt6vectorIhSaIhEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf, i64 noundef %105, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %106 unwind label %154

106:                                              ; preds = %104
  call void @_ZNSt15__new_allocatorIhED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #1
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #1
  %107 = call i32 @__cxa_atexit(ptr @_ZNSt6vectorIhSaIhEED2Ev, ptr @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf, ptr @__dso_handle) #1
  call void @__cxa_guard_release(ptr @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf) #1
  br label %108

108:                                              ; preds = %106, %101, %98
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #1
  %109 = getelementptr inbounds %struct.ggml_init_params, ptr %19, i32 0, i32 0
  %110 = load i64, ptr @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size, align 8, !tbaa !31
  store i64 %110, ptr %109, align 8, !tbaa !33
  %111 = getelementptr inbounds %struct.ggml_init_params, ptr %19, i32 0, i32 1
  %112 = call noundef ptr @_ZNSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf) #1
  store ptr %112, ptr %111, align 8, !tbaa !35
  %113 = getelementptr inbounds %struct.ggml_init_params, ptr %19, i32 0, i32 2
  store i8 1, ptr %113, align 8, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %19, i64 24, i1 false), !tbaa.struct !37
  %114 = call ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8 %21)
  store ptr %114, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #1
  %115 = load ptr, ptr %20, align 8, !tbaa !5
  %116 = call ptr @ggml_new_graph_custom(ptr noundef %115, i64 noundef 4096, i1 noundef zeroext false)
  store ptr %116, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #1
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.gpt2_batch, ptr %117, i32 0, i32 1
  %119 = load ptr, ptr %118, align 8, !tbaa !38
  %120 = icmp ne ptr %119, null
  br i1 %120, label %121, label %158

121:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #1
  %122 = load ptr, ptr %20, align 8, !tbaa !5
  %123 = load i32, ptr %13, align 4, !tbaa !15
  %124 = sext i32 %123 to i64
  %125 = call ptr @ggml_new_tensor_1d(ptr noundef %122, i32 noundef 26, i64 noundef %124)
  store ptr %125, ptr %24, align 8, !tbaa !5
  %126 = load ptr, ptr %24, align 8, !tbaa !5
  %127 = call ptr @ggml_set_name(ptr noundef %126, ptr noundef @.str.41)
  %128 = load ptr, ptr %24, align 8, !tbaa !5
  call void @ggml_set_input(ptr noundef %128)
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #1
  %129 = load ptr, ptr %20, align 8, !tbaa !5
  %130 = load i32, ptr %13, align 4, !tbaa !15
  %131 = sext i32 %130 to i64
  %132 = call ptr @ggml_new_tensor_1d(ptr noundef %129, i32 noundef 26, i64 noundef %131)
  store ptr %132, ptr %25, align 8, !tbaa !5
  %133 = load ptr, ptr %25, align 8, !tbaa !5
  %134 = call ptr @ggml_set_name(ptr noundef %133, ptr noundef @.str.42)
  %135 = load ptr, ptr %25, align 8, !tbaa !5
  call void @ggml_set_input(ptr noundef %135)
  %136 = load ptr, ptr %20, align 8, !tbaa !5
  %137 = load ptr, ptr %20, align 8, !tbaa !5
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.gpt2_model, ptr %138, i32 0, i32 3
  %140 = load ptr, ptr %139, align 8, !tbaa !39
  %141 = load ptr, ptr %24, align 8, !tbaa !5
  %142 = call ptr @ggml_get_rows(ptr noundef %137, ptr noundef %140, ptr noundef %141)
  %143 = load ptr, ptr %20, align 8, !tbaa !5
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.gpt2_model, ptr %144, i32 0, i32 4
  %146 = load ptr, ptr %145, align 8, !tbaa !53
  %147 = load ptr, ptr %25, align 8, !tbaa !5
  %148 = call ptr @ggml_get_rows(ptr noundef %143, ptr noundef %146, ptr noundef %147)
  %149 = call ptr @ggml_add(ptr noundef %136, ptr noundef %142, ptr noundef %148)
  store ptr %149, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #1
  br label %174

150:                                              ; preds = %93, %91
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %16, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %17, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size) #1
  br label %597

154:                                              ; preds = %104
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %16, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %17, align 4
  call void @_ZNSt15__new_allocatorIhED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #1
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #1
  call void @__cxa_guard_abort(ptr @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf) #1
  br label %597

158:                                              ; preds = %108
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.gpt2_batch, ptr %159, i32 0, i32 2
  %161 = load ptr, ptr %160, align 8, !tbaa !54
  %162 = icmp ne ptr %161, null
  br i1 %162, label %164, label %163

163:                                              ; preds = %158
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.43, i32 noundef 584, ptr noundef @.str.44, ptr noundef @.str.45) #8
  unreachable

164:                                              ; preds = %158
  %165 = load ptr, ptr %20, align 8, !tbaa !5
  %166 = load i32, ptr %8, align 4, !tbaa !15
  %167 = sext i32 %166 to i64
  %168 = load i32, ptr %13, align 4, !tbaa !15
  %169 = sext i32 %168 to i64
  %170 = call ptr @ggml_new_tensor_2d(ptr noundef %165, i32 noundef 0, i64 noundef %167, i64 noundef %169)
  store ptr %170, ptr %23, align 8, !tbaa !5
  %171 = load ptr, ptr %23, align 8, !tbaa !5
  %172 = call ptr @ggml_set_name(ptr noundef %171, ptr noundef @.str.46)
  %173 = load ptr, ptr %23, align 8, !tbaa !5
  call void @ggml_set_input(ptr noundef %173)
  br label %174

174:                                              ; preds = %164, %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #1
  %175 = load ptr, ptr %20, align 8, !tbaa !5
  %176 = load i32, ptr %14, align 4, !tbaa !15
  %177 = sext i32 %176 to i64
  %178 = load i32, ptr %13, align 4, !tbaa !15
  %179 = sext i32 %178 to i64
  %180 = call ptr @ggml_new_tensor_3d(ptr noundef %175, i32 noundef 0, i64 noundef %177, i64 noundef %179, i64 noundef 1)
  store ptr %180, ptr %26, align 8, !tbaa !5
  %181 = load ptr, ptr %26, align 8, !tbaa !5
  %182 = call ptr @ggml_set_name(ptr noundef %181, ptr noundef @.str.47)
  %183 = load ptr, ptr %26, align 8, !tbaa !5
  call void @ggml_set_input(ptr noundef %183)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #1
  store i32 0, ptr %27, align 4, !tbaa !15
  br label %184

184:                                              ; preds = %566, %174
  %185 = load i32, ptr %27, align 4, !tbaa !15
  %186 = load i32, ptr %9, align 4, !tbaa !15
  %187 = icmp slt i32 %185, %186
  br i1 %187, label %189, label %188

188:                                              ; preds = %184
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #1
  br label %569

189:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #1
  %190 = load ptr, ptr %20, align 8, !tbaa !5
  %191 = load ptr, ptr %23, align 8, !tbaa !5
  %192 = load ptr, ptr %7, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.gpt2_hparams, ptr %192, i32 0, i32 6
  %194 = load float, ptr %193, align 4, !tbaa !55
  %195 = call ptr @ggml_norm(ptr noundef %190, ptr noundef %191, float noundef %194)
  store ptr %195, ptr %28, align 8, !tbaa !5
  %196 = load ptr, ptr %20, align 8, !tbaa !5
  %197 = load ptr, ptr %20, align 8, !tbaa !5
  %198 = load ptr, ptr %28, align 8, !tbaa !5
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.gpt2_model, ptr %199, i32 0, i32 6
  %201 = load i32, ptr %27, align 4, !tbaa !15
  %202 = sext i32 %201 to i64
  %203 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %200, i64 noundef %202) #1
  %204 = getelementptr inbounds %struct.gpt2_layer, ptr %203, i32 0, i32 0
  %205 = load ptr, ptr %204, align 8, !tbaa !56
  %206 = call ptr @ggml_mul(ptr noundef %197, ptr noundef %198, ptr noundef %205)
  %207 = load ptr, ptr %4, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.gpt2_model, ptr %207, i32 0, i32 6
  %209 = load i32, ptr %27, align 4, !tbaa !15
  %210 = sext i32 %209 to i64
  %211 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %208, i64 noundef %210) #1
  %212 = getelementptr inbounds %struct.gpt2_layer, ptr %211, i32 0, i32 1
  %213 = load ptr, ptr %212, align 8, !tbaa !58
  %214 = call ptr @ggml_add(ptr noundef %196, ptr noundef %206, ptr noundef %213)
  store ptr %214, ptr %28, align 8, !tbaa !5
  %215 = load ptr, ptr %20, align 8, !tbaa !5
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.gpt2_model, ptr %216, i32 0, i32 6
  %218 = load i32, ptr %27, align 4, !tbaa !15
  %219 = sext i32 %218 to i64
  %220 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %217, i64 noundef %219) #1
  %221 = getelementptr inbounds %struct.gpt2_layer, ptr %220, i32 0, i32 4
  %222 = load ptr, ptr %221, align 8, !tbaa !59
  %223 = load ptr, ptr %28, align 8, !tbaa !5
  %224 = call ptr @ggml_mul_mat(ptr noundef %215, ptr noundef %222, ptr noundef %223)
  store ptr %224, ptr %28, align 8, !tbaa !5
  %225 = load ptr, ptr %20, align 8, !tbaa !5
  %226 = load ptr, ptr %28, align 8, !tbaa !5
  %227 = load ptr, ptr %4, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.gpt2_model, ptr %227, i32 0, i32 6
  %229 = load i32, ptr %27, align 4, !tbaa !15
  %230 = sext i32 %229 to i64
  %231 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %228, i64 noundef %230) #1
  %232 = getelementptr inbounds %struct.gpt2_layer, ptr %231, i32 0, i32 5
  %233 = load ptr, ptr %232, align 8, !tbaa !60
  %234 = call ptr @ggml_add(ptr noundef %225, ptr noundef %226, ptr noundef %233)
  store ptr %234, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #1
  %235 = load ptr, ptr %20, align 8, !tbaa !5
  %236 = load ptr, ptr %28, align 8, !tbaa !5
  %237 = load i32, ptr %8, align 4, !tbaa !15
  %238 = sext i32 %237 to i64
  %239 = load i32, ptr %13, align 4, !tbaa !15
  %240 = sext i32 %239 to i64
  %241 = load ptr, ptr %28, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.ggml_tensor, ptr %241, i32 0, i32 3
  %243 = getelementptr inbounds [4 x i64], ptr %242, i64 0, i64 1
  %244 = load i64, ptr %243, align 8, !tbaa !31
  %245 = load i32, ptr %8, align 4, !tbaa !15
  %246 = sext i32 %245 to i64
  %247 = mul i64 0, %246
  %248 = call ptr @ggml_view_2d(ptr noundef %235, ptr noundef %236, i64 noundef %238, i64 noundef %240, i64 noundef %244, i64 noundef %247)
  store ptr %248, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #1
  %249 = load ptr, ptr %20, align 8, !tbaa !5
  %250 = load ptr, ptr %28, align 8, !tbaa !5
  %251 = load i32, ptr %8, align 4, !tbaa !15
  %252 = sext i32 %251 to i64
  %253 = load i32, ptr %13, align 4, !tbaa !15
  %254 = sext i32 %253 to i64
  %255 = load ptr, ptr %28, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.ggml_tensor, ptr %255, i32 0, i32 3
  %257 = getelementptr inbounds [4 x i64], ptr %256, i64 0, i64 1
  %258 = load i64, ptr %257, align 8, !tbaa !31
  %259 = load i32, ptr %8, align 4, !tbaa !15
  %260 = sext i32 %259 to i64
  %261 = mul i64 4, %260
  %262 = call ptr @ggml_view_2d(ptr noundef %249, ptr noundef %250, i64 noundef %252, i64 noundef %254, i64 noundef %258, i64 noundef %261)
  store ptr %262, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #1
  %263 = load ptr, ptr %20, align 8, !tbaa !5
  %264 = load ptr, ptr %28, align 8, !tbaa !5
  %265 = load i32, ptr %8, align 4, !tbaa !15
  %266 = sext i32 %265 to i64
  %267 = load i32, ptr %13, align 4, !tbaa !15
  %268 = sext i32 %267 to i64
  %269 = load ptr, ptr %28, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.ggml_tensor, ptr %269, i32 0, i32 3
  %271 = getelementptr inbounds [4 x i64], ptr %270, i64 0, i64 1
  %272 = load i64, ptr %271, align 8, !tbaa !31
  %273 = load i32, ptr %8, align 4, !tbaa !15
  %274 = sext i32 %273 to i64
  %275 = mul i64 8, %274
  %276 = call ptr @ggml_view_2d(ptr noundef %263, ptr noundef %264, i64 noundef %266, i64 noundef %268, i64 noundef %272, i64 noundef %275)
  store ptr %276, ptr %31, align 8, !tbaa !5
  %277 = load i32, ptr %13, align 4, !tbaa !15
  %278 = icmp sge i32 %277, 1
  br i1 %278, label %279, label %340

279:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #1
  %280 = load ptr, ptr %20, align 8, !tbaa !5
  %281 = load ptr, ptr %4, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.gpt2_model, ptr %281, i32 0, i32 7
  %283 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %282, i32 0, i32 0
  %284 = load ptr, ptr %283, align 8, !tbaa !61
  %285 = load i32, ptr %13, align 4, !tbaa !15
  %286 = load i32, ptr %8, align 4, !tbaa !15
  %287 = mul nsw i32 %285, %286
  %288 = sext i32 %287 to i64
  %289 = load ptr, ptr %4, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.gpt2_model, ptr %289, i32 0, i32 7
  %291 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %290, i32 0, i32 0
  %292 = load ptr, ptr %291, align 8, !tbaa !61
  %293 = call i64 @ggml_element_size(ptr noundef %292)
  %294 = load i32, ptr %8, align 4, !tbaa !15
  %295 = sext i32 %294 to i64
  %296 = mul i64 %293, %295
  %297 = load i32, ptr %27, align 4, !tbaa !15
  %298 = load i32, ptr %10, align 4, !tbaa !15
  %299 = mul nsw i32 %297, %298
  %300 = load i32, ptr %15, align 4, !tbaa !15
  %301 = add nsw i32 %299, %300
  %302 = sext i32 %301 to i64
  %303 = mul i64 %296, %302
  %304 = call ptr @ggml_view_1d(ptr noundef %280, ptr noundef %284, i64 noundef %288, i64 noundef %303)
  store ptr %304, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #1
  %305 = load ptr, ptr %20, align 8, !tbaa !5
  %306 = load ptr, ptr %4, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.gpt2_model, ptr %306, i32 0, i32 7
  %308 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %307, i32 0, i32 1
  %309 = load ptr, ptr %308, align 8, !tbaa !62
  %310 = load i32, ptr %13, align 4, !tbaa !15
  %311 = load i32, ptr %8, align 4, !tbaa !15
  %312 = mul nsw i32 %310, %311
  %313 = sext i32 %312 to i64
  %314 = load ptr, ptr %4, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.gpt2_model, ptr %314, i32 0, i32 7
  %316 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %315, i32 0, i32 1
  %317 = load ptr, ptr %316, align 8, !tbaa !62
  %318 = call i64 @ggml_element_size(ptr noundef %317)
  %319 = load i32, ptr %8, align 4, !tbaa !15
  %320 = sext i32 %319 to i64
  %321 = mul i64 %318, %320
  %322 = load i32, ptr %27, align 4, !tbaa !15
  %323 = load i32, ptr %10, align 4, !tbaa !15
  %324 = mul nsw i32 %322, %323
  %325 = load i32, ptr %15, align 4, !tbaa !15
  %326 = add nsw i32 %324, %325
  %327 = sext i32 %326 to i64
  %328 = mul i64 %321, %327
  %329 = call ptr @ggml_view_1d(ptr noundef %305, ptr noundef %309, i64 noundef %313, i64 noundef %328)
  store ptr %329, ptr %33, align 8, !tbaa !5
  %330 = load ptr, ptr %22, align 8, !tbaa !5
  %331 = load ptr, ptr %20, align 8, !tbaa !5
  %332 = load ptr, ptr %30, align 8, !tbaa !5
  %333 = load ptr, ptr %32, align 8, !tbaa !5
  %334 = call ptr @ggml_cpy(ptr noundef %331, ptr noundef %332, ptr noundef %333)
  call void @ggml_build_forward_expand(ptr noundef %330, ptr noundef %334)
  %335 = load ptr, ptr %22, align 8, !tbaa !5
  %336 = load ptr, ptr %20, align 8, !tbaa !5
  %337 = load ptr, ptr %31, align 8, !tbaa !5
  %338 = load ptr, ptr %33, align 8, !tbaa !5
  %339 = call ptr @ggml_cpy(ptr noundef %336, ptr noundef %337, ptr noundef %338)
  call void @ggml_build_forward_expand(ptr noundef %335, ptr noundef %339)
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #1
  br label %340

340:                                              ; preds = %279, %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #1
  %341 = load ptr, ptr %20, align 8, !tbaa !5
  %342 = load ptr, ptr %20, align 8, !tbaa !5
  %343 = load ptr, ptr %29, align 8, !tbaa !5
  %344 = load i32, ptr %8, align 4, !tbaa !15
  %345 = load i32, ptr %11, align 4, !tbaa !15
  %346 = sdiv i32 %344, %345
  %347 = sext i32 %346 to i64
  %348 = load i32, ptr %11, align 4, !tbaa !15
  %349 = sext i32 %348 to i64
  %350 = load i32, ptr %13, align 4, !tbaa !15
  %351 = sext i32 %350 to i64
  %352 = call ptr @ggml_cont_3d(ptr noundef %342, ptr noundef %343, i64 noundef %347, i64 noundef %349, i64 noundef %351)
  %353 = call ptr @ggml_permute(ptr noundef %341, ptr noundef %352, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  store ptr %353, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #1
  %354 = load ptr, ptr %20, align 8, !tbaa !5
  %355 = load ptr, ptr %20, align 8, !tbaa !5
  %356 = load ptr, ptr %20, align 8, !tbaa !5
  %357 = load ptr, ptr %4, align 8, !tbaa !5
  %358 = getelementptr inbounds %struct.gpt2_model, ptr %357, i32 0, i32 7
  %359 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %358, i32 0, i32 0
  %360 = load ptr, ptr %359, align 8, !tbaa !61
  %361 = load i32, ptr %14, align 4, !tbaa !15
  %362 = load i32, ptr %8, align 4, !tbaa !15
  %363 = mul nsw i32 %361, %362
  %364 = sext i32 %363 to i64
  %365 = load i32, ptr %27, align 4, !tbaa !15
  %366 = load i32, ptr %10, align 4, !tbaa !15
  %367 = mul nsw i32 %365, %366
  %368 = sext i32 %367 to i64
  %369 = load ptr, ptr %4, align 8, !tbaa !5
  %370 = getelementptr inbounds %struct.gpt2_model, ptr %369, i32 0, i32 7
  %371 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %370, i32 0, i32 0
  %372 = load ptr, ptr %371, align 8, !tbaa !61
  %373 = call i64 @ggml_element_size(ptr noundef %372)
  %374 = mul i64 %368, %373
  %375 = load i32, ptr %8, align 4, !tbaa !15
  %376 = sext i32 %375 to i64
  %377 = mul i64 %374, %376
  %378 = call ptr @ggml_view_1d(ptr noundef %356, ptr noundef %360, i64 noundef %364, i64 noundef %377)
  %379 = load i32, ptr %8, align 4, !tbaa !15
  %380 = load i32, ptr %11, align 4, !tbaa !15
  %381 = sdiv i32 %379, %380
  %382 = sext i32 %381 to i64
  %383 = load i32, ptr %11, align 4, !tbaa !15
  %384 = sext i32 %383 to i64
  %385 = load i32, ptr %14, align 4, !tbaa !15
  %386 = sext i32 %385 to i64
  %387 = call ptr @ggml_reshape_3d(ptr noundef %355, ptr noundef %378, i64 noundef %382, i64 noundef %384, i64 noundef %386)
  %388 = call ptr @ggml_permute(ptr noundef %354, ptr noundef %387, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  store ptr %388, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #1
  %389 = load ptr, ptr %20, align 8, !tbaa !5
  %390 = load ptr, ptr %35, align 8, !tbaa !5
  %391 = load ptr, ptr %34, align 8, !tbaa !5
  %392 = call ptr @ggml_mul_mat(ptr noundef %389, ptr noundef %390, ptr noundef %391)
  store ptr %392, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #1
  %393 = load ptr, ptr %20, align 8, !tbaa !5
  %394 = load ptr, ptr %36, align 8, !tbaa !5
  %395 = load i32, ptr %8, align 4, !tbaa !15
  %396 = sitofp i32 %395 to float
  %397 = load i32, ptr %11, align 4, !tbaa !15
  %398 = sitofp i32 %397 to float
  %399 = fdiv float %396, %398
  %400 = call float @sqrtf(float noundef %399) #1
  %401 = fdiv float 1.000000e+00, %400
  %402 = call ptr @ggml_scale(ptr noundef %393, ptr noundef %394, float noundef %401)
  store ptr %402, ptr %37, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #1
  %403 = load ptr, ptr %20, align 8, !tbaa !5
  %404 = load ptr, ptr %37, align 8, !tbaa !5
  %405 = load ptr, ptr %26, align 8, !tbaa !5
  %406 = call ptr @ggml_add(ptr noundef %403, ptr noundef %404, ptr noundef %405)
  store ptr %406, ptr %38, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #1
  %407 = load ptr, ptr %20, align 8, !tbaa !5
  %408 = load ptr, ptr %38, align 8, !tbaa !5
  %409 = call ptr @ggml_soft_max(ptr noundef %407, ptr noundef %408)
  store ptr %409, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #1
  %410 = load ptr, ptr %20, align 8, !tbaa !5
  %411 = load ptr, ptr %20, align 8, !tbaa !5
  %412 = load ptr, ptr %20, align 8, !tbaa !5
  %413 = load ptr, ptr %20, align 8, !tbaa !5
  %414 = load ptr, ptr %4, align 8, !tbaa !5
  %415 = getelementptr inbounds %struct.gpt2_model, ptr %414, i32 0, i32 7
  %416 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %415, i32 0, i32 1
  %417 = load ptr, ptr %416, align 8, !tbaa !62
  %418 = load i32, ptr %14, align 4, !tbaa !15
  %419 = load i32, ptr %8, align 4, !tbaa !15
  %420 = mul nsw i32 %418, %419
  %421 = sext i32 %420 to i64
  %422 = load i32, ptr %27, align 4, !tbaa !15
  %423 = load i32, ptr %10, align 4, !tbaa !15
  %424 = mul nsw i32 %422, %423
  %425 = sext i32 %424 to i64
  %426 = load ptr, ptr %4, align 8, !tbaa !5
  %427 = getelementptr inbounds %struct.gpt2_model, ptr %426, i32 0, i32 7
  %428 = getelementptr inbounds %struct.gpt2_kv_cache, ptr %427, i32 0, i32 1
  %429 = load ptr, ptr %428, align 8, !tbaa !62
  %430 = call i64 @ggml_element_size(ptr noundef %429)
  %431 = mul i64 %425, %430
  %432 = load i32, ptr %8, align 4, !tbaa !15
  %433 = sext i32 %432 to i64
  %434 = mul i64 %431, %433
  %435 = call ptr @ggml_view_1d(ptr noundef %413, ptr noundef %417, i64 noundef %421, i64 noundef %434)
  %436 = load i32, ptr %8, align 4, !tbaa !15
  %437 = load i32, ptr %11, align 4, !tbaa !15
  %438 = sdiv i32 %436, %437
  %439 = sext i32 %438 to i64
  %440 = load i32, ptr %11, align 4, !tbaa !15
  %441 = sext i32 %440 to i64
  %442 = load i32, ptr %14, align 4, !tbaa !15
  %443 = sext i32 %442 to i64
  %444 = call ptr @ggml_reshape_3d(ptr noundef %412, ptr noundef %435, i64 noundef %439, i64 noundef %441, i64 noundef %443)
  %445 = call ptr @ggml_permute(ptr noundef %411, ptr noundef %444, i32 noundef 1, i32 noundef 2, i32 noundef 0, i32 noundef 3)
  %446 = load i32, ptr %14, align 4, !tbaa !15
  %447 = sext i32 %446 to i64
  %448 = load i32, ptr %8, align 4, !tbaa !15
  %449 = load i32, ptr %11, align 4, !tbaa !15
  %450 = sdiv i32 %448, %449
  %451 = sext i32 %450 to i64
  %452 = load i32, ptr %11, align 4, !tbaa !15
  %453 = sext i32 %452 to i64
  %454 = call ptr @ggml_cont_3d(ptr noundef %410, ptr noundef %445, i64 noundef %447, i64 noundef %451, i64 noundef %453)
  store ptr %454, ptr %40, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #1
  %455 = load ptr, ptr %20, align 8, !tbaa !5
  %456 = load ptr, ptr %40, align 8, !tbaa !5
  %457 = load ptr, ptr %39, align 8, !tbaa !5
  %458 = call ptr @ggml_mul_mat(ptr noundef %455, ptr noundef %456, ptr noundef %457)
  store ptr %458, ptr %41, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #1
  %459 = load ptr, ptr %20, align 8, !tbaa !5
  %460 = load ptr, ptr %41, align 8, !tbaa !5
  %461 = call ptr @ggml_permute(ptr noundef %459, ptr noundef %460, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  store ptr %461, ptr %42, align 8, !tbaa !5
  %462 = load ptr, ptr %20, align 8, !tbaa !5
  %463 = load ptr, ptr %42, align 8, !tbaa !5
  %464 = load i32, ptr %8, align 4, !tbaa !15
  %465 = sext i32 %464 to i64
  %466 = load i32, ptr %13, align 4, !tbaa !15
  %467 = sext i32 %466 to i64
  %468 = call ptr @ggml_cont_2d(ptr noundef %462, ptr noundef %463, i64 noundef %465, i64 noundef %467)
  store ptr %468, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #1
  %469 = load ptr, ptr %20, align 8, !tbaa !5
  %470 = load ptr, ptr %4, align 8, !tbaa !5
  %471 = getelementptr inbounds %struct.gpt2_model, ptr %470, i32 0, i32 6
  %472 = load i32, ptr %27, align 4, !tbaa !15
  %473 = sext i32 %472 to i64
  %474 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %471, i64 noundef %473) #1
  %475 = getelementptr inbounds %struct.gpt2_layer, ptr %474, i32 0, i32 6
  %476 = load ptr, ptr %475, align 8, !tbaa !63
  %477 = load ptr, ptr %28, align 8, !tbaa !5
  %478 = call ptr @ggml_mul_mat(ptr noundef %469, ptr noundef %476, ptr noundef %477)
  store ptr %478, ptr %28, align 8, !tbaa !5
  %479 = load ptr, ptr %20, align 8, !tbaa !5
  %480 = load ptr, ptr %28, align 8, !tbaa !5
  %481 = load ptr, ptr %4, align 8, !tbaa !5
  %482 = getelementptr inbounds %struct.gpt2_model, ptr %481, i32 0, i32 6
  %483 = load i32, ptr %27, align 4, !tbaa !15
  %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) #1
  %486 = getelementptr inbounds %struct.gpt2_layer, ptr %485, i32 0, i32 7
  %487 = load ptr, ptr %486, align 8, !tbaa !64
  %488 = call ptr @ggml_add(ptr noundef %479, ptr noundef %480, ptr noundef %487)
  store ptr %488, ptr %28, align 8, !tbaa !5
  %489 = load ptr, ptr %20, align 8, !tbaa !5
  %490 = load ptr, ptr %28, align 8, !tbaa !5
  %491 = load ptr, ptr %23, align 8, !tbaa !5
  %492 = call ptr @ggml_add(ptr noundef %489, ptr noundef %490, ptr noundef %491)
  store ptr %492, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #1
  %493 = load ptr, ptr %28, align 8, !tbaa !5
  store ptr %493, ptr %43, align 8, !tbaa !5
  %494 = load ptr, ptr %20, align 8, !tbaa !5
  %495 = load ptr, ptr %43, align 8, !tbaa !5
  %496 = load ptr, ptr %7, align 8, !tbaa !5
  %497 = getelementptr inbounds %struct.gpt2_hparams, ptr %496, i32 0, i32 6
  %498 = load float, ptr %497, align 4, !tbaa !55
  %499 = call ptr @ggml_norm(ptr noundef %494, ptr noundef %495, float noundef %498)
  store ptr %499, ptr %28, align 8, !tbaa !5
  %500 = load ptr, ptr %20, align 8, !tbaa !5
  %501 = load ptr, ptr %20, align 8, !tbaa !5
  %502 = load ptr, ptr %28, align 8, !tbaa !5
  %503 = load ptr, ptr %4, align 8, !tbaa !5
  %504 = getelementptr inbounds %struct.gpt2_model, ptr %503, i32 0, i32 6
  %505 = load i32, ptr %27, align 4, !tbaa !15
  %506 = sext i32 %505 to i64
  %507 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %504, i64 noundef %506) #1
  %508 = getelementptr inbounds %struct.gpt2_layer, ptr %507, i32 0, i32 2
  %509 = load ptr, ptr %508, align 8, !tbaa !65
  %510 = call ptr @ggml_mul(ptr noundef %501, ptr noundef %502, ptr noundef %509)
  %511 = load ptr, ptr %4, align 8, !tbaa !5
  %512 = getelementptr inbounds %struct.gpt2_model, ptr %511, i32 0, i32 6
  %513 = load i32, ptr %27, align 4, !tbaa !15
  %514 = sext i32 %513 to i64
  %515 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %512, i64 noundef %514) #1
  %516 = getelementptr inbounds %struct.gpt2_layer, ptr %515, i32 0, i32 3
  %517 = load ptr, ptr %516, align 8, !tbaa !66
  %518 = call ptr @ggml_add(ptr noundef %500, ptr noundef %510, ptr noundef %517)
  store ptr %518, ptr %28, align 8, !tbaa !5
  %519 = load ptr, ptr %20, align 8, !tbaa !5
  %520 = load ptr, ptr %4, align 8, !tbaa !5
  %521 = getelementptr inbounds %struct.gpt2_model, ptr %520, i32 0, i32 6
  %522 = load i32, ptr %27, align 4, !tbaa !15
  %523 = sext i32 %522 to i64
  %524 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %521, i64 noundef %523) #1
  %525 = getelementptr inbounds %struct.gpt2_layer, ptr %524, i32 0, i32 8
  %526 = load ptr, ptr %525, align 8, !tbaa !67
  %527 = load ptr, ptr %28, align 8, !tbaa !5
  %528 = call ptr @ggml_mul_mat(ptr noundef %519, ptr noundef %526, ptr noundef %527)
  store ptr %528, ptr %28, align 8, !tbaa !5
  %529 = load ptr, ptr %20, align 8, !tbaa !5
  %530 = load ptr, ptr %28, align 8, !tbaa !5
  %531 = load ptr, ptr %4, align 8, !tbaa !5
  %532 = getelementptr inbounds %struct.gpt2_model, ptr %531, i32 0, i32 6
  %533 = load i32, ptr %27, align 4, !tbaa !15
  %534 = sext i32 %533 to i64
  %535 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %532, i64 noundef %534) #1
  %536 = getelementptr inbounds %struct.gpt2_layer, ptr %535, i32 0, i32 9
  %537 = load ptr, ptr %536, align 8, !tbaa !68
  %538 = call ptr @ggml_add(ptr noundef %529, ptr noundef %530, ptr noundef %537)
  store ptr %538, ptr %28, align 8, !tbaa !5
  %539 = load ptr, ptr %20, align 8, !tbaa !5
  %540 = load ptr, ptr %28, align 8, !tbaa !5
  %541 = call ptr @ggml_gelu(ptr noundef %539, ptr noundef %540)
  store ptr %541, ptr %28, align 8, !tbaa !5
  %542 = load ptr, ptr %20, align 8, !tbaa !5
  %543 = load ptr, ptr %4, align 8, !tbaa !5
  %544 = getelementptr inbounds %struct.gpt2_model, ptr %543, i32 0, i32 6
  %545 = load i32, ptr %27, align 4, !tbaa !15
  %546 = sext i32 %545 to i64
  %547 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %544, i64 noundef %546) #1
  %548 = getelementptr inbounds %struct.gpt2_layer, ptr %547, i32 0, i32 10
  %549 = load ptr, ptr %548, align 8, !tbaa !69
  %550 = load ptr, ptr %28, align 8, !tbaa !5
  %551 = call ptr @ggml_mul_mat(ptr noundef %542, ptr noundef %549, ptr noundef %550)
  store ptr %551, ptr %28, align 8, !tbaa !5
  %552 = load ptr, ptr %20, align 8, !tbaa !5
  %553 = load ptr, ptr %28, align 8, !tbaa !5
  %554 = load ptr, ptr %4, align 8, !tbaa !5
  %555 = getelementptr inbounds %struct.gpt2_model, ptr %554, i32 0, i32 6
  %556 = load i32, ptr %27, align 4, !tbaa !15
  %557 = sext i32 %556 to i64
  %558 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %555, i64 noundef %557) #1
  %559 = getelementptr inbounds %struct.gpt2_layer, ptr %558, i32 0, i32 11
  %560 = load ptr, ptr %559, align 8, !tbaa !70
  %561 = call ptr @ggml_add(ptr noundef %552, ptr noundef %553, ptr noundef %560)
  store ptr %561, ptr %28, align 8, !tbaa !5
  %562 = load ptr, ptr %20, align 8, !tbaa !5
  %563 = load ptr, ptr %28, align 8, !tbaa !5
  %564 = load ptr, ptr %43, align 8, !tbaa !5
  %565 = call ptr @ggml_add(ptr noundef %562, ptr noundef %563, ptr noundef %564)
  store ptr %565, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #1
  br label %566

566:                                              ; preds = %340
  %567 = load i32, ptr %27, align 4, !tbaa !15
  %568 = add nsw i32 %567, 1
  store i32 %568, ptr %27, align 4, !tbaa !15
  br label %184, !llvm.loop !71

569:                                              ; preds = %188
  %570 = load ptr, ptr %20, align 8, !tbaa !5
  %571 = load ptr, ptr %23, align 8, !tbaa !5
  %572 = load ptr, ptr %7, align 8, !tbaa !5
  %573 = getelementptr inbounds %struct.gpt2_hparams, ptr %572, i32 0, i32 6
  %574 = load float, ptr %573, align 4, !tbaa !55
  %575 = call ptr @ggml_norm(ptr noundef %570, ptr noundef %571, float noundef %574)
  store ptr %575, ptr %23, align 8, !tbaa !5
  %576 = load ptr, ptr %20, align 8, !tbaa !5
  %577 = load ptr, ptr %20, align 8, !tbaa !5
  %578 = load ptr, ptr %23, align 8, !tbaa !5
  %579 = load ptr, ptr %4, align 8, !tbaa !5
  %580 = getelementptr inbounds %struct.gpt2_model, ptr %579, i32 0, i32 1
  %581 = load ptr, ptr %580, align 8, !tbaa !73
  %582 = call ptr @ggml_mul(ptr noundef %577, ptr noundef %578, ptr noundef %581)
  %583 = load ptr, ptr %4, align 8, !tbaa !5
  %584 = getelementptr inbounds %struct.gpt2_model, ptr %583, i32 0, i32 2
  %585 = load ptr, ptr %584, align 8, !tbaa !74
  %586 = call ptr @ggml_add(ptr noundef %576, ptr noundef %582, ptr noundef %585)
  store ptr %586, ptr %23, align 8, !tbaa !5
  %587 = load ptr, ptr %20, align 8, !tbaa !5
  %588 = load ptr, ptr %4, align 8, !tbaa !5
  %589 = getelementptr inbounds %struct.gpt2_model, ptr %588, i32 0, i32 5
  %590 = load ptr, ptr %589, align 8, !tbaa !75
  %591 = load ptr, ptr %23, align 8, !tbaa !5
  %592 = call ptr @ggml_mul_mat(ptr noundef %587, ptr noundef %590, ptr noundef %591)
  store ptr %592, ptr %23, align 8, !tbaa !5
  %593 = load ptr, ptr %22, align 8, !tbaa !5
  %594 = load ptr, ptr %23, align 8, !tbaa !5
  call void @ggml_build_forward_expand(ptr noundef %593, ptr noundef %594)
  %595 = load ptr, ptr %20, align 8, !tbaa !5
  call void @ggml_free(ptr noundef %595)
  %596 = load ptr, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #1
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #1
  ret ptr %596

597:                                              ; preds = %154, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #1
  br label %598

598:                                              ; preds = %597
  %599 = load ptr, ptr %16, align 8
  %600 = load i32, ptr %17, align 4
  %601 = insertvalue { ptr, i32 } poison, ptr %599, 0
  %602 = insertvalue { ptr, i32 } %601, i32 %600, 1
  resume { ptr, i32 } %602
}

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

declare i64 @ggml_graph_overhead_custom(i64 noundef, i1 noundef zeroext) #2

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #1

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

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

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

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

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

declare ptr @ggml_new_graph_custom(ptr noundef, i64 noundef, i1 noundef zeroext) #2

declare void @ggml_set_input(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

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

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

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

declare ptr @ggml_mul(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 i64 @ggml_element_size(ptr 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_cont_3d(ptr noundef, ptr 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(ptr noundef, ptr noundef, float noundef) #2

; Function Attrs: nounwind
declare float @sqrtf(float noundef) #7

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

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

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

declare void @ggml_free(ptr noundef) #2

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

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

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

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

%"class.std::vector.30" = type { %"struct.std::_Vector_base.31" }
%"struct.std::_Vector_base.31" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.ggml_init_params = type { i64, ptr, i8 }
%"class.std::allocator.32" = type { i8 }

@__dso_handle = external hidden global i8
@_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size = external hidden local_unnamed_addr global i64, align 8
@_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size = external hidden global i64, align 8
@_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf = external hidden global %"class.std::vector.30", align 8
@_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf = external hidden global i64, align 8
@.str.41 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [8 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nofree nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) local_unnamed_addr #1

declare i64 @ggml_tensor_overhead() local_unnamed_addr #2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z10gpt2_graphRK10gpt2_modelRK10gpt2_batchb(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(48) %1, i1 noundef zeroext %2) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::allocator.32", align 1
  %5 = alloca %struct.ggml_init_params, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load i32, ptr %8, align 8, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %0, i64 4
  %11 = load i32, ptr %10, align 4, !tbaa !12
  %12 = getelementptr inbounds i8, ptr %0, i64 12
  %13 = load i32, ptr %12, align 4, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %0, i64 96
  %15 = load i32, ptr %1, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %0, i64 120
  %17 = load i32, ptr %16, align 8
  %18 = select i1 %2, i32 %11, i32 %17
  %19 = sub nsw i32 %11, %15
  %20 = getelementptr inbounds i8, ptr %0, i64 112
  %21 = load i32, ptr %20, align 8
  %22 = select i1 %2, i32 %19, i32 %21
  %23 = load atomic i8, ptr @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size acquire, align 8
  %24 = icmp eq i8 %23, 0
  br i1 %24, label %25, label %34, !prof !17

25:                                               ; preds = %3
  %26 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size) #7
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %34, label %27

27:                                               ; preds = %25
  %28 = invoke i64 @ggml_tensor_overhead()
          to label %29 unwind label %63

29:                                               ; preds = %27
  %30 = invoke i64 @ggml_graph_overhead_custom(i64 noundef 4096, i1 noundef zeroext false)
          to label %31 unwind label %63

31:                                               ; preds = %29
  %32 = shl i64 %28, 12
  %33 = add i64 %30, %32
  store i64 %33, ptr @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size, align 8, !tbaa !18
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size) #7
  br label %34

34:                                               ; preds = %31, %25, %3
  %35 = load atomic i8, ptr @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf acquire, align 8
  %36 = icmp eq i8 %35, 0
  br i1 %36, label %37, label %43, !prof !17

37:                                               ; preds = %34
  %38 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf) #7
  %.not232 = icmp eq i32 %38, 0
  br i1 %.not232, label %43, label %39

39:                                               ; preds = %37
  %40 = load i64, ptr @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  call void @_ZNSaIhEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt6vectorIhSaIhEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf, i64 noundef %40, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %41 unwind label %65

41:                                               ; preds = %39
  call void @_ZNSt15__new_allocatorIhED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  %42 = call i32 @__cxa_atexit(ptr nonnull @_ZNSt6vectorIhSaIhEED2Ev, ptr nonnull @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf, ptr nonnull @__dso_handle) #7
  call void @__cxa_guard_release(ptr nonnull @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf) #7
  br label %43

43:                                               ; preds = %41, %37, %34
  %44 = load i64, ptr @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size, align 8, !tbaa !18
  %45 = call noundef ptr @_ZNSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf) #7
  store i64 %44, ptr %5, align 8, !tbaa !18
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %45, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !20
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 16
  store i8 1, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !21
  %46 = call ptr @ggml_init(ptr noundef nonnull byval(%struct.ggml_init_params) align 8 %5)
  %47 = call ptr @ggml_new_graph_custom(ptr noundef %46, i64 noundef 4096, i1 noundef zeroext false)
  %48 = getelementptr inbounds i8, ptr %1, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !23
  %.not234 = icmp eq ptr %49, null
  br i1 %.not234, label %67, label %50

50:                                               ; preds = %43
  %51 = sext i32 %15 to i64
  %52 = call ptr @ggml_new_tensor_1d(ptr noundef %46, i32 noundef 26, i64 noundef %51)
  %53 = call ptr @ggml_set_name(ptr noundef %52, ptr noundef nonnull @.str.41)
  call void @ggml_set_input(ptr noundef %52)
  %54 = call ptr @ggml_new_tensor_1d(ptr noundef %46, i32 noundef 26, i64 noundef %51)
  %55 = call ptr @ggml_set_name(ptr noundef %54, ptr noundef nonnull @.str.42)
  call void @ggml_set_input(ptr noundef %54)
  %56 = getelementptr inbounds i8, ptr %0, i64 48
  %57 = load ptr, ptr %56, align 8, !tbaa !24
  %58 = call ptr @ggml_get_rows(ptr noundef %46, ptr noundef %57, ptr noundef %52)
  %59 = getelementptr inbounds i8, ptr %0, i64 56
  %60 = load ptr, ptr %59, align 8, !tbaa !43
  %61 = call ptr @ggml_get_rows(ptr noundef %46, ptr noundef %60, ptr noundef %54)
  %62 = call ptr @ggml_add(ptr noundef %46, ptr noundef %58, ptr noundef %61)
  br label %76

63:                                               ; preds = %29, %27
  %64 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_guard_abort(ptr nonnull @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE8buf_size) #7
  br label %214

65:                                               ; preds = %39
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIhED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @__cxa_guard_abort(ptr nonnull @_ZGVZ10gpt2_graphRK10gpt2_modelRK10gpt2_batchbE3buf) #7
  br label %214

67:                                               ; preds = %43
  %68 = getelementptr inbounds i8, ptr %1, i64 16
  %69 = load ptr, ptr %68, align 8, !tbaa !44
  %.not235 = icmp eq ptr %69, null
  br i1 %.not235, label %70, label %71

70:                                               ; preds = %67
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.43, i32 noundef 584, ptr noundef nonnull @.str.44, ptr noundef nonnull @.str.45) #8
  unreachable

71:                                               ; preds = %67
  %72 = sext i32 %7 to i64
  %73 = sext i32 %15 to i64
  %74 = call ptr @ggml_new_tensor_2d(ptr noundef %46, i32 noundef 0, i64 noundef %72, i64 noundef %73)
  %75 = call ptr @ggml_set_name(ptr noundef %74, ptr noundef nonnull @.str.46)
  call void @ggml_set_input(ptr noundef %74)
  br label %76

76:                                               ; preds = %71, %50
  %.pre-phi = phi i64 [ %73, %71 ], [ %51, %50 ]
  %.0229 = phi ptr [ %74, %71 ], [ %62, %50 ]
  %77 = sext i32 %18 to i64
  %78 = call ptr @ggml_new_tensor_3d(ptr noundef %46, i32 noundef 0, i64 noundef %77, i64 noundef %.pre-phi, i64 noundef 1)
  %79 = call ptr @ggml_set_name(ptr noundef %78, ptr noundef nonnull @.str.47)
  call void @ggml_set_input(ptr noundef %78)
  %80 = icmp sgt i32 %9, 0
  br i1 %80, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %76
  %81 = getelementptr inbounds i8, ptr %0, i64 24
  %82 = getelementptr inbounds i8, ptr %0, i64 72
  %83 = sext i32 %7 to i64
  %84 = shl nsw i64 %83, 2
  %85 = shl nsw i64 %83, 3
  %86 = icmp sgt i32 %15, 0
  %87 = mul nsw i32 %15, %7
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i8, ptr %0, i64 104
  %90 = sext i32 %13 to i64
  %91 = mul nsw i32 %18, %7
  %92 = sext i32 %91 to i64
  %93 = sitofp i32 %7 to float
  %94 = sitofp i32 %13 to float
  %95 = fdiv float %93, %94
  %96 = sext i32 %11 to i64
  %97 = sext i32 %22 to i64
  %wide.trip.count = zext nneg i32 %9 to i64
  br label %110

._crit_edge:                                      ; preds = %149, %76
  %.1.lcssa = phi ptr [ %.0229, %76 ], [ %213, %149 ]
  %98 = getelementptr inbounds i8, ptr %0, i64 24
  %99 = load float, ptr %98, align 8, !tbaa !45
  %100 = call ptr @ggml_norm(ptr noundef %46, ptr noundef %.1.lcssa, float noundef %99)
  %101 = getelementptr inbounds i8, ptr %0, i64 32
  %102 = load ptr, ptr %101, align 8, !tbaa !46
  %103 = call ptr @ggml_mul(ptr noundef %46, ptr noundef %100, ptr noundef %102)
  %104 = getelementptr inbounds i8, ptr %0, i64 40
  %105 = load ptr, ptr %104, align 8, !tbaa !47
  %106 = call ptr @ggml_add(ptr noundef %46, ptr noundef %103, ptr noundef %105)
  %107 = getelementptr inbounds i8, ptr %0, i64 64
  %108 = load ptr, ptr %107, align 8, !tbaa !48
  %109 = call ptr @ggml_mul_mat(ptr noundef %46, ptr noundef %108, ptr noundef %106)
  call void @ggml_build_forward_expand(ptr noundef %47, ptr noundef %109)
  call void @ggml_free(ptr noundef %46)
  ret ptr %47

110:                                              ; preds = %.lr.ph, %149
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %149 ]
  %.1237 = phi ptr [ %.0229, %.lr.ph ], [ %213, %149 ]
  %111 = load float, ptr %81, align 8, !tbaa !45
  %112 = call ptr @ggml_norm(ptr noundef %46, ptr noundef %.1237, float noundef %111)
  %113 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %114 = load ptr, ptr %113, align 8, !tbaa !49
  %115 = call ptr @ggml_mul(ptr noundef %46, ptr noundef %112, ptr noundef %114)
  %116 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %117 = getelementptr inbounds i8, ptr %116, i64 8
  %118 = load ptr, ptr %117, align 8, !tbaa !51
  %119 = call ptr @ggml_add(ptr noundef %46, ptr noundef %115, ptr noundef %118)
  %120 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %121 = getelementptr inbounds i8, ptr %120, i64 32
  %122 = load ptr, ptr %121, align 8, !tbaa !52
  %123 = call ptr @ggml_mul_mat(ptr noundef %46, ptr noundef %122, ptr noundef %119)
  %124 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %125 = getelementptr inbounds i8, ptr %124, i64 40
  %126 = load ptr, ptr %125, align 8, !tbaa !53
  %127 = call ptr @ggml_add(ptr noundef %46, ptr noundef %123, ptr noundef %126)
  %128 = getelementptr inbounds i8, ptr %127, i64 56
  %129 = load i64, ptr %128, align 8, !tbaa !18
  %130 = call ptr @ggml_view_2d(ptr noundef %46, ptr noundef %127, i64 noundef %83, i64 noundef %.pre-phi, i64 noundef %129, i64 noundef 0)
  %131 = load i64, ptr %128, align 8, !tbaa !18
  %132 = call ptr @ggml_view_2d(ptr noundef %46, ptr noundef %127, i64 noundef %83, i64 noundef %.pre-phi, i64 noundef %131, i64 noundef %84)
  %133 = load i64, ptr %128, align 8, !tbaa !18
  %134 = call ptr @ggml_view_2d(ptr noundef %46, ptr noundef %127, i64 noundef %83, i64 noundef %.pre-phi, i64 noundef %133, i64 noundef %85)
  br i1 %86, label %135, label %._crit_edge239

._crit_edge239:                                   ; preds = %110
  %.pre = mul nsw i64 %indvars.iv, %96
  br label %149

135:                                              ; preds = %110
  %136 = load ptr, ptr %14, align 8, !tbaa !54
  %137 = call i64 @ggml_element_size(ptr noundef %136)
  %138 = mul nsw i64 %indvars.iv, %96
  %139 = add nsw i64 %138, %97
  %140 = mul nsw i64 %139, %83
  %141 = mul i64 %140, %137
  %142 = call ptr @ggml_view_1d(ptr noundef %46, ptr noundef %136, i64 noundef %88, i64 noundef %141)
  %143 = load ptr, ptr %89, align 8, !tbaa !55
  %144 = call i64 @ggml_element_size(ptr noundef %143)
  %145 = mul i64 %140, %144
  %146 = call ptr @ggml_view_1d(ptr noundef %46, ptr noundef %143, i64 noundef %88, i64 noundef %145)
  %147 = call ptr @ggml_cpy(ptr noundef %46, ptr noundef %132, ptr noundef %142)
  call void @ggml_build_forward_expand(ptr noundef %47, ptr noundef %147)
  %148 = call ptr @ggml_cpy(ptr noundef %46, ptr noundef %134, ptr noundef %146)
  call void @ggml_build_forward_expand(ptr noundef %47, ptr noundef %148)
  br label %149

149:                                              ; preds = %._crit_edge239, %135
  %.pre-phi240 = phi i64 [ %.pre, %._crit_edge239 ], [ %138, %135 ]
  %150 = sdiv i32 %7, %13
  %151 = sext i32 %150 to i64
  %152 = call ptr @ggml_cont_3d(ptr noundef %46, ptr noundef %130, i64 noundef %151, i64 noundef %90, i64 noundef %.pre-phi)
  %153 = call ptr @ggml_permute(ptr noundef %46, ptr noundef %152, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  %154 = load ptr, ptr %14, align 8, !tbaa !54
  %155 = call i64 @ggml_element_size(ptr noundef %154)
  %156 = mul nsw i64 %.pre-phi240, %83
  %157 = mul i64 %156, %155
  %158 = call ptr @ggml_view_1d(ptr noundef %46, ptr noundef %154, i64 noundef %92, i64 noundef %157)
  %159 = call ptr @ggml_reshape_3d(ptr noundef %46, ptr noundef %158, i64 noundef %151, i64 noundef %90, i64 noundef %77)
  %160 = call ptr @ggml_permute(ptr noundef %46, ptr noundef %159, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  %161 = call ptr @ggml_mul_mat(ptr noundef %46, ptr noundef %160, ptr noundef %153)
  %162 = call float @sqrtf(float noundef %95) #7
  %163 = fdiv float 1.000000e+00, %162
  %164 = call ptr @ggml_scale(ptr noundef %46, ptr noundef %161, float noundef %163)
  %165 = call ptr @ggml_add(ptr noundef %46, ptr noundef %164, ptr noundef %78)
  %166 = call ptr @ggml_soft_max(ptr noundef %46, ptr noundef %165)
  %167 = load ptr, ptr %89, align 8, !tbaa !55
  %168 = call i64 @ggml_element_size(ptr noundef %167)
  %169 = mul i64 %156, %168
  %170 = call ptr @ggml_view_1d(ptr noundef %46, ptr noundef %167, i64 noundef %92, i64 noundef %169)
  %171 = call ptr @ggml_reshape_3d(ptr noundef %46, ptr noundef %170, i64 noundef %151, i64 noundef %90, i64 noundef %77)
  %172 = call ptr @ggml_permute(ptr noundef %46, ptr noundef %171, i32 noundef 1, i32 noundef 2, i32 noundef 0, i32 noundef 3)
  %173 = call ptr @ggml_cont_3d(ptr noundef %46, ptr noundef %172, i64 noundef %77, i64 noundef %151, i64 noundef %90)
  %174 = call ptr @ggml_mul_mat(ptr noundef %46, ptr noundef %173, ptr noundef %166)
  %175 = call ptr @ggml_permute(ptr noundef %46, ptr noundef %174, i32 noundef 0, i32 noundef 2, i32 noundef 1, i32 noundef 3)
  %176 = call ptr @ggml_cont_2d(ptr noundef %46, ptr noundef %175, i64 noundef %83, i64 noundef %.pre-phi)
  %177 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %178 = getelementptr inbounds i8, ptr %177, i64 48
  %179 = load ptr, ptr %178, align 8, !tbaa !56
  %180 = call ptr @ggml_mul_mat(ptr noundef %46, ptr noundef %179, ptr noundef %176)
  %181 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %182 = getelementptr inbounds i8, ptr %181, i64 56
  %183 = load ptr, ptr %182, align 8, !tbaa !57
  %184 = call ptr @ggml_add(ptr noundef %46, ptr noundef %180, ptr noundef %183)
  %185 = call ptr @ggml_add(ptr noundef %46, ptr noundef %184, ptr noundef %.1237)
  %186 = load float, ptr %81, align 8, !tbaa !45
  %187 = call ptr @ggml_norm(ptr noundef %46, ptr noundef %185, float noundef %186)
  %188 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %189 = getelementptr inbounds i8, ptr %188, i64 16
  %190 = load ptr, ptr %189, align 8, !tbaa !58
  %191 = call ptr @ggml_mul(ptr noundef %46, ptr noundef %187, ptr noundef %190)
  %192 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %193 = getelementptr inbounds i8, ptr %192, i64 24
  %194 = load ptr, ptr %193, align 8, !tbaa !59
  %195 = call ptr @ggml_add(ptr noundef %46, ptr noundef %191, ptr noundef %194)
  %196 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %197 = getelementptr inbounds i8, ptr %196, i64 64
  %198 = load ptr, ptr %197, align 8, !tbaa !60
  %199 = call ptr @ggml_mul_mat(ptr noundef %46, ptr noundef %198, ptr noundef %195)
  %200 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %201 = getelementptr inbounds i8, ptr %200, i64 72
  %202 = load ptr, ptr %201, align 8, !tbaa !61
  %203 = call ptr @ggml_add(ptr noundef %46, ptr noundef %199, ptr noundef %202)
  %204 = call ptr @ggml_gelu(ptr noundef %46, ptr noundef %203)
  %205 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %206 = getelementptr inbounds i8, ptr %205, i64 80
  %207 = load ptr, ptr %206, align 8, !tbaa !62
  %208 = call ptr @ggml_mul_mat(ptr noundef %46, ptr noundef %207, ptr noundef %204)
  %209 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI10gpt2_layerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv) #7
  %210 = getelementptr inbounds i8, ptr %209, i64 88
  %211 = load ptr, ptr %210, align 8, !tbaa !63
  %212 = call ptr @ggml_add(ptr noundef %46, ptr noundef %208, ptr noundef %211)
  %213 = call ptr @ggml_add(ptr noundef %46, ptr noundef %212, ptr noundef %185)
  %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 %110, !llvm.loop !64

214:                                              ; preds = %65, %63
  %.pn = phi { ptr, i32 } [ %66, %65 ], [ %64, %63 ]
  resume { ptr, i32 } %.pn
}

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

declare i64 @ggml_graph_overhead_custom(i64 noundef, i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare void @__cxa_guard_abort(ptr) local_unnamed_addr #1

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

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

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

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

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

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

declare void @ggml_set_input(ptr noundef) local_unnamed_addr #2

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

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

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

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

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

declare ptr @ggml_mul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #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) local_unnamed_addr #4 align 2

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

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

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

declare i64 @ggml_element_size(ptr noundef) local_unnamed_addr #2

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

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

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

declare ptr @ggml_cont_3d(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

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

declare ptr @ggml_scale(ptr noundef, ptr noundef, float noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @sqrtf(float noundef) local_unnamed_addr #6

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

declare ptr @ggml_cont_2d(ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

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

declare void @ggml_free(ptr noundef) local_unnamed_addr #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!15, !7, i64 0}
!15 = !{!"_ZTS10gpt2_batch", !7, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"branch_weights", i32 1, i32 1048575}
!18 = !{!19, !19, i64 0}
!19 = !{!"long", !8, i64 0}
!20 = !{!16, !16, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"bool", !8, i64 0}
!23 = !{!15, !16, i64 8}
!24 = !{!25, !16, i64 48}
!25 = !{!"_ZTS10gpt2_model", !6, i64 0, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !26, i64 72, !30, i64 96, !16, i64 160, !16, i64 168, !16, i64 176, !35, i64 184}
!26 = !{!"_ZTSSt6vectorI10gpt2_layerSaIS0_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseI10gpt2_layerSaIS0_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseI10gpt2_layerSaIS0_EE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!30 = !{!"_ZTS13gpt2_kv_cache", !16, i64 0, !16, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !31, i64 32, !16, i64 56}
!31 = !{!"_ZTSSt6vectorI12gpt2_kv_cellSaIS0_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseI12gpt2_kv_cellSaIS0_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseI12gpt2_kv_cellSaIS0_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseI12gpt2_kv_cellSaIS0_EE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!35 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP11ggml_tensorSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !36, i64 0}
!36 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !37, i64 0}
!37 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P11ggml_tensorESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !38, i64 0, !40, i64 8}
!38 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !39, i64 0}
!39 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!40 = !{!"_ZTSSt15_Rb_tree_header", !41, i64 0, !19, i64 32}
!41 = !{!"_ZTSSt18_Rb_tree_node_base", !42, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}
!42 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!43 = !{!25, !16, i64 56}
!44 = !{!15, !16, i64 16}
!45 = !{!6, !10, i64 24}
!46 = !{!25, !16, i64 32}
!47 = !{!25, !16, i64 40}
!48 = !{!25, !16, i64 64}
!49 = !{!50, !16, i64 0}
!50 = !{!"_ZTS10gpt2_layer", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88}
!51 = !{!50, !16, i64 8}
!52 = !{!50, !16, i64 32}
!53 = !{!50, !16, i64 40}
!54 = !{!25, !16, i64 96}
!55 = !{!25, !16, i64 104}
!56 = !{!50, !16, i64 48}
!57 = !{!50, !16, i64 56}
!58 = !{!50, !16, i64 16}
!59 = !{!50, !16, i64 24}
!60 = !{!50, !16, i64 64}
!61 = !{!50, !16, i64 72}
!62 = !{!50, !16, i64 80}
!63 = !{!50, !16, i64 88}
!64 = distinct !{!64, !65}
!65 = !{!"llvm.loop.mustprogress"}


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