; LLVM IR from ggml-org/ggml :: examples/sam (main)

; 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.sam_model = type { %struct.sam_hparams, %struct.sam_encoder_image, %struct.sam_encoder_prompt, %struct.sam_decoder_mask, ptr, %"class.std::map" }
%struct.sam_hparams = type { i32, i32, i32, i32, i32, i32, i32, float, float, float, float, float, float }
%struct.sam_encoder_image = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::vector.9" }
%"class.std::vector.9" = type { %"struct.std::_Vector_base.10" }
%"struct.std::_Vector_base.10" = type { %"struct.std::_Vector_base<sam_layer_enc, std::allocator<sam_layer_enc>>::_Vector_impl" }
%"struct.std::_Vector_base<sam_layer_enc, std::allocator<sam_layer_enc>>::_Vector_impl" = type { %"struct.std::_Vector_base<sam_layer_enc, std::allocator<sam_layer_enc>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sam_layer_enc, std::allocator<sam_layer_enc>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.sam_encoder_prompt = type { ptr, ptr, %"class.std::vector.14", ptr }
%"class.std::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl" }
%"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.sam_decoder_mask = type { %"class.std::vector.19", %struct.sam_layer_dec_transformer_attn, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::vector.24", ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.std::vector.19" = type { %"struct.std::_Vector_base.20" }
%"struct.std::_Vector_base.20" = type { %"struct.std::_Vector_base<sam_layer_dec_transformer, std::allocator<sam_layer_dec_transformer>>::_Vector_impl" }
%"struct.std::_Vector_base<sam_layer_dec_transformer, std::allocator<sam_layer_dec_transformer>>::_Vector_impl" = type { %"struct.std::_Vector_base<sam_layer_dec_transformer, std::allocator<sam_layer_dec_transformer>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sam_layer_dec_transformer, std::allocator<sam_layer_dec_transformer>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.sam_layer_dec_transformer_attn = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.std::vector.24" = type { %"struct.std::_Vector_base.25" }
%"struct.std::_Vector_base.25" = type { %"struct.std::_Vector_base<sam_layer_dec_output_hypernet_mlps, std::allocator<sam_layer_dec_output_hypernet_mlps>>::_Vector_impl" }
%"struct.std::_Vector_base<sam_layer_dec_output_hypernet_mlps, std::allocator<sam_layer_dec_output_hypernet_mlps>>::_Vector_impl" = type { %"struct.std::_Vector_base<sam_layer_dec_output_hypernet_mlps, std::allocator<sam_layer_dec_output_hypernet_mlps>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sam_layer_dec_output_hypernet_mlps, std::allocator<sam_layer_dec_output_hypernet_mlps>>::_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.prompt_encoder_result = type { 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.sam_state = type { ptr, ptr, ptr, ptr, %"class.std::vector", %"class.std::vector", %"class.std::vector", ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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.sam_layer_dec_transformer = type { %struct.sam_layer_dec_transformer_attn, ptr, ptr, %struct.sam_layer_dec_transformer_attn, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.sam_layer_dec_transformer_attn }
%struct.sam_layer_dec_output_hypernet_mlps = type { ptr, ptr, ptr, ptr, ptr, ptr }

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK11sam_hparams10n_img_embdEv(ptr noundef nonnull align 4 dereferenceable(52)) #2 align 2

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

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

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

declare ptr @ggml_cont(ptr noundef, ptr noundef) #3

declare ptr @ggml_transpose(ptr noundef, ptr noundef) #3

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

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

declare ptr @ggml_view_3d(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z17sam_layer_norm_2dP12ggml_contextP11ggml_tensoriS2_S2_f(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, float noundef) #2

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

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

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

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

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

declare ptr @ggml_add_inplace(ptr noundef, ptr noundef, ptr noundef) #3

declare ptr @ggml_reshape_4d(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL31ggml_disconnect_node_from_graphP11ggml_tensor(ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(496)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z26sam_decode_mask_mlp_relu_3P11ggml_tensorS0_S0_S0_S0_S0_S0_P12ggml_context(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @ggml_relu_inplace(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z15sam_decode_maskRK9sam_modelRK21prompt_encoder_resultP11ggml_tensorP12ggml_contextP11ggml_cgraphR9sam_state(ptr noundef nonnull align 8 dereferenceable(496) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef nonnull align 8 dereferenceable(112) %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca [3 x i64], align 16
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca [4 x i32], align 16
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i8, align 1
  %27 = alloca ptr, align 8
  %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 i32, align 4
  %41 = alloca ptr, align 8
  %42 = alloca ptr, align 8
  %43 = alloca ptr, align 8
  %44 = alloca i32, align 4
  %45 = alloca ptr, align 8
  %46 = alloca ptr, align 8
  %47 = alloca ptr, align 8
  %48 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.sam_model, ptr %49, i32 0, i32 0
  store ptr %50, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.sam_model, ptr %51, i32 0, i32 3
  store ptr %52, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %53 = load ptr, ptr %13, align 8, !tbaa !5
  %54 = call noundef i32 @_ZNK11sam_hparams10n_img_embdEv(ptr noundef nonnull align 4 dereferenceable(52) %53)
  store i32 %54, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.prompt_encoder_result, ptr %55, i32 0, i32 0
  store ptr %56, ptr %17, align 8, !tbaa !5
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = load ptr, ptr %14, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.sam_decoder_mask, ptr %58, i32 0, i32 17
  %60 = load ptr, ptr %59, align 8, !tbaa !11
  %61 = getelementptr inbounds %struct.ggml_tensor, ptr %60, i32 0, i32 2
  %62 = getelementptr inbounds [4 x i64], ptr %61, i64 0, i64 0
  %63 = load i64, ptr %62, align 8, !tbaa !22
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.sam_decoder_mask, ptr %64, i32 0, i32 17
  %66 = load ptr, ptr %65, align 8, !tbaa !11
  %67 = getelementptr inbounds %struct.ggml_tensor, ptr %66, i32 0, i32 2
  %68 = getelementptr inbounds [4 x i64], ptr %67, i64 0, i64 1
  %69 = load i64, ptr %68, align 8, !tbaa !22
  %70 = load ptr, ptr %14, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.sam_decoder_mask, ptr %70, i32 0, i32 18
  %72 = load ptr, ptr %71, align 8, !tbaa !24
  %73 = getelementptr inbounds %struct.ggml_tensor, ptr %72, i32 0, i32 2
  %74 = getelementptr inbounds [4 x i64], ptr %73, i64 0, i64 1
  %75 = load i64, ptr %74, align 8, !tbaa !22
  %76 = add nsw i64 %69, %75
  %77 = load ptr, ptr %17, align 8, !tbaa !5
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ggml_tensor, ptr %78, i32 0, i32 2
  %80 = getelementptr inbounds [4 x i64], ptr %79, i64 0, i64 1
  %81 = load i64, ptr %80, align 8, !tbaa !22
  %82 = add nsw i64 %76, %81
  %83 = load ptr, ptr %17, align 8, !tbaa !5
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.ggml_tensor, ptr %84, i32 0, i32 2
  %86 = getelementptr inbounds [4 x i64], ptr %85, i64 0, i64 2
  %87 = load i64, ptr %86, align 8, !tbaa !22
  %88 = call ptr @ggml_new_tensor_3d(ptr noundef %57, i32 noundef 0, i64 noundef %63, i64 noundef %82, i64 noundef %87)
  store ptr %88, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #5
  store i64 0, ptr %18, align 8, !tbaa !22
  %89 = getelementptr inbounds i64, ptr %18, i64 1
  %90 = load ptr, ptr %14, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.sam_decoder_mask, ptr %90, i32 0, i32 17
  %92 = load ptr, ptr %91, align 8, !tbaa !11
  %93 = getelementptr inbounds %struct.ggml_tensor, ptr %92, i32 0, i32 2
  %94 = getelementptr inbounds [4 x i64], ptr %93, i64 0, i64 1
  %95 = load i64, ptr %94, align 8, !tbaa !22
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ggml_tensor, ptr %96, i32 0, i32 3
  %98 = getelementptr inbounds [4 x i64], ptr %97, i64 0, i64 1
  %99 = load i64, ptr %98, align 8, !tbaa !22
  %100 = mul i64 %95, %99
  store i64 %100, ptr %89, align 8, !tbaa !22
  %101 = getelementptr inbounds i64, ptr %18, i64 2
  %102 = load ptr, ptr %14, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.sam_decoder_mask, ptr %102, i32 0, i32 17
  %104 = load ptr, ptr %103, align 8, !tbaa !11
  %105 = getelementptr inbounds %struct.ggml_tensor, ptr %104, i32 0, i32 2
  %106 = getelementptr inbounds [4 x i64], ptr %105, i64 0, i64 1
  %107 = load i64, ptr %106, align 8, !tbaa !22
  %108 = load ptr, ptr %16, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.ggml_tensor, ptr %108, i32 0, i32 3
  %110 = getelementptr inbounds [4 x i64], ptr %109, i64 0, i64 1
  %111 = load i64, ptr %110, align 8, !tbaa !22
  %112 = mul i64 %107, %111
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.sam_decoder_mask, ptr %113, i32 0, i32 18
  %115 = load ptr, ptr %114, align 8, !tbaa !24
  %116 = getelementptr inbounds %struct.ggml_tensor, ptr %115, i32 0, i32 2
  %117 = getelementptr inbounds [4 x i64], ptr %116, i64 0, i64 1
  %118 = load i64, ptr %117, align 8, !tbaa !22
  %119 = load ptr, ptr %16, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.ggml_tensor, ptr %119, i32 0, i32 3
  %121 = getelementptr inbounds [4 x i64], ptr %120, i64 0, i64 1
  %122 = load i64, ptr %121, align 8, !tbaa !22
  %123 = mul i64 %118, %122
  %124 = add i64 %112, %123
  store i64 %124, ptr %101, align 8, !tbaa !22
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = load ptr, ptr %10, align 8, !tbaa !5
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.sam_decoder_mask, ptr %127, i32 0, i32 17
  %129 = load ptr, ptr %128, align 8, !tbaa !11
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = load ptr, ptr %16, align 8, !tbaa !5
  %132 = load ptr, ptr %16, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.ggml_tensor, ptr %132, i32 0, i32 2
  %134 = getelementptr inbounds [4 x i64], ptr %133, i64 0, i64 0
  %135 = load i64, ptr %134, align 8, !tbaa !22
  %136 = load ptr, ptr %14, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.sam_decoder_mask, ptr %136, i32 0, i32 17
  %138 = load ptr, ptr %137, align 8, !tbaa !11
  %139 = getelementptr inbounds %struct.ggml_tensor, ptr %138, i32 0, i32 2
  %140 = getelementptr inbounds [4 x i64], ptr %139, i64 0, i64 1
  %141 = load i64, ptr %140, align 8, !tbaa !22
  %142 = load ptr, ptr %16, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.ggml_tensor, ptr %142, i32 0, i32 3
  %144 = getelementptr inbounds [4 x i64], ptr %143, i64 0, i64 1
  %145 = load i64, ptr %144, align 8, !tbaa !22
  %146 = getelementptr inbounds [3 x i64], ptr %18, i64 0, i64 0
  %147 = load i64, ptr %146, align 16, !tbaa !22
  %148 = call ptr @ggml_view_2d(ptr noundef %130, ptr noundef %131, i64 noundef %135, i64 noundef %141, i64 noundef %145, i64 noundef %147)
  %149 = call ptr @ggml_cpy(ptr noundef %126, ptr noundef %129, ptr noundef %148)
  call void @ggml_build_forward_expand(ptr noundef %125, ptr noundef %149)
  %150 = load ptr, ptr %11, align 8, !tbaa !5
  %151 = load ptr, ptr %10, align 8, !tbaa !5
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.sam_decoder_mask, ptr %152, i32 0, i32 18
  %154 = load ptr, ptr %153, align 8, !tbaa !24
  %155 = load ptr, ptr %10, align 8, !tbaa !5
  %156 = load ptr, ptr %16, align 8, !tbaa !5
  %157 = load ptr, ptr %16, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.ggml_tensor, ptr %157, i32 0, i32 2
  %159 = getelementptr inbounds [4 x i64], ptr %158, i64 0, i64 0
  %160 = load i64, ptr %159, align 8, !tbaa !22
  %161 = load ptr, ptr %14, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.sam_decoder_mask, ptr %161, i32 0, i32 18
  %163 = load ptr, ptr %162, align 8, !tbaa !24
  %164 = getelementptr inbounds %struct.ggml_tensor, ptr %163, i32 0, i32 2
  %165 = getelementptr inbounds [4 x i64], ptr %164, i64 0, i64 1
  %166 = load i64, ptr %165, align 8, !tbaa !22
  %167 = load ptr, ptr %16, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.ggml_tensor, ptr %167, i32 0, i32 3
  %169 = getelementptr inbounds [4 x i64], ptr %168, i64 0, i64 1
  %170 = load i64, ptr %169, align 8, !tbaa !22
  %171 = getelementptr inbounds [3 x i64], ptr %18, i64 0, i64 1
  %172 = load i64, ptr %171, align 8, !tbaa !22
  %173 = call ptr @ggml_view_2d(ptr noundef %155, ptr noundef %156, i64 noundef %160, i64 noundef %166, i64 noundef %170, i64 noundef %172)
  %174 = call ptr @ggml_cpy(ptr noundef %151, ptr noundef %154, ptr noundef %173)
  call void @ggml_build_forward_expand(ptr noundef %150, ptr noundef %174)
  %175 = load ptr, ptr %11, align 8, !tbaa !5
  %176 = load ptr, ptr %10, align 8, !tbaa !5
  %177 = load ptr, ptr %17, align 8, !tbaa !5
  %178 = load ptr, ptr %177, align 8, !tbaa !5
  %179 = load ptr, ptr %10, align 8, !tbaa !5
  %180 = load ptr, ptr %16, align 8, !tbaa !5
  %181 = load ptr, ptr %16, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.ggml_tensor, ptr %181, i32 0, i32 2
  %183 = getelementptr inbounds [4 x i64], ptr %182, i64 0, i64 0
  %184 = load i64, ptr %183, align 8, !tbaa !22
  %185 = load ptr, ptr %17, align 8, !tbaa !5
  %186 = load ptr, ptr %185, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.ggml_tensor, ptr %186, i32 0, i32 2
  %188 = getelementptr inbounds [4 x i64], ptr %187, i64 0, i64 1
  %189 = load i64, ptr %188, align 8, !tbaa !22
  %190 = load ptr, ptr %16, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.ggml_tensor, ptr %190, i32 0, i32 3
  %192 = getelementptr inbounds [4 x i64], ptr %191, i64 0, i64 1
  %193 = load i64, ptr %192, align 8, !tbaa !22
  %194 = getelementptr inbounds [3 x i64], ptr %18, i64 0, i64 2
  %195 = load i64, ptr %194, align 16, !tbaa !22
  %196 = call ptr @ggml_view_2d(ptr noundef %179, ptr noundef %180, i64 noundef %184, i64 noundef %189, i64 noundef %193, i64 noundef %195)
  %197 = call ptr @ggml_cpy(ptr noundef %176, ptr noundef %178, ptr noundef %196)
  call void @ggml_build_forward_expand(ptr noundef %175, ptr noundef %197)
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store ptr null, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  store ptr null, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #5
  call void @llvm.memset.p0.i64(ptr align 16 %21, i8 0, i64 16, i1 false)
  %198 = load ptr, ptr %10, align 8, !tbaa !5
  %199 = load ptr, ptr %12, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.sam_state, ptr %199, i32 0, i32 0
  %201 = load ptr, ptr %200, align 8, !tbaa !25
  %202 = getelementptr inbounds %struct.ggml_tensor, ptr %201, i32 0, i32 2
  %203 = getelementptr inbounds [4 x i64], ptr %202, i64 0, i64 0
  %204 = load i64, ptr %203, align 8, !tbaa !22
  %205 = load ptr, ptr %12, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.sam_state, ptr %205, i32 0, i32 0
  %207 = load ptr, ptr %206, align 8, !tbaa !25
  %208 = getelementptr inbounds %struct.ggml_tensor, ptr %207, i32 0, i32 2
  %209 = getelementptr inbounds [4 x i64], ptr %208, i64 0, i64 1
  %210 = load i64, ptr %209, align 8, !tbaa !22
  %211 = load ptr, ptr %12, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.sam_state, ptr %211, i32 0, i32 0
  %213 = load ptr, ptr %212, align 8, !tbaa !25
  %214 = getelementptr inbounds %struct.ggml_tensor, ptr %213, i32 0, i32 2
  %215 = getelementptr inbounds [4 x i64], ptr %214, i64 0, i64 2
  %216 = load i64, ptr %215, align 8, !tbaa !22
  %217 = load ptr, ptr %16, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.ggml_tensor, ptr %217, i32 0, i32 2
  %219 = getelementptr inbounds [4 x i64], ptr %218, i64 0, i64 2
  %220 = load i64, ptr %219, align 8, !tbaa !22
  %221 = call ptr @ggml_new_tensor_4d(ptr noundef %198, i32 noundef 0, i64 noundef %204, i64 noundef %210, i64 noundef %216, i64 noundef %220)
  store ptr %221, ptr %19, align 8, !tbaa !5
  %222 = load ptr, ptr %10, align 8, !tbaa !5
  %223 = load ptr, ptr %10, align 8, !tbaa !5
  %224 = load ptr, ptr %12, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.sam_state, ptr %224, i32 0, i32 0
  %226 = load ptr, ptr %225, align 8, !tbaa !25
  %227 = load ptr, ptr %19, align 8, !tbaa !5
  %228 = call ptr @ggml_repeat(ptr noundef %223, ptr noundef %226, ptr noundef %227)
  %229 = load ptr, ptr %8, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.prompt_encoder_result, ptr %229, i32 0, i32 1
  %231 = load ptr, ptr %230, align 8, !tbaa !31
  %232 = call ptr @ggml_add(ptr noundef %222, ptr noundef %228, ptr noundef %231)
  store ptr %232, ptr %19, align 8, !tbaa !5
  %233 = load ptr, ptr %19, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.ggml_tensor, ptr %233, i32 0, i32 2
  %235 = getelementptr inbounds [4 x i64], ptr %234, i64 0, i64 0
  %236 = load i64, ptr %235, align 8, !tbaa !22
  %237 = trunc i64 %236 to i32
  %238 = getelementptr inbounds [4 x i32], ptr %21, i64 0, i64 0
  store i32 %237, ptr %238, align 16, !tbaa !9
  %239 = load ptr, ptr %19, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.ggml_tensor, ptr %239, i32 0, i32 2
  %241 = getelementptr inbounds [4 x i64], ptr %240, i64 0, i64 1
  %242 = load i64, ptr %241, align 8, !tbaa !22
  %243 = trunc i64 %242 to i32
  %244 = getelementptr inbounds [4 x i32], ptr %21, i64 0, i64 1
  store i32 %243, ptr %244, align 4, !tbaa !9
  %245 = load ptr, ptr %19, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.ggml_tensor, ptr %245, i32 0, i32 2
  %247 = getelementptr inbounds [4 x i64], ptr %246, i64 0, i64 2
  %248 = load i64, ptr %247, align 8, !tbaa !22
  %249 = trunc i64 %248 to i32
  %250 = getelementptr inbounds [4 x i32], ptr %21, i64 0, i64 2
  store i32 %249, ptr %250, align 8, !tbaa !9
  %251 = load ptr, ptr %19, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.ggml_tensor, ptr %251, i32 0, i32 2
  %253 = getelementptr inbounds [4 x i64], ptr %252, i64 0, i64 3
  %254 = load i64, ptr %253, align 8, !tbaa !22
  %255 = trunc i64 %254 to i32
  %256 = getelementptr inbounds [4 x i32], ptr %21, i64 0, i64 3
  store i32 %255, ptr %256, align 4, !tbaa !9
  %257 = load ptr, ptr %10, align 8, !tbaa !5
  %258 = load ptr, ptr %10, align 8, !tbaa !5
  %259 = load ptr, ptr %10, align 8, !tbaa !5
  %260 = load ptr, ptr %19, align 8, !tbaa !5
  %261 = load ptr, ptr %19, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.ggml_tensor, ptr %261, i32 0, i32 2
  %263 = getelementptr inbounds [4 x i64], ptr %262, i64 0, i64 0
  %264 = load i64, ptr %263, align 8, !tbaa !22
  %265 = load ptr, ptr %19, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.ggml_tensor, ptr %265, i32 0, i32 2
  %267 = getelementptr inbounds [4 x i64], ptr %266, i64 0, i64 1
  %268 = load i64, ptr %267, align 8, !tbaa !22
  %269 = mul nsw i64 %264, %268
  %270 = load ptr, ptr %19, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.ggml_tensor, ptr %270, i32 0, i32 2
  %272 = getelementptr inbounds [4 x i64], ptr %271, i64 0, i64 2
  %273 = load i64, ptr %272, align 8, !tbaa !22
  %274 = load ptr, ptr %19, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.ggml_tensor, ptr %274, i32 0, i32 2
  %276 = getelementptr inbounds [4 x i64], ptr %275, i64 0, i64 3
  %277 = load i64, ptr %276, align 8, !tbaa !22
  %278 = load ptr, ptr %19, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.ggml_tensor, ptr %278, i32 0, i32 3
  %280 = getelementptr inbounds [4 x i64], ptr %279, i64 0, i64 2
  %281 = load i64, ptr %280, align 8, !tbaa !22
  %282 = load ptr, ptr %19, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.ggml_tensor, ptr %282, i32 0, i32 3
  %284 = getelementptr inbounds [4 x i64], ptr %283, i64 0, i64 3
  %285 = load i64, ptr %284, align 8, !tbaa !22
  %286 = call ptr @ggml_view_3d(ptr noundef %259, ptr noundef %260, i64 noundef %269, i64 noundef %273, i64 noundef %277, i64 noundef %281, i64 noundef %285, i64 noundef 0)
  %287 = call ptr @ggml_permute(ptr noundef %258, ptr noundef %286, i32 noundef 1, i32 noundef 0, i32 noundef 2, i32 noundef 3)
  %288 = call ptr @ggml_cont(ptr noundef %257, ptr noundef %287)
  store ptr %288, ptr %19, align 8, !tbaa !5
  %289 = load ptr, ptr %10, align 8, !tbaa !5
  %290 = load ptr, ptr %9, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.ggml_tensor, ptr %290, i32 0, i32 2
  %292 = getelementptr inbounds [4 x i64], ptr %291, i64 0, i64 0
  %293 = load i64, ptr %292, align 8, !tbaa !22
  %294 = load ptr, ptr %9, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.ggml_tensor, ptr %294, i32 0, i32 2
  %296 = getelementptr inbounds [4 x i64], ptr %295, i64 0, i64 1
  %297 = load i64, ptr %296, align 8, !tbaa !22
  %298 = load ptr, ptr %9, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct.ggml_tensor, ptr %298, i32 0, i32 2
  %300 = getelementptr inbounds [4 x i64], ptr %299, i64 0, i64 2
  %301 = load i64, ptr %300, align 8, !tbaa !22
  %302 = load ptr, ptr %16, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.ggml_tensor, ptr %302, i32 0, i32 2
  %304 = getelementptr inbounds [4 x i64], ptr %303, i64 0, i64 2
  %305 = load i64, ptr %304, align 8, !tbaa !22
  %306 = call ptr @ggml_new_tensor_4d(ptr noundef %289, i32 noundef 0, i64 noundef %293, i64 noundef %297, i64 noundef %301, i64 noundef %305)
  store ptr %306, ptr %20, align 8, !tbaa !5
  %307 = load ptr, ptr %10, align 8, !tbaa !5
  %308 = load ptr, ptr %9, align 8, !tbaa !5
  %309 = load ptr, ptr %20, align 8, !tbaa !5
  %310 = call ptr @ggml_repeat(ptr noundef %307, ptr noundef %308, ptr noundef %309)
  store ptr %310, ptr %20, align 8, !tbaa !5
  %311 = load ptr, ptr %10, align 8, !tbaa !5
  %312 = load ptr, ptr %10, align 8, !tbaa !5
  %313 = load ptr, ptr %10, align 8, !tbaa !5
  %314 = load ptr, ptr %20, align 8, !tbaa !5
  %315 = load ptr, ptr %20, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct.ggml_tensor, ptr %315, i32 0, i32 2
  %317 = getelementptr inbounds [4 x i64], ptr %316, i64 0, i64 0
  %318 = load i64, ptr %317, align 8, !tbaa !22
  %319 = load ptr, ptr %20, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct.ggml_tensor, ptr %319, i32 0, i32 2
  %321 = getelementptr inbounds [4 x i64], ptr %320, i64 0, i64 1
  %322 = load i64, ptr %321, align 8, !tbaa !22
  %323 = mul nsw i64 %318, %322
  %324 = load ptr, ptr %20, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.ggml_tensor, ptr %324, i32 0, i32 2
  %326 = getelementptr inbounds [4 x i64], ptr %325, i64 0, i64 2
  %327 = load i64, ptr %326, align 8, !tbaa !22
  %328 = load ptr, ptr %20, align 8, !tbaa !5
  %329 = getelementptr inbounds %struct.ggml_tensor, ptr %328, i32 0, i32 2
  %330 = getelementptr inbounds [4 x i64], ptr %329, i64 0, i64 3
  %331 = load i64, ptr %330, align 8, !tbaa !22
  %332 = load ptr, ptr %20, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.ggml_tensor, ptr %332, i32 0, i32 3
  %334 = getelementptr inbounds [4 x i64], ptr %333, i64 0, i64 2
  %335 = load i64, ptr %334, align 8, !tbaa !22
  %336 = load ptr, ptr %20, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.ggml_tensor, ptr %336, i32 0, i32 3
  %338 = getelementptr inbounds [4 x i64], ptr %337, i64 0, i64 3
  %339 = load i64, ptr %338, align 8, !tbaa !22
  %340 = call ptr @ggml_view_3d(ptr noundef %313, ptr noundef %314, i64 noundef %323, i64 noundef %327, i64 noundef %331, i64 noundef %335, i64 noundef %339, i64 noundef 0)
  %341 = call ptr @ggml_permute(ptr noundef %312, ptr noundef %340, i32 noundef 1, i32 noundef 0, i32 noundef 2, i32 noundef 3)
  %342 = call ptr @ggml_cont(ptr noundef %311, ptr noundef %341)
  store ptr %342, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %343 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %343, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %344 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %344, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %345

345:                                              ; preds = %532, %6
  %346 = load i32, ptr %24, align 4, !tbaa !9
  %347 = load ptr, ptr %7, align 8, !tbaa !5
  %348 = getelementptr inbounds %struct.sam_model, ptr %347, i32 0, i32 3
  %349 = getelementptr inbounds %struct.sam_decoder_mask, ptr %348, i32 0, i32 0
  %350 = call noundef i64 @_ZNKSt6vectorI25sam_layer_dec_transformerSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %349) #5
  %351 = trunc i64 %350 to i32
  %352 = icmp slt i32 %346, %351
  br i1 %352, label %354, label %353

353:                                              ; preds = %345
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %535

354:                                              ; preds = %345
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %355 = load ptr, ptr %7, align 8, !tbaa !5
  %356 = getelementptr inbounds %struct.sam_model, ptr %355, i32 0, i32 3
  %357 = getelementptr inbounds %struct.sam_decoder_mask, ptr %356, i32 0, i32 0
  %358 = load i32, ptr %24, align 4, !tbaa !9
  %359 = sext i32 %358 to i64
  %360 = call noundef nonnull align 8 dereferenceable(288) ptr @_ZNKSt6vectorI25sam_layer_dec_transformerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %357, i64 noundef %359) #5
  store ptr %360, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #5
  %361 = load i32, ptr %24, align 4, !tbaa !9
  %362 = icmp eq i32 %361, 0
  %363 = zext i1 %362 to i8
  store i8 %363, ptr %26, align 1, !tbaa !33
  %364 = load i8, ptr %26, align 1, !tbaa !33, !range !35, !noundef !36
  %365 = trunc i8 %364 to i1
  br i1 %365, label %366, label %375

366:                                              ; preds = %354
  %367 = load ptr, ptr %25, align 8, !tbaa !5
  %368 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %367, i32 0, i32 0
  %369 = load ptr, ptr %22, align 8, !tbaa !5
  %370 = load ptr, ptr %22, align 8, !tbaa !5
  %371 = load ptr, ptr %22, align 8, !tbaa !5
  %372 = load ptr, ptr %10, align 8, !tbaa !5
  %373 = load ptr, ptr %7, align 8, !tbaa !5
  %374 = call noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64) %368, ptr noundef %369, ptr noundef %370, ptr noundef %371, ptr noundef %372, ptr noundef nonnull align 8 dereferenceable(496) %373)
  store ptr %374, ptr %22, align 8, !tbaa !5
  br label %392

375:                                              ; preds = %354
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %376 = load ptr, ptr %10, align 8, !tbaa !5
  %377 = load ptr, ptr %22, align 8, !tbaa !5
  %378 = load ptr, ptr %16, align 8, !tbaa !5
  %379 = call ptr @ggml_add(ptr noundef %376, ptr noundef %377, ptr noundef %378)
  store ptr %379, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %380 = load ptr, ptr %25, align 8, !tbaa !5
  %381 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %380, i32 0, i32 0
  %382 = load ptr, ptr %27, align 8, !tbaa !5
  %383 = load ptr, ptr %27, align 8, !tbaa !5
  %384 = load ptr, ptr %22, align 8, !tbaa !5
  %385 = load ptr, ptr %10, align 8, !tbaa !5
  %386 = load ptr, ptr %7, align 8, !tbaa !5
  %387 = call noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64) %381, ptr noundef %382, ptr noundef %383, ptr noundef %384, ptr noundef %385, ptr noundef nonnull align 8 dereferenceable(496) %386)
  store ptr %387, ptr %28, align 8, !tbaa !5
  %388 = load ptr, ptr %10, align 8, !tbaa !5
  %389 = load ptr, ptr %22, align 8, !tbaa !5
  %390 = load ptr, ptr %28, align 8, !tbaa !5
  %391 = call ptr @ggml_add(ptr noundef %388, ptr noundef %389, ptr noundef %390)
  store ptr %391, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br label %392

392:                                              ; preds = %375, %366
  %393 = load ptr, ptr %10, align 8, !tbaa !5
  %394 = load ptr, ptr %22, align 8, !tbaa !5
  %395 = load ptr, ptr %13, align 8, !tbaa !5
  %396 = getelementptr inbounds %struct.sam_hparams, ptr %395, i32 0, i32 12
  %397 = load float, ptr %396, align 4, !tbaa !37
  %398 = call ptr @ggml_norm(ptr noundef %393, ptr noundef %394, float noundef %397)
  store ptr %398, ptr %22, align 8, !tbaa !5
  %399 = load ptr, ptr %10, align 8, !tbaa !5
  %400 = load ptr, ptr %10, align 8, !tbaa !5
  %401 = load ptr, ptr %22, align 8, !tbaa !5
  %402 = load ptr, ptr %25, align 8, !tbaa !5
  %403 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %402, i32 0, i32 1
  %404 = load ptr, ptr %403, align 8, !tbaa !40
  %405 = call ptr @ggml_mul(ptr noundef %400, ptr noundef %401, ptr noundef %404)
  %406 = load ptr, ptr %25, align 8, !tbaa !5
  %407 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %406, i32 0, i32 2
  %408 = load ptr, ptr %407, align 8, !tbaa !42
  %409 = call ptr @ggml_add_inplace(ptr noundef %399, ptr noundef %405, ptr noundef %408)
  store ptr %409, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %410 = load ptr, ptr %10, align 8, !tbaa !5
  %411 = load ptr, ptr %22, align 8, !tbaa !5
  %412 = load ptr, ptr %16, align 8, !tbaa !5
  %413 = call ptr @ggml_add(ptr noundef %410, ptr noundef %411, ptr noundef %412)
  store ptr %413, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %414 = load ptr, ptr %10, align 8, !tbaa !5
  %415 = load ptr, ptr %23, align 8, !tbaa !5
  %416 = load ptr, ptr %20, align 8, !tbaa !5
  %417 = call ptr @ggml_add(ptr noundef %414, ptr noundef %415, ptr noundef %416)
  store ptr %417, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %418 = load ptr, ptr %25, align 8, !tbaa !5
  %419 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %418, i32 0, i32 3
  %420 = load ptr, ptr %29, align 8, !tbaa !5
  %421 = load ptr, ptr %30, align 8, !tbaa !5
  %422 = load ptr, ptr %23, align 8, !tbaa !5
  %423 = load ptr, ptr %10, align 8, !tbaa !5
  %424 = load ptr, ptr %7, align 8, !tbaa !5
  %425 = call noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64) %419, ptr noundef %420, ptr noundef %421, ptr noundef %422, ptr noundef %423, ptr noundef nonnull align 8 dereferenceable(496) %424)
  store ptr %425, ptr %31, align 8, !tbaa !5
  %426 = load ptr, ptr %10, align 8, !tbaa !5
  %427 = load ptr, ptr %22, align 8, !tbaa !5
  %428 = load ptr, ptr %31, align 8, !tbaa !5
  %429 = call ptr @ggml_add_inplace(ptr noundef %426, ptr noundef %427, ptr noundef %428)
  store ptr %429, ptr %22, align 8, !tbaa !5
  %430 = load ptr, ptr %10, align 8, !tbaa !5
  %431 = load ptr, ptr %22, align 8, !tbaa !5
  %432 = load ptr, ptr %13, align 8, !tbaa !5
  %433 = getelementptr inbounds %struct.sam_hparams, ptr %432, i32 0, i32 12
  %434 = load float, ptr %433, align 4, !tbaa !37
  %435 = call ptr @ggml_norm_inplace(ptr noundef %430, ptr noundef %431, float noundef %434)
  store ptr %435, ptr %22, align 8, !tbaa !5
  %436 = load ptr, ptr %10, align 8, !tbaa !5
  %437 = load ptr, ptr %10, align 8, !tbaa !5
  %438 = load ptr, ptr %22, align 8, !tbaa !5
  %439 = load ptr, ptr %25, align 8, !tbaa !5
  %440 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %439, i32 0, i32 4
  %441 = load ptr, ptr %440, align 8, !tbaa !43
  %442 = call ptr @ggml_mul(ptr noundef %437, ptr noundef %438, ptr noundef %441)
  %443 = load ptr, ptr %25, align 8, !tbaa !5
  %444 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %443, i32 0, i32 5
  %445 = load ptr, ptr %444, align 8, !tbaa !44
  %446 = call ptr @ggml_add_inplace(ptr noundef %436, ptr noundef %442, ptr noundef %445)
  store ptr %446, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  %447 = load ptr, ptr %10, align 8, !tbaa !5
  %448 = load ptr, ptr %25, align 8, !tbaa !5
  %449 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %448, i32 0, i32 6
  %450 = load ptr, ptr %449, align 8, !tbaa !45
  %451 = load ptr, ptr %22, align 8, !tbaa !5
  %452 = call ptr @ggml_mul_mat(ptr noundef %447, ptr noundef %450, ptr noundef %451)
  store ptr %452, ptr %32, align 8, !tbaa !5
  %453 = load ptr, ptr %10, align 8, !tbaa !5
  %454 = load ptr, ptr %32, align 8, !tbaa !5
  %455 = load ptr, ptr %25, align 8, !tbaa !5
  %456 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %455, i32 0, i32 7
  %457 = load ptr, ptr %456, align 8, !tbaa !46
  %458 = call ptr @ggml_add_inplace(ptr noundef %453, ptr noundef %454, ptr noundef %457)
  store ptr %458, ptr %32, align 8, !tbaa !5
  %459 = load ptr, ptr %10, align 8, !tbaa !5
  %460 = load ptr, ptr %32, align 8, !tbaa !5
  %461 = call ptr @ggml_relu_inplace(ptr noundef %459, ptr noundef %460)
  store ptr %461, ptr %32, align 8, !tbaa !5
  %462 = load ptr, ptr %10, align 8, !tbaa !5
  %463 = load ptr, ptr %25, align 8, !tbaa !5
  %464 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %463, i32 0, i32 8
  %465 = load ptr, ptr %464, align 8, !tbaa !47
  %466 = load ptr, ptr %32, align 8, !tbaa !5
  %467 = call ptr @ggml_mul_mat(ptr noundef %462, ptr noundef %465, ptr noundef %466)
  store ptr %467, ptr %32, align 8, !tbaa !5
  %468 = load ptr, ptr %10, align 8, !tbaa !5
  %469 = load ptr, ptr %32, align 8, !tbaa !5
  %470 = load ptr, ptr %25, align 8, !tbaa !5
  %471 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %470, i32 0, i32 9
  %472 = load ptr, ptr %471, align 8, !tbaa !48
  %473 = call ptr @ggml_add_inplace(ptr noundef %468, ptr noundef %469, ptr noundef %472)
  store ptr %473, ptr %32, align 8, !tbaa !5
  %474 = load ptr, ptr %10, align 8, !tbaa !5
  %475 = load ptr, ptr %22, align 8, !tbaa !5
  %476 = load ptr, ptr %32, align 8, !tbaa !5
  %477 = call ptr @ggml_add_inplace(ptr noundef %474, ptr noundef %475, ptr noundef %476)
  store ptr %477, ptr %22, align 8, !tbaa !5
  %478 = load ptr, ptr %10, align 8, !tbaa !5
  %479 = load ptr, ptr %22, align 8, !tbaa !5
  %480 = load ptr, ptr %13, align 8, !tbaa !5
  %481 = getelementptr inbounds %struct.sam_hparams, ptr %480, i32 0, i32 12
  %482 = load float, ptr %481, align 4, !tbaa !37
  %483 = call ptr @ggml_norm_inplace(ptr noundef %478, ptr noundef %479, float noundef %482)
  store ptr %483, ptr %22, align 8, !tbaa !5
  %484 = load ptr, ptr %10, align 8, !tbaa !5
  %485 = load ptr, ptr %10, align 8, !tbaa !5
  %486 = load ptr, ptr %22, align 8, !tbaa !5
  %487 = load ptr, ptr %25, align 8, !tbaa !5
  %488 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %487, i32 0, i32 10
  %489 = load ptr, ptr %488, align 8, !tbaa !49
  %490 = call ptr @ggml_mul(ptr noundef %485, ptr noundef %486, ptr noundef %489)
  %491 = load ptr, ptr %25, align 8, !tbaa !5
  %492 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %491, i32 0, i32 11
  %493 = load ptr, ptr %492, align 8, !tbaa !50
  %494 = call ptr @ggml_add_inplace(ptr noundef %484, ptr noundef %490, ptr noundef %493)
  store ptr %494, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  %495 = load ptr, ptr %10, align 8, !tbaa !5
  %496 = load ptr, ptr %22, align 8, !tbaa !5
  %497 = load ptr, ptr %16, align 8, !tbaa !5
  %498 = call ptr @ggml_add(ptr noundef %495, ptr noundef %496, ptr noundef %497)
  store ptr %498, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  %499 = load ptr, ptr %10, align 8, !tbaa !5
  %500 = load ptr, ptr %23, align 8, !tbaa !5
  %501 = load ptr, ptr %20, align 8, !tbaa !5
  %502 = call ptr @ggml_add(ptr noundef %499, ptr noundef %500, ptr noundef %501)
  store ptr %502, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  %503 = load ptr, ptr %25, align 8, !tbaa !5
  %504 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %503, i32 0, i32 14
  %505 = load ptr, ptr %34, align 8, !tbaa !5
  %506 = load ptr, ptr %33, align 8, !tbaa !5
  %507 = load ptr, ptr %22, align 8, !tbaa !5
  %508 = load ptr, ptr %10, align 8, !tbaa !5
  %509 = load ptr, ptr %7, align 8, !tbaa !5
  %510 = call noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64) %504, ptr noundef %505, ptr noundef %506, ptr noundef %507, ptr noundef %508, ptr noundef nonnull align 8 dereferenceable(496) %509)
  store ptr %510, ptr %35, align 8, !tbaa !5
  %511 = load ptr, ptr %10, align 8, !tbaa !5
  %512 = load ptr, ptr %23, align 8, !tbaa !5
  %513 = load ptr, ptr %35, align 8, !tbaa !5
  %514 = call ptr @ggml_add_inplace(ptr noundef %511, ptr noundef %512, ptr noundef %513)
  store ptr %514, ptr %23, align 8, !tbaa !5
  %515 = load ptr, ptr %10, align 8, !tbaa !5
  %516 = load ptr, ptr %23, align 8, !tbaa !5
  %517 = load ptr, ptr %13, align 8, !tbaa !5
  %518 = getelementptr inbounds %struct.sam_hparams, ptr %517, i32 0, i32 12
  %519 = load float, ptr %518, align 4, !tbaa !37
  %520 = call ptr @ggml_norm_inplace(ptr noundef %515, ptr noundef %516, float noundef %519)
  store ptr %520, ptr %23, align 8, !tbaa !5
  %521 = load ptr, ptr %10, align 8, !tbaa !5
  %522 = load ptr, ptr %10, align 8, !tbaa !5
  %523 = load ptr, ptr %23, align 8, !tbaa !5
  %524 = load ptr, ptr %25, align 8, !tbaa !5
  %525 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %524, i32 0, i32 12
  %526 = load ptr, ptr %525, align 8, !tbaa !51
  %527 = call ptr @ggml_mul(ptr noundef %522, ptr noundef %523, ptr noundef %526)
  %528 = load ptr, ptr %25, align 8, !tbaa !5
  %529 = getelementptr inbounds %struct.sam_layer_dec_transformer, ptr %528, i32 0, i32 13
  %530 = load ptr, ptr %529, align 8, !tbaa !52
  %531 = call ptr @ggml_add_inplace(ptr noundef %521, ptr noundef %527, ptr noundef %530)
  store ptr %531, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %532

532:                                              ; preds = %392
  %533 = load i32, ptr %24, align 4, !tbaa !9
  %534 = add nsw i32 %533, 1
  store i32 %534, ptr %24, align 4, !tbaa !9
  br label %345, !llvm.loop !53

535:                                              ; preds = %353
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #5
  %536 = load ptr, ptr %10, align 8, !tbaa !5
  %537 = load ptr, ptr %22, align 8, !tbaa !5
  %538 = load ptr, ptr %16, align 8, !tbaa !5
  %539 = call ptr @ggml_add(ptr noundef %536, ptr noundef %537, ptr noundef %538)
  store ptr %539, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #5
  %540 = load ptr, ptr %10, align 8, !tbaa !5
  %541 = load ptr, ptr %23, align 8, !tbaa !5
  %542 = load ptr, ptr %20, align 8, !tbaa !5
  %543 = call ptr @ggml_add(ptr noundef %540, ptr noundef %541, ptr noundef %542)
  store ptr %543, ptr %37, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #5
  %544 = load ptr, ptr %14, align 8, !tbaa !5
  %545 = getelementptr inbounds %struct.sam_decoder_mask, ptr %544, i32 0, i32 1
  %546 = load ptr, ptr %36, align 8, !tbaa !5
  %547 = load ptr, ptr %37, align 8, !tbaa !5
  %548 = load ptr, ptr %23, align 8, !tbaa !5
  %549 = load ptr, ptr %10, align 8, !tbaa !5
  %550 = load ptr, ptr %7, align 8, !tbaa !5
  %551 = call noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64) %545, ptr noundef %546, ptr noundef %547, ptr noundef %548, ptr noundef %549, ptr noundef nonnull align 8 dereferenceable(496) %550)
  store ptr %551, ptr %38, align 8, !tbaa !5
  %552 = load ptr, ptr %10, align 8, !tbaa !5
  %553 = load ptr, ptr %22, align 8, !tbaa !5
  %554 = load ptr, ptr %38, align 8, !tbaa !5
  %555 = call ptr @ggml_add_inplace(ptr noundef %552, ptr noundef %553, ptr noundef %554)
  store ptr %555, ptr %22, align 8, !tbaa !5
  %556 = load ptr, ptr %10, align 8, !tbaa !5
  %557 = load ptr, ptr %22, align 8, !tbaa !5
  %558 = load ptr, ptr %13, align 8, !tbaa !5
  %559 = getelementptr inbounds %struct.sam_hparams, ptr %558, i32 0, i32 12
  %560 = load float, ptr %559, align 4, !tbaa !37
  %561 = call ptr @ggml_norm_inplace(ptr noundef %556, ptr noundef %557, float noundef %560)
  store ptr %561, ptr %22, align 8, !tbaa !5
  %562 = load ptr, ptr %10, align 8, !tbaa !5
  %563 = load ptr, ptr %10, align 8, !tbaa !5
  %564 = load ptr, ptr %22, align 8, !tbaa !5
  %565 = load ptr, ptr %14, align 8, !tbaa !5
  %566 = getelementptr inbounds %struct.sam_decoder_mask, ptr %565, i32 0, i32 2
  %567 = load ptr, ptr %566, align 8, !tbaa !55
  %568 = call ptr @ggml_mul(ptr noundef %563, ptr noundef %564, ptr noundef %567)
  %569 = load ptr, ptr %14, align 8, !tbaa !5
  %570 = getelementptr inbounds %struct.sam_decoder_mask, ptr %569, i32 0, i32 3
  %571 = load ptr, ptr %570, align 8, !tbaa !56
  %572 = call ptr @ggml_add_inplace(ptr noundef %562, ptr noundef %568, ptr noundef %571)
  store ptr %572, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #5
  %573 = load ptr, ptr %10, align 8, !tbaa !5
  %574 = load ptr, ptr %22, align 8, !tbaa !5
  %575 = load ptr, ptr %22, align 8, !tbaa !5
  %576 = getelementptr inbounds %struct.ggml_tensor, ptr %575, i32 0, i32 2
  %577 = getelementptr inbounds [4 x i64], ptr %576, i64 0, i64 0
  %578 = load i64, ptr %577, align 8, !tbaa !22
  %579 = load ptr, ptr %22, align 8, !tbaa !5
  %580 = getelementptr inbounds %struct.ggml_tensor, ptr %579, i32 0, i32 2
  %581 = getelementptr inbounds [4 x i64], ptr %580, i64 0, i64 2
  %582 = load i64, ptr %581, align 8, !tbaa !22
  %583 = load ptr, ptr %22, align 8, !tbaa !5
  %584 = getelementptr inbounds %struct.ggml_tensor, ptr %583, i32 0, i32 3
  %585 = getelementptr inbounds [4 x i64], ptr %584, i64 0, i64 2
  %586 = load i64, ptr %585, align 8, !tbaa !22
  %587 = call ptr @ggml_view_2d(ptr noundef %573, ptr noundef %574, i64 noundef %578, i64 noundef %582, i64 noundef %586, i64 noundef 0)
  store ptr %587, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #5
  store i32 4, ptr %40, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #5
  %588 = load ptr, ptr %10, align 8, !tbaa !5
  %589 = load ptr, ptr %22, align 8, !tbaa !5
  %590 = load ptr, ptr %22, align 8, !tbaa !5
  %591 = getelementptr inbounds %struct.ggml_tensor, ptr %590, i32 0, i32 2
  %592 = getelementptr inbounds [4 x i64], ptr %591, i64 0, i64 0
  %593 = load i64, ptr %592, align 8, !tbaa !22
  %594 = load ptr, ptr %22, align 8, !tbaa !5
  %595 = getelementptr inbounds %struct.ggml_tensor, ptr %594, i32 0, i32 2
  %596 = getelementptr inbounds [4 x i64], ptr %595, i64 0, i64 2
  %597 = load i64, ptr %596, align 8, !tbaa !22
  %598 = load ptr, ptr %22, align 8, !tbaa !5
  %599 = getelementptr inbounds %struct.ggml_tensor, ptr %598, i32 0, i32 3
  %600 = getelementptr inbounds [4 x i64], ptr %599, i64 0, i64 1
  %601 = load i64, ptr %600, align 8, !tbaa !22
  %602 = load ptr, ptr %22, align 8, !tbaa !5
  %603 = getelementptr inbounds %struct.ggml_tensor, ptr %602, i32 0, i32 3
  %604 = getelementptr inbounds [4 x i64], ptr %603, i64 0, i64 1
  %605 = load i64, ptr %604, align 8, !tbaa !22
  %606 = mul i64 4, %605
  %607 = load ptr, ptr %22, align 8, !tbaa !5
  %608 = getelementptr inbounds %struct.ggml_tensor, ptr %607, i32 0, i32 3
  %609 = getelementptr inbounds [4 x i64], ptr %608, i64 0, i64 1
  %610 = load i64, ptr %609, align 8, !tbaa !22
  %611 = call ptr @ggml_view_3d(ptr noundef %588, ptr noundef %589, i64 noundef %593, i64 noundef 4, i64 noundef %597, i64 noundef %601, i64 noundef %606, i64 noundef %610)
  store ptr %611, ptr %41, align 8, !tbaa !5
  %612 = load ptr, ptr %10, align 8, !tbaa !5
  %613 = load ptr, ptr %10, align 8, !tbaa !5
  %614 = load ptr, ptr %23, align 8, !tbaa !5
  %615 = call ptr @ggml_transpose(ptr noundef %613, ptr noundef %614)
  %616 = call ptr @ggml_cont(ptr noundef %612, ptr noundef %615)
  store ptr %616, ptr %23, align 8, !tbaa !5
  %617 = load ptr, ptr %10, align 8, !tbaa !5
  %618 = load ptr, ptr %23, align 8, !tbaa !5
  %619 = getelementptr inbounds [4 x i32], ptr %21, i64 0, i64 0
  %620 = load i32, ptr %619, align 16, !tbaa !9
  %621 = sext i32 %620 to i64
  %622 = getelementptr inbounds [4 x i32], ptr %21, i64 0, i64 1
  %623 = load i32, ptr %622, align 4, !tbaa !9
  %624 = sext i32 %623 to i64
  %625 = getelementptr inbounds [4 x i32], ptr %21, i64 0, i64 2
  %626 = load i32, ptr %625, align 8, !tbaa !9
  %627 = sext i32 %626 to i64
  %628 = getelementptr inbounds [4 x i32], ptr %21, i64 0, i64 3
  %629 = load i32, ptr %628, align 4, !tbaa !9
  %630 = sext i32 %629 to i64
  %631 = getelementptr inbounds [4 x i32], ptr %21, i64 0, i64 0
  %632 = load i32, ptr %631, align 16, !tbaa !9
  %633 = sext i32 %632 to i64
  %634 = load ptr, ptr %23, align 8, !tbaa !5
  %635 = getelementptr inbounds %struct.ggml_tensor, ptr %634, i32 0, i32 3
  %636 = getelementptr inbounds [4 x i64], ptr %635, i64 0, i64 0
  %637 = load i64, ptr %636, align 8, !tbaa !22
  %638 = mul i64 %633, %637
  %639 = load ptr, ptr %23, align 8, !tbaa !5
  %640 = getelementptr inbounds %struct.ggml_tensor, ptr %639, i32 0, i32 3
  %641 = getelementptr inbounds [4 x i64], ptr %640, i64 0, i64 1
  %642 = load i64, ptr %641, align 8, !tbaa !22
  %643 = load ptr, ptr %23, align 8, !tbaa !5
  %644 = getelementptr inbounds %struct.ggml_tensor, ptr %643, i32 0, i32 3
  %645 = getelementptr inbounds [4 x i64], ptr %644, i64 0, i64 2
  %646 = load i64, ptr %645, align 8, !tbaa !22
  %647 = call ptr @ggml_view_4d(ptr noundef %617, ptr noundef %618, i64 noundef %621, i64 noundef %624, i64 noundef %627, i64 noundef %630, i64 noundef %638, i64 noundef %642, i64 noundef %646, i64 noundef 0)
  store ptr %647, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #5
  store ptr null, ptr %42, align 8, !tbaa !5
  %648 = load ptr, ptr %10, align 8, !tbaa !5
  %649 = load ptr, ptr %14, align 8, !tbaa !5
  %650 = getelementptr inbounds %struct.sam_decoder_mask, ptr %649, i32 0, i32 4
  %651 = load ptr, ptr %650, align 8, !tbaa !57
  %652 = load ptr, ptr %23, align 8, !tbaa !5
  %653 = call ptr @ggml_conv_transpose_2d_p0(ptr noundef %648, ptr noundef %651, ptr noundef %652, i32 noundef 2)
  store ptr %653, ptr %23, align 8, !tbaa !5
  %654 = load ptr, ptr %10, align 8, !tbaa !5
  %655 = load ptr, ptr %23, align 8, !tbaa !5
  %656 = load ptr, ptr %10, align 8, !tbaa !5
  %657 = load ptr, ptr %10, align 8, !tbaa !5
  %658 = load ptr, ptr %14, align 8, !tbaa !5
  %659 = getelementptr inbounds %struct.sam_decoder_mask, ptr %658, i32 0, i32 5
  %660 = load ptr, ptr %659, align 8, !tbaa !58
  %661 = load ptr, ptr %14, align 8, !tbaa !5
  %662 = getelementptr inbounds %struct.sam_decoder_mask, ptr %661, i32 0, i32 5
  %663 = load ptr, ptr %662, align 8, !tbaa !58
  %664 = getelementptr inbounds %struct.ggml_tensor, ptr %663, i32 0, i32 2
  %665 = getelementptr inbounds [4 x i64], ptr %664, i64 0, i64 0
  %666 = load i64, ptr %665, align 8, !tbaa !22
  %667 = call ptr @ggml_reshape_3d(ptr noundef %657, ptr noundef %660, i64 noundef 1, i64 noundef 1, i64 noundef %666)
  %668 = load ptr, ptr %23, align 8, !tbaa !5
  %669 = call ptr @ggml_repeat(ptr noundef %656, ptr noundef %667, ptr noundef %668)
  %670 = call ptr @ggml_add_inplace(ptr noundef %654, ptr noundef %655, ptr noundef %669)
  store ptr %670, ptr %23, align 8, !tbaa !5
  %671 = load ptr, ptr %10, align 8, !tbaa !5
  %672 = load ptr, ptr %23, align 8, !tbaa !5
  %673 = load i32, ptr %15, align 4, !tbaa !9
  %674 = load ptr, ptr %14, align 8, !tbaa !5
  %675 = getelementptr inbounds %struct.sam_decoder_mask, ptr %674, i32 0, i32 6
  %676 = load ptr, ptr %675, align 8, !tbaa !59
  %677 = load ptr, ptr %14, align 8, !tbaa !5
  %678 = getelementptr inbounds %struct.sam_decoder_mask, ptr %677, i32 0, i32 7
  %679 = load ptr, ptr %678, align 8, !tbaa !60
  %680 = load ptr, ptr %13, align 8, !tbaa !5
  %681 = getelementptr inbounds %struct.sam_hparams, ptr %680, i32 0, i32 11
  %682 = load float, ptr %681, align 4, !tbaa !61
  %683 = call noundef ptr @_Z17sam_layer_norm_2dP12ggml_contextP11ggml_tensoriS2_S2_f(ptr noundef %671, ptr noundef %672, i32 noundef %673, ptr noundef %676, ptr noundef %679, float noundef %682)
  store ptr %683, ptr %23, align 8, !tbaa !5
  %684 = load ptr, ptr %10, align 8, !tbaa !5
  %685 = load ptr, ptr %23, align 8, !tbaa !5
  %686 = call ptr @ggml_gelu_inplace(ptr noundef %684, ptr noundef %685)
  store ptr %686, ptr %23, align 8, !tbaa !5
  %687 = load ptr, ptr %10, align 8, !tbaa !5
  %688 = load ptr, ptr %14, align 8, !tbaa !5
  %689 = getelementptr inbounds %struct.sam_decoder_mask, ptr %688, i32 0, i32 8
  %690 = load ptr, ptr %689, align 8, !tbaa !62
  %691 = load ptr, ptr %23, align 8, !tbaa !5
  %692 = call ptr @ggml_conv_transpose_2d_p0(ptr noundef %687, ptr noundef %690, ptr noundef %691, i32 noundef 2)
  store ptr %692, ptr %23, align 8, !tbaa !5
  %693 = load ptr, ptr %10, align 8, !tbaa !5
  %694 = load ptr, ptr %10, align 8, !tbaa !5
  %695 = load ptr, ptr %10, align 8, !tbaa !5
  %696 = load ptr, ptr %14, align 8, !tbaa !5
  %697 = getelementptr inbounds %struct.sam_decoder_mask, ptr %696, i32 0, i32 9
  %698 = load ptr, ptr %697, align 8, !tbaa !63
  %699 = load ptr, ptr %14, align 8, !tbaa !5
  %700 = getelementptr inbounds %struct.sam_decoder_mask, ptr %699, i32 0, i32 9
  %701 = load ptr, ptr %700, align 8, !tbaa !63
  %702 = getelementptr inbounds %struct.ggml_tensor, ptr %701, i32 0, i32 2
  %703 = getelementptr inbounds [4 x i64], ptr %702, i64 0, i64 0
  %704 = load i64, ptr %703, align 8, !tbaa !22
  %705 = call ptr @ggml_reshape_3d(ptr noundef %695, ptr noundef %698, i64 noundef 1, i64 noundef 1, i64 noundef %704)
  %706 = load ptr, ptr %23, align 8, !tbaa !5
  %707 = call ptr @ggml_repeat(ptr noundef %694, ptr noundef %705, ptr noundef %706)
  %708 = load ptr, ptr %23, align 8, !tbaa !5
  %709 = call ptr @ggml_add_inplace(ptr noundef %693, ptr noundef %707, ptr noundef %708)
  store ptr %709, ptr %23, align 8, !tbaa !5
  %710 = load ptr, ptr %10, align 8, !tbaa !5
  %711 = load ptr, ptr %23, align 8, !tbaa !5
  %712 = call ptr @ggml_gelu_inplace(ptr noundef %710, ptr noundef %711)
  store ptr %712, ptr %23, align 8, !tbaa !5
  %713 = load ptr, ptr %10, align 8, !tbaa !5
  %714 = load ptr, ptr %23, align 8, !tbaa !5
  %715 = load ptr, ptr %23, align 8, !tbaa !5
  %716 = getelementptr inbounds %struct.ggml_tensor, ptr %715, i32 0, i32 2
  %717 = getelementptr inbounds [4 x i64], ptr %716, i64 0, i64 0
  %718 = load i64, ptr %717, align 8, !tbaa !22
  %719 = load ptr, ptr %23, align 8, !tbaa !5
  %720 = getelementptr inbounds %struct.ggml_tensor, ptr %719, i32 0, i32 2
  %721 = getelementptr inbounds [4 x i64], ptr %720, i64 0, i64 1
  %722 = load i64, ptr %721, align 8, !tbaa !22
  %723 = mul nsw i64 %718, %722
  %724 = load ptr, ptr %23, align 8, !tbaa !5
  %725 = getelementptr inbounds %struct.ggml_tensor, ptr %724, i32 0, i32 2
  %726 = getelementptr inbounds [4 x i64], ptr %725, i64 0, i64 2
  %727 = load i64, ptr %726, align 8, !tbaa !22
  %728 = load ptr, ptr %23, align 8, !tbaa !5
  %729 = getelementptr inbounds %struct.ggml_tensor, ptr %728, i32 0, i32 2
  %730 = getelementptr inbounds [4 x i64], ptr %729, i64 0, i64 3
  %731 = load i64, ptr %730, align 8, !tbaa !22
  %732 = call ptr @ggml_reshape_3d(ptr noundef %713, ptr noundef %714, i64 noundef %723, i64 noundef %727, i64 noundef %731)
  store ptr %732, ptr %42, align 8, !tbaa !5
  %733 = load ptr, ptr %10, align 8, !tbaa !5
  %734 = load ptr, ptr %10, align 8, !tbaa !5
  %735 = load ptr, ptr %42, align 8, !tbaa !5
  %736 = call ptr @ggml_transpose(ptr noundef %734, ptr noundef %735)
  %737 = call ptr @ggml_cont(ptr noundef %733, ptr noundef %736)
  store ptr %737, ptr %42, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #5
  %738 = load ptr, ptr %10, align 8, !tbaa !5
  %739 = load i32, ptr %15, align 4, !tbaa !9
  %740 = sdiv i32 %739, 2
  %741 = sext i32 %740 to i64
  %742 = load ptr, ptr %41, align 8, !tbaa !5
  %743 = getelementptr inbounds %struct.ggml_tensor, ptr %742, i32 0, i32 2
  %744 = getelementptr inbounds [4 x i64], ptr %743, i64 0, i64 2
  %745 = load i64, ptr %744, align 8, !tbaa !22
  %746 = call ptr @ggml_new_tensor_3d(ptr noundef %738, i32 noundef 0, i64 noundef %741, i64 noundef 4, i64 noundef %745)
  store ptr %746, ptr %43, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #5
  store i32 0, ptr %44, align 4, !tbaa !9
  br label %747

747:                                              ; preds = %826, %535
  %748 = load i32, ptr %44, align 4, !tbaa !9
  %749 = icmp slt i32 %748, 4
  br i1 %749, label %751, label %750

750:                                              ; preds = %747
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #5
  br label %829

751:                                              ; preds = %747
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #5
  %752 = load ptr, ptr %14, align 8, !tbaa !5
  %753 = getelementptr inbounds %struct.sam_decoder_mask, ptr %752, i32 0, i32 10
  %754 = load i32, ptr %44, align 4, !tbaa !9
  %755 = sext i32 %754 to i64
  %756 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorI34sam_layer_dec_output_hypernet_mlpsSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %753, i64 noundef %755) #5
  store ptr %756, ptr %45, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #5
  %757 = load ptr, ptr %10, align 8, !tbaa !5
  %758 = load ptr, ptr %41, align 8, !tbaa !5
  %759 = load ptr, ptr %41, align 8, !tbaa !5
  %760 = getelementptr inbounds %struct.ggml_tensor, ptr %759, i32 0, i32 2
  %761 = getelementptr inbounds [4 x i64], ptr %760, i64 0, i64 0
  %762 = load i64, ptr %761, align 8, !tbaa !22
  %763 = load ptr, ptr %41, align 8, !tbaa !5
  %764 = getelementptr inbounds %struct.ggml_tensor, ptr %763, i32 0, i32 2
  %765 = getelementptr inbounds [4 x i64], ptr %764, i64 0, i64 2
  %766 = load i64, ptr %765, align 8, !tbaa !22
  %767 = load ptr, ptr %41, align 8, !tbaa !5
  %768 = getelementptr inbounds %struct.ggml_tensor, ptr %767, i32 0, i32 3
  %769 = getelementptr inbounds [4 x i64], ptr %768, i64 0, i64 1
  %770 = load i64, ptr %769, align 8, !tbaa !22
  %771 = load i32, ptr %44, align 4, !tbaa !9
  %772 = sext i32 %771 to i64
  %773 = load ptr, ptr %41, align 8, !tbaa !5
  %774 = getelementptr inbounds %struct.ggml_tensor, ptr %773, i32 0, i32 3
  %775 = getelementptr inbounds [4 x i64], ptr %774, i64 0, i64 1
  %776 = load i64, ptr %775, align 8, !tbaa !22
  %777 = mul i64 %772, %776
  %778 = call ptr @ggml_view_2d(ptr noundef %757, ptr noundef %758, i64 noundef %762, i64 noundef %766, i64 noundef %770, i64 noundef %777)
  store ptr %778, ptr %46, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #5
  %779 = load ptr, ptr %46, align 8, !tbaa !5
  %780 = load ptr, ptr %45, align 8, !tbaa !5
  %781 = getelementptr inbounds %struct.sam_layer_dec_output_hypernet_mlps, ptr %780, i32 0, i32 0
  %782 = load ptr, ptr %781, align 8, !tbaa !64
  %783 = load ptr, ptr %45, align 8, !tbaa !5
  %784 = getelementptr inbounds %struct.sam_layer_dec_output_hypernet_mlps, ptr %783, i32 0, i32 1
  %785 = load ptr, ptr %784, align 8, !tbaa !66
  %786 = load ptr, ptr %45, align 8, !tbaa !5
  %787 = getelementptr inbounds %struct.sam_layer_dec_output_hypernet_mlps, ptr %786, i32 0, i32 2
  %788 = load ptr, ptr %787, align 8, !tbaa !67
  %789 = load ptr, ptr %45, align 8, !tbaa !5
  %790 = getelementptr inbounds %struct.sam_layer_dec_output_hypernet_mlps, ptr %789, i32 0, i32 3
  %791 = load ptr, ptr %790, align 8, !tbaa !68
  %792 = load ptr, ptr %45, align 8, !tbaa !5
  %793 = getelementptr inbounds %struct.sam_layer_dec_output_hypernet_mlps, ptr %792, i32 0, i32 4
  %794 = load ptr, ptr %793, align 8, !tbaa !69
  %795 = load ptr, ptr %45, align 8, !tbaa !5
  %796 = getelementptr inbounds %struct.sam_layer_dec_output_hypernet_mlps, ptr %795, i32 0, i32 5
  %797 = load ptr, ptr %796, align 8, !tbaa !70
  %798 = load ptr, ptr %10, align 8, !tbaa !5
  %799 = call noundef ptr @_Z26sam_decode_mask_mlp_relu_3P11ggml_tensorS0_S0_S0_S0_S0_S0_P12ggml_context(ptr noundef %779, ptr noundef %782, ptr noundef %785, ptr noundef %788, ptr noundef %791, ptr noundef %794, ptr noundef %797, ptr noundef %798)
  store ptr %799, ptr %47, align 8, !tbaa !5
  %800 = load ptr, ptr %11, align 8, !tbaa !5
  %801 = load ptr, ptr %10, align 8, !tbaa !5
  %802 = load ptr, ptr %47, align 8, !tbaa !5
  %803 = load ptr, ptr %10, align 8, !tbaa !5
  %804 = load ptr, ptr %43, align 8, !tbaa !5
  %805 = load ptr, ptr %43, align 8, !tbaa !5
  %806 = getelementptr inbounds %struct.ggml_tensor, ptr %805, i32 0, i32 2
  %807 = getelementptr inbounds [4 x i64], ptr %806, i64 0, i64 0
  %808 = load i64, ptr %807, align 8, !tbaa !22
  %809 = load ptr, ptr %43, align 8, !tbaa !5
  %810 = getelementptr inbounds %struct.ggml_tensor, ptr %809, i32 0, i32 2
  %811 = getelementptr inbounds [4 x i64], ptr %810, i64 0, i64 2
  %812 = load i64, ptr %811, align 8, !tbaa !22
  %813 = load ptr, ptr %43, align 8, !tbaa !5
  %814 = getelementptr inbounds %struct.ggml_tensor, ptr %813, i32 0, i32 3
  %815 = getelementptr inbounds [4 x i64], ptr %814, i64 0, i64 1
  %816 = load i64, ptr %815, align 8, !tbaa !22
  %817 = load i32, ptr %44, align 4, !tbaa !9
  %818 = sext i32 %817 to i64
  %819 = load ptr, ptr %43, align 8, !tbaa !5
  %820 = getelementptr inbounds %struct.ggml_tensor, ptr %819, i32 0, i32 3
  %821 = getelementptr inbounds [4 x i64], ptr %820, i64 0, i64 1
  %822 = load i64, ptr %821, align 8, !tbaa !22
  %823 = mul i64 %818, %822
  %824 = call ptr @ggml_view_2d(ptr noundef %803, ptr noundef %804, i64 noundef %808, i64 noundef %812, i64 noundef %816, i64 noundef %823)
  %825 = call ptr @ggml_cpy(ptr noundef %801, ptr noundef %802, ptr noundef %824)
  call void @ggml_build_forward_expand(ptr noundef %800, ptr noundef %825)
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #5
  br label %826

826:                                              ; preds = %751
  %827 = load i32, ptr %44, align 4, !tbaa !9
  %828 = add nsw i32 %827, 1
  store i32 %828, ptr %44, align 4, !tbaa !9
  br label %747, !llvm.loop !71

829:                                              ; preds = %750
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #5
  %830 = load ptr, ptr %10, align 8, !tbaa !5
  %831 = load ptr, ptr %43, align 8, !tbaa !5
  %832 = load ptr, ptr %42, align 8, !tbaa !5
  %833 = call ptr @ggml_mul_mat(ptr noundef %830, ptr noundef %831, ptr noundef %832)
  store ptr %833, ptr %48, align 8, !tbaa !5
  %834 = load ptr, ptr %10, align 8, !tbaa !5
  %835 = load ptr, ptr %10, align 8, !tbaa !5
  %836 = load ptr, ptr %48, align 8, !tbaa !5
  %837 = call ptr @ggml_transpose(ptr noundef %835, ptr noundef %836)
  %838 = call ptr @ggml_cont(ptr noundef %834, ptr noundef %837)
  store ptr %838, ptr %48, align 8, !tbaa !5
  %839 = load ptr, ptr %10, align 8, !tbaa !5
  %840 = load ptr, ptr %48, align 8, !tbaa !5
  %841 = load ptr, ptr %23, align 8, !tbaa !5
  %842 = getelementptr inbounds %struct.ggml_tensor, ptr %841, i32 0, i32 2
  %843 = getelementptr inbounds [4 x i64], ptr %842, i64 0, i64 0
  %844 = load i64, ptr %843, align 8, !tbaa !22
  %845 = load ptr, ptr %23, align 8, !tbaa !5
  %846 = getelementptr inbounds %struct.ggml_tensor, ptr %845, i32 0, i32 2
  %847 = getelementptr inbounds [4 x i64], ptr %846, i64 0, i64 1
  %848 = load i64, ptr %847, align 8, !tbaa !22
  %849 = load ptr, ptr %48, align 8, !tbaa !5
  %850 = getelementptr inbounds %struct.ggml_tensor, ptr %849, i32 0, i32 2
  %851 = getelementptr inbounds [4 x i64], ptr %850, i64 0, i64 1
  %852 = load i64, ptr %851, align 8, !tbaa !22
  %853 = load ptr, ptr %23, align 8, !tbaa !5
  %854 = getelementptr inbounds %struct.ggml_tensor, ptr %853, i32 0, i32 2
  %855 = getelementptr inbounds [4 x i64], ptr %854, i64 0, i64 3
  %856 = load i64, ptr %855, align 8, !tbaa !22
  %857 = call ptr @ggml_reshape_4d(ptr noundef %839, ptr noundef %840, i64 noundef %844, i64 noundef %848, i64 noundef %852, i64 noundef %856)
  store ptr %857, ptr %48, align 8, !tbaa !5
  %858 = load ptr, ptr %39, align 8, !tbaa !5
  %859 = load ptr, ptr %14, align 8, !tbaa !5
  %860 = getelementptr inbounds %struct.sam_decoder_mask, ptr %859, i32 0, i32 11
  %861 = load ptr, ptr %860, align 8, !tbaa !72
  %862 = load ptr, ptr %14, align 8, !tbaa !5
  %863 = getelementptr inbounds %struct.sam_decoder_mask, ptr %862, i32 0, i32 12
  %864 = load ptr, ptr %863, align 8, !tbaa !73
  %865 = load ptr, ptr %14, align 8, !tbaa !5
  %866 = getelementptr inbounds %struct.sam_decoder_mask, ptr %865, i32 0, i32 13
  %867 = load ptr, ptr %866, align 8, !tbaa !74
  %868 = load ptr, ptr %14, align 8, !tbaa !5
  %869 = getelementptr inbounds %struct.sam_decoder_mask, ptr %868, i32 0, i32 14
  %870 = load ptr, ptr %869, align 8, !tbaa !75
  %871 = load ptr, ptr %14, align 8, !tbaa !5
  %872 = getelementptr inbounds %struct.sam_decoder_mask, ptr %871, i32 0, i32 15
  %873 = load ptr, ptr %872, align 8, !tbaa !76
  %874 = load ptr, ptr %14, align 8, !tbaa !5
  %875 = getelementptr inbounds %struct.sam_decoder_mask, ptr %874, i32 0, i32 16
  %876 = load ptr, ptr %875, align 8, !tbaa !77
  %877 = load ptr, ptr %10, align 8, !tbaa !5
  %878 = call noundef ptr @_Z26sam_decode_mask_mlp_relu_3P11ggml_tensorS0_S0_S0_S0_S0_S0_P12ggml_context(ptr noundef %858, ptr noundef %861, ptr noundef %864, ptr noundef %867, ptr noundef %870, ptr noundef %873, ptr noundef %876, ptr noundef %877)
  store ptr %878, ptr %39, align 8, !tbaa !5
  %879 = load ptr, ptr %12, align 8, !tbaa !5
  %880 = getelementptr inbounds %struct.sam_state, ptr %879, i32 0, i32 3
  %881 = load ptr, ptr %880, align 8, !tbaa !78
  %882 = load ptr, ptr %10, align 8, !tbaa !5
  %883 = load ptr, ptr %39, align 8, !tbaa !5
  %884 = load ptr, ptr %39, align 8, !tbaa !5
  %885 = getelementptr inbounds %struct.ggml_tensor, ptr %884, i32 0, i32 2
  %886 = getelementptr inbounds [4 x i64], ptr %885, i64 0, i64 0
  %887 = load i64, ptr %886, align 8, !tbaa !22
  %888 = sub nsw i64 %887, 1
  %889 = load ptr, ptr %39, align 8, !tbaa !5
  %890 = getelementptr inbounds %struct.ggml_tensor, ptr %889, i32 0, i32 3
  %891 = getelementptr inbounds [4 x i64], ptr %890, i64 0, i64 0
  %892 = load i64, ptr %891, align 8, !tbaa !22
  %893 = call ptr @ggml_view_1d(ptr noundef %882, ptr noundef %883, i64 noundef %888, i64 noundef %892)
  %894 = load ptr, ptr %12, align 8, !tbaa !5
  %895 = getelementptr inbounds %struct.sam_state, ptr %894, i32 0, i32 2
  %896 = load ptr, ptr %895, align 8, !tbaa !79
  %897 = call ptr @ggml_cpy(ptr noundef %881, ptr noundef %893, ptr noundef %896)
  store ptr %897, ptr %39, align 8, !tbaa !5
  %898 = load ptr, ptr %10, align 8, !tbaa !5
  %899 = load ptr, ptr %48, align 8, !tbaa !5
  %900 = load ptr, ptr %48, align 8, !tbaa !5
  %901 = getelementptr inbounds %struct.ggml_tensor, ptr %900, i32 0, i32 2
  %902 = getelementptr inbounds [4 x i64], ptr %901, i64 0, i64 0
  %903 = load i64, ptr %902, align 8, !tbaa !22
  %904 = load ptr, ptr %48, align 8, !tbaa !5
  %905 = getelementptr inbounds %struct.ggml_tensor, ptr %904, i32 0, i32 2
  %906 = getelementptr inbounds [4 x i64], ptr %905, i64 0, i64 1
  %907 = load i64, ptr %906, align 8, !tbaa !22
  %908 = load ptr, ptr %48, align 8, !tbaa !5
  %909 = getelementptr inbounds %struct.ggml_tensor, ptr %908, i32 0, i32 2
  %910 = getelementptr inbounds [4 x i64], ptr %909, i64 0, i64 2
  %911 = load i64, ptr %910, align 8, !tbaa !22
  %912 = sub nsw i64 %911, 1
  %913 = load ptr, ptr %48, align 8, !tbaa !5
  %914 = getelementptr inbounds %struct.ggml_tensor, ptr %913, i32 0, i32 2
  %915 = getelementptr inbounds [4 x i64], ptr %914, i64 0, i64 3
  %916 = load i64, ptr %915, align 8, !tbaa !22
  %917 = load ptr, ptr %48, align 8, !tbaa !5
  %918 = getelementptr inbounds %struct.ggml_tensor, ptr %917, i32 0, i32 3
  %919 = getelementptr inbounds [4 x i64], ptr %918, i64 0, i64 1
  %920 = load i64, ptr %919, align 8, !tbaa !22
  %921 = load ptr, ptr %48, align 8, !tbaa !5
  %922 = getelementptr inbounds %struct.ggml_tensor, ptr %921, i32 0, i32 3
  %923 = getelementptr inbounds [4 x i64], ptr %922, i64 0, i64 2
  %924 = load i64, ptr %923, align 8, !tbaa !22
  %925 = load ptr, ptr %48, align 8, !tbaa !5
  %926 = getelementptr inbounds %struct.ggml_tensor, ptr %925, i32 0, i32 3
  %927 = getelementptr inbounds [4 x i64], ptr %926, i64 0, i64 3
  %928 = load i64, ptr %927, align 8, !tbaa !22
  %929 = load ptr, ptr %48, align 8, !tbaa !5
  %930 = getelementptr inbounds %struct.ggml_tensor, ptr %929, i32 0, i32 3
  %931 = getelementptr inbounds [4 x i64], ptr %930, i64 0, i64 2
  %932 = load i64, ptr %931, align 8, !tbaa !22
  %933 = call ptr @ggml_view_4d(ptr noundef %898, ptr noundef %899, i64 noundef %903, i64 noundef %907, i64 noundef %912, i64 noundef %916, i64 noundef %920, i64 noundef %924, i64 noundef %928, i64 noundef %932)
  store ptr %933, ptr %48, align 8, !tbaa !5
  %934 = load ptr, ptr %12, align 8, !tbaa !5
  %935 = getelementptr inbounds %struct.sam_state, ptr %934, i32 0, i32 3
  %936 = load ptr, ptr %935, align 8, !tbaa !78
  %937 = load ptr, ptr %48, align 8, !tbaa !5
  %938 = load ptr, ptr %12, align 8, !tbaa !5
  %939 = getelementptr inbounds %struct.sam_state, ptr %938, i32 0, i32 1
  %940 = load ptr, ptr %939, align 8, !tbaa !80
  %941 = call ptr @ggml_cpy(ptr noundef %936, ptr noundef %937, ptr noundef %940)
  store ptr %941, ptr %48, align 8, !tbaa !5
  %942 = load ptr, ptr %11, align 8, !tbaa !5
  %943 = load ptr, ptr %48, align 8, !tbaa !5
  call void @ggml_build_forward_expand(ptr noundef %942, ptr noundef %943)
  %944 = load ptr, ptr %11, align 8, !tbaa !5
  %945 = load ptr, ptr %39, align 8, !tbaa !5
  call void @ggml_build_forward_expand(ptr noundef %944, ptr noundef %945)
  %946 = load ptr, ptr %12, align 8, !tbaa !5
  %947 = getelementptr inbounds %struct.sam_state, ptr %946, i32 0, i32 1
  %948 = load ptr, ptr %947, align 8, !tbaa !80
  call void @_ZL31ggml_disconnect_node_from_graphP11ggml_tensor(ptr noundef %948)
  %949 = load ptr, ptr %12, align 8, !tbaa !5
  %950 = getelementptr inbounds %struct.sam_state, ptr %949, i32 0, i32 2
  %951 = load ptr, ptr %950, align 8, !tbaa !79
  call void @_ZL31ggml_disconnect_node_from_graphP11ggml_tensor(ptr noundef %951)
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  ret i1 true
}

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

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

declare ptr @ggml_norm_inplace(ptr noundef, ptr noundef, float noundef) #3

declare ptr @ggml_view_4d(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #3

declare ptr @ggml_conv_transpose_2d_p0(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

declare ptr @ggml_gelu_inplace(ptr noundef, ptr noundef) #3

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

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

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

!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, !6, i64 224}
!12 = !{!"_ZTS16sam_decoder_mask", !13, i64 0, !17, i64 24, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !18, i64 152, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232}
!13 = !{!"_ZTSSt6vectorI25sam_layer_dec_transformerSaIS0_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseI25sam_layer_dec_transformerSaIS0_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseI25sam_layer_dec_transformerSaIS0_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseI25sam_layer_dec_transformerSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTS30sam_layer_dec_transformer_attn", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!18 = !{!"_ZTSSt6vectorI34sam_layer_dec_output_hypernet_mlpsSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseI34sam_layer_dec_output_hypernet_mlpsSaIS0_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI34sam_layer_dec_output_hypernet_mlpsSaIS0_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseI34sam_layer_dec_output_hypernet_mlpsSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!23, !23, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!12, !6, i64 232}
!25 = !{!26, !6, i64 0}
!26 = !{!"_ZTS9sam_state", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !27, i64 32, !27, i64 56, !27, i64 80, !6, i64 104}
!27 = !{!"_ZTSSt6vectorIhSaIhEE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!32, !6, i64 8}
!32 = !{!"_ZTS21prompt_encoder_result", !6, i64 0, !6, i64 8}
!33 = !{!34, !34, i64 0}
!34 = !{!"bool", !7, i64 0}
!35 = !{i8 0, i8 2}
!36 = !{}
!37 = !{!38, !39, i64 48}
!38 = !{!"_ZTS11sam_hparams", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !39, i64 28, !39, i64 32, !39, i64 36, !39, i64 40, !39, i64 44, !39, i64 48}
!39 = !{!"float", !7, i64 0}
!40 = !{!41, !6, i64 64}
!41 = !{!"_ZTS25sam_layer_dec_transformer", !17, i64 0, !6, i64 64, !6, i64 72, !17, i64 80, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !17, i64 224}
!42 = !{!41, !6, i64 72}
!43 = !{!41, !6, i64 144}
!44 = !{!41, !6, i64 152}
!45 = !{!41, !6, i64 160}
!46 = !{!41, !6, i64 168}
!47 = !{!41, !6, i64 176}
!48 = !{!41, !6, i64 184}
!49 = !{!41, !6, i64 192}
!50 = !{!41, !6, i64 200}
!51 = !{!41, !6, i64 208}
!52 = !{!41, !6, i64 216}
!53 = distinct !{!53, !54}
!54 = !{!"llvm.loop.mustprogress"}
!55 = !{!12, !6, i64 88}
!56 = !{!12, !6, i64 96}
!57 = !{!12, !6, i64 104}
!58 = !{!12, !6, i64 112}
!59 = !{!12, !6, i64 120}
!60 = !{!12, !6, i64 128}
!61 = !{!38, !39, i64 44}
!62 = !{!12, !6, i64 136}
!63 = !{!12, !6, i64 144}
!64 = !{!65, !6, i64 0}
!65 = !{!"_ZTS34sam_layer_dec_output_hypernet_mlps", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!66 = !{!65, !6, i64 8}
!67 = !{!65, !6, i64 16}
!68 = !{!65, !6, i64 24}
!69 = !{!65, !6, i64 32}
!70 = !{!65, !6, i64 40}
!71 = distinct !{!71, !54}
!72 = !{!12, !6, i64 176}
!73 = !{!12, !6, i64 184}
!74 = !{!12, !6, i64 192}
!75 = !{!12, !6, i64 200}
!76 = !{!12, !6, i64 208}
!77 = !{!12, !6, i64 216}
!78 = !{!26, !6, i64 24}
!79 = !{!26, !6, i64 16}
!80 = !{!26, !6, i64 8}


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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK11sam_hparams10n_img_embdEv(ptr noundef nonnull align 4 dereferenceable(52)) local_unnamed_addr #0 align 2

declare ptr @ggml_new_tensor_4d(ptr noundef, i32 noundef, i64 noundef, i64 noundef, i64 noundef, i64 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_mul_mat(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare ptr @ggml_transpose(ptr noundef, ptr 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_view_3d(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z17sam_layer_norm_2dP12ggml_contextP11ggml_tensoriS2_S2_f(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, float noundef) local_unnamed_addr #0

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

declare ptr @ggml_add(ptr noundef, ptr noundef, ptr 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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL31ggml_disconnect_node_from_graphP11ggml_tensor(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 #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(496)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z26sam_decode_mask_mlp_relu_3P11ggml_tensorS0_S0_S0_S0_S0_S0_P12ggml_context(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z15sam_decode_maskRK9sam_modelRK21prompt_encoder_resultP11ggml_tensorP12ggml_contextP11ggml_cgraphR9sam_state(ptr noundef nonnull align 8 dereferenceable(496) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(16) %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr nocapture noundef nonnull readonly align 8 dereferenceable(112) %5) local_unnamed_addr #0 {
  %7 = getelementptr inbounds i8, ptr %0, i64 200
  %8 = tail call noundef i32 @_ZNK11sam_hparams10n_img_embdEv(ptr noundef nonnull align 4 dereferenceable(52) %0)
  %9 = getelementptr inbounds i8, ptr %0, i64 424
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  %12 = load i64, ptr %11, align 8, !tbaa !19
  %13 = getelementptr inbounds i8, ptr %10, i64 24
  %14 = load i64, ptr %13, align 8, !tbaa !19
  %15 = getelementptr inbounds i8, ptr %0, i64 432
  %16 = load ptr, ptr %15, align 8, !tbaa !21
  %17 = getelementptr inbounds i8, ptr %16, i64 24
  %18 = load i64, ptr %17, align 8, !tbaa !19
  %19 = add nsw i64 %18, %14
  %20 = load ptr, ptr %1, align 8, !tbaa !22
  %21 = getelementptr inbounds i8, ptr %20, i64 24
  %22 = load i64, ptr %21, align 8, !tbaa !19
  %23 = add nsw i64 %19, %22
  %24 = getelementptr inbounds i8, ptr %20, i64 32
  %25 = load i64, ptr %24, align 8, !tbaa !19
  %26 = tail call ptr @ggml_new_tensor_3d(ptr noundef %3, i32 noundef 0, i64 noundef %12, i64 noundef %23, i64 noundef %25)
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 24
  %29 = load i64, ptr %28, align 8, !tbaa !19
  %30 = getelementptr inbounds i8, ptr %26, i64 56
  %31 = load i64, ptr %30, align 8, !tbaa !19
  %32 = mul i64 %31, %29
  %33 = load ptr, ptr %15, align 8, !tbaa !21
  %34 = getelementptr inbounds i8, ptr %33, i64 24
  %35 = load i64, ptr %34, align 8, !tbaa !19
  %36 = add i64 %35, %29
  %37 = mul i64 %36, %31
  %38 = getelementptr inbounds i8, ptr %26, i64 16
  %39 = load i64, ptr %38, align 8, !tbaa !19
  %40 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef %26, i64 noundef %39, i64 noundef %29, i64 noundef %31, i64 noundef 0)
  %41 = tail call ptr @ggml_cpy(ptr noundef %3, ptr noundef %27, ptr noundef %40)
  tail call void @ggml_build_forward_expand(ptr noundef %4, ptr noundef %41)
  %42 = load ptr, ptr %15, align 8, !tbaa !21
  %43 = load i64, ptr %38, align 8, !tbaa !19
  %44 = getelementptr inbounds i8, ptr %42, i64 24
  %45 = load i64, ptr %44, align 8, !tbaa !19
  %46 = load i64, ptr %30, align 8, !tbaa !19
  %47 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef %26, i64 noundef %43, i64 noundef %45, i64 noundef %46, i64 noundef %32)
  %48 = tail call ptr @ggml_cpy(ptr noundef %3, ptr noundef %42, ptr noundef %47)
  tail call void @ggml_build_forward_expand(ptr noundef %4, ptr noundef %48)
  %49 = load ptr, ptr %1, align 8, !tbaa !22
  %50 = load i64, ptr %38, align 8, !tbaa !19
  %51 = getelementptr inbounds i8, ptr %49, i64 24
  %52 = load i64, ptr %51, align 8, !tbaa !19
  %53 = load i64, ptr %30, align 8, !tbaa !19
  %54 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef %26, i64 noundef %50, i64 noundef %52, i64 noundef %53, i64 noundef %37)
  %55 = tail call ptr @ggml_cpy(ptr noundef %3, ptr noundef %49, ptr noundef %54)
  tail call void @ggml_build_forward_expand(ptr noundef %4, ptr noundef %55)
  %56 = load ptr, ptr %5, align 8, !tbaa !23
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %58 = load i64, ptr %57, align 8, !tbaa !19
  %59 = getelementptr inbounds i8, ptr %56, i64 24
  %60 = load i64, ptr %59, align 8, !tbaa !19
  %61 = getelementptr inbounds i8, ptr %56, i64 32
  %62 = load i64, ptr %61, align 8, !tbaa !19
  %63 = getelementptr inbounds i8, ptr %26, i64 32
  %64 = load i64, ptr %63, align 8, !tbaa !19
  %65 = tail call ptr @ggml_new_tensor_4d(ptr noundef %3, i32 noundef 0, i64 noundef %58, i64 noundef %60, i64 noundef %62, i64 noundef %64)
  %66 = load ptr, ptr %5, align 8, !tbaa !23
  %67 = tail call ptr @ggml_repeat(ptr noundef %3, ptr noundef %66, ptr noundef %65)
  %68 = getelementptr inbounds i8, ptr %1, i64 8
  %69 = load ptr, ptr %68, align 8, !tbaa !29
  %70 = tail call ptr @ggml_add(ptr noundef %3, ptr noundef %67, ptr noundef %69)
  %71 = getelementptr inbounds i8, ptr %70, i64 16
  %72 = load i64, ptr %71, align 8, !tbaa !19
  %73 = getelementptr inbounds i8, ptr %70, i64 24
  %74 = load i64, ptr %73, align 8, !tbaa !19
  %75 = getelementptr inbounds i8, ptr %70, i64 32
  %76 = load i64, ptr %75, align 8, !tbaa !19
  %77 = getelementptr inbounds i8, ptr %70, i64 40
  %78 = load i64, ptr %77, align 8, !tbaa !19
  %79 = mul nsw i64 %74, %72
  %80 = getelementptr inbounds i8, ptr %70, i64 64
  %81 = load i64, ptr %80, align 8, !tbaa !19
  %82 = getelementptr inbounds i8, ptr %70, i64 72
  %83 = load i64, ptr %82, align 8, !tbaa !19
  %84 = tail call ptr @ggml_view_3d(ptr noundef %3, ptr noundef %70, i64 noundef %79, i64 noundef %76, i64 noundef %78, i64 noundef %81, i64 noundef %83, i64 noundef 0)
  %85 = tail call ptr @ggml_permute(ptr noundef %3, ptr noundef %84, i32 noundef 1, i32 noundef 0, i32 noundef 2, i32 noundef 3)
  %86 = tail call ptr @ggml_cont(ptr noundef %3, ptr noundef %85)
  %87 = getelementptr inbounds i8, ptr %2, i64 16
  %88 = load i64, ptr %87, align 8, !tbaa !19
  %89 = getelementptr inbounds i8, ptr %2, i64 24
  %90 = load i64, ptr %89, align 8, !tbaa !19
  %91 = getelementptr inbounds i8, ptr %2, i64 32
  %92 = load i64, ptr %91, align 8, !tbaa !19
  %93 = load i64, ptr %63, align 8, !tbaa !19
  %94 = tail call ptr @ggml_new_tensor_4d(ptr noundef %3, i32 noundef 0, i64 noundef %88, i64 noundef %90, i64 noundef %92, i64 noundef %93)
  %95 = tail call ptr @ggml_repeat(ptr noundef %3, ptr noundef %2, ptr noundef %94)
  %96 = getelementptr inbounds i8, ptr %95, i64 16
  %97 = load i64, ptr %96, align 8, !tbaa !19
  %98 = getelementptr inbounds i8, ptr %95, i64 24
  %99 = load i64, ptr %98, align 8, !tbaa !19
  %100 = mul nsw i64 %99, %97
  %101 = getelementptr inbounds i8, ptr %95, i64 32
  %102 = load i64, ptr %101, align 8, !tbaa !19
  %103 = getelementptr inbounds i8, ptr %95, i64 40
  %104 = load i64, ptr %103, align 8, !tbaa !19
  %105 = getelementptr inbounds i8, ptr %95, i64 64
  %106 = load i64, ptr %105, align 8, !tbaa !19
  %107 = getelementptr inbounds i8, ptr %95, i64 72
  %108 = load i64, ptr %107, align 8, !tbaa !19
  %109 = tail call ptr @ggml_view_3d(ptr noundef %3, ptr noundef %95, i64 noundef %100, i64 noundef %102, i64 noundef %104, i64 noundef %106, i64 noundef %108, i64 noundef 0)
  %110 = tail call ptr @ggml_permute(ptr noundef %3, ptr noundef %109, i32 noundef 1, i32 noundef 0, i32 noundef 2, i32 noundef 3)
  %111 = tail call ptr @ggml_cont(ptr noundef %3, ptr noundef %110)
  %112 = tail call noundef i64 @_ZNKSt6vectorI25sam_layer_dec_transformerSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  %113 = trunc i64 %112 to i32
  %114 = icmp sgt i32 %113, 0
  br i1 %114, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6
  %115 = getelementptr inbounds i8, ptr %0, i64 48
  br label %356

._crit_edge:                                      ; preds = %365, %6
  %.0351.lcssa = phi ptr [ %86, %6 ], [ %421, %365 ]
  %.0350.lcssa = phi ptr [ %26, %6 ], [ %408, %365 ]
  %116 = tail call ptr @ggml_add(ptr noundef %3, ptr noundef %.0350.lcssa, ptr noundef %26)
  %117 = tail call ptr @ggml_add(ptr noundef %3, ptr noundef %.0351.lcssa, ptr noundef %111)
  %118 = getelementptr inbounds i8, ptr %0, i64 224
  %119 = tail call noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64) %118, ptr noundef %116, ptr noundef %117, ptr noundef %.0351.lcssa, ptr noundef %3, ptr noundef nonnull align 8 dereferenceable(496) %0)
  %120 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %.0350.lcssa, ptr noundef %119)
  %121 = getelementptr inbounds i8, ptr %0, i64 48
  %122 = load float, ptr %121, align 8, !tbaa !31
  %123 = tail call ptr @ggml_norm_inplace(ptr noundef %3, ptr noundef %120, float noundef %122)
  %124 = getelementptr inbounds i8, ptr %0, i64 288
  %125 = load ptr, ptr %124, align 8, !tbaa !35
  %126 = tail call ptr @ggml_mul(ptr noundef %3, ptr noundef %123, ptr noundef %125)
  %127 = getelementptr inbounds i8, ptr %0, i64 296
  %128 = load ptr, ptr %127, align 8, !tbaa !36
  %129 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %126, ptr noundef %128)
  %130 = getelementptr inbounds i8, ptr %129, i64 16
  %131 = load i64, ptr %130, align 8, !tbaa !19
  %132 = getelementptr inbounds i8, ptr %129, i64 32
  %133 = load i64, ptr %132, align 8, !tbaa !19
  %134 = getelementptr inbounds i8, ptr %129, i64 64
  %135 = load i64, ptr %134, align 8, !tbaa !19
  %136 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef %129, i64 noundef %131, i64 noundef %133, i64 noundef %135, i64 noundef 0)
  %137 = load i64, ptr %130, align 8, !tbaa !19
  %138 = load i64, ptr %132, align 8, !tbaa !19
  %139 = getelementptr inbounds i8, ptr %129, i64 56
  %140 = load i64, ptr %139, align 8, !tbaa !19
  %141 = shl i64 %140, 2
  %142 = tail call ptr @ggml_view_3d(ptr noundef %3, ptr noundef %129, i64 noundef %137, i64 noundef 4, i64 noundef %138, i64 noundef %140, i64 noundef %141, i64 noundef %140)
  %143 = tail call ptr @ggml_transpose(ptr noundef %3, ptr noundef %.0351.lcssa)
  %144 = tail call ptr @ggml_cont(ptr noundef %3, ptr noundef %143)
  %sext = shl i64 %72, 32
  %145 = ashr exact i64 %sext, 32
  %sext353 = shl i64 %74, 32
  %146 = ashr exact i64 %sext353, 32
  %sext354 = shl i64 %76, 32
  %147 = ashr exact i64 %sext354, 32
  %sext355 = shl i64 %78, 32
  %148 = ashr exact i64 %sext355, 32
  %149 = getelementptr inbounds i8, ptr %144, i64 48
  %150 = load i64, ptr %149, align 8, !tbaa !19
  %151 = mul i64 %150, %145
  %152 = getelementptr inbounds i8, ptr %144, i64 56
  %153 = load i64, ptr %152, align 8, !tbaa !19
  %154 = getelementptr inbounds i8, ptr %144, i64 64
  %155 = load i64, ptr %154, align 8, !tbaa !19
  %156 = tail call ptr @ggml_view_4d(ptr noundef %3, ptr noundef %144, i64 noundef %145, i64 noundef %146, i64 noundef %147, i64 noundef %148, i64 noundef %151, i64 noundef %153, i64 noundef %155, i64 noundef 0)
  %157 = getelementptr inbounds i8, ptr %0, i64 304
  %158 = load ptr, ptr %157, align 8, !tbaa !37
  %159 = tail call ptr @ggml_conv_transpose_2d_p0(ptr noundef %3, ptr noundef %158, ptr noundef %156, i32 noundef 2)
  %160 = getelementptr inbounds i8, ptr %0, i64 312
  %161 = load ptr, ptr %160, align 8, !tbaa !38
  %162 = getelementptr inbounds i8, ptr %161, i64 16
  %163 = load i64, ptr %162, align 8, !tbaa !19
  %164 = tail call ptr @ggml_reshape_3d(ptr noundef %3, ptr noundef %161, i64 noundef 1, i64 noundef 1, i64 noundef %163)
  %165 = tail call ptr @ggml_repeat(ptr noundef %3, ptr noundef %164, ptr noundef %159)
  %166 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %159, ptr noundef %165)
  %167 = getelementptr inbounds i8, ptr %0, i64 320
  %168 = load ptr, ptr %167, align 8, !tbaa !39
  %169 = getelementptr inbounds i8, ptr %0, i64 328
  %170 = load ptr, ptr %169, align 8, !tbaa !40
  %171 = getelementptr inbounds i8, ptr %0, i64 44
  %172 = load float, ptr %171, align 4, !tbaa !41
  %173 = tail call noundef ptr @_Z17sam_layer_norm_2dP12ggml_contextP11ggml_tensoriS2_S2_f(ptr noundef %3, ptr noundef %166, i32 noundef %8, ptr noundef %168, ptr noundef %170, float noundef %172)
  %174 = tail call ptr @ggml_gelu_inplace(ptr noundef %3, ptr noundef %173)
  %175 = getelementptr inbounds i8, ptr %0, i64 336
  %176 = load ptr, ptr %175, align 8, !tbaa !42
  %177 = tail call ptr @ggml_conv_transpose_2d_p0(ptr noundef %3, ptr noundef %176, ptr noundef %174, i32 noundef 2)
  %178 = getelementptr inbounds i8, ptr %0, i64 344
  %179 = load ptr, ptr %178, align 8, !tbaa !43
  %180 = getelementptr inbounds i8, ptr %179, i64 16
  %181 = load i64, ptr %180, align 8, !tbaa !19
  %182 = tail call ptr @ggml_reshape_3d(ptr noundef %3, ptr noundef %179, i64 noundef 1, i64 noundef 1, i64 noundef %181)
  %183 = tail call ptr @ggml_repeat(ptr noundef %3, ptr noundef %182, ptr noundef %177)
  %184 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %183, ptr noundef %177)
  %185 = tail call ptr @ggml_gelu_inplace(ptr noundef %3, ptr noundef %184)
  %186 = getelementptr inbounds i8, ptr %185, i64 16
  %187 = load i64, ptr %186, align 8, !tbaa !19
  %188 = getelementptr inbounds i8, ptr %185, i64 24
  %189 = load i64, ptr %188, align 8, !tbaa !19
  %190 = mul nsw i64 %189, %187
  %191 = getelementptr inbounds i8, ptr %185, i64 32
  %192 = load i64, ptr %191, align 8, !tbaa !19
  %193 = getelementptr inbounds i8, ptr %185, i64 40
  %194 = load i64, ptr %193, align 8, !tbaa !19
  %195 = tail call ptr @ggml_reshape_3d(ptr noundef %3, ptr noundef %185, i64 noundef %190, i64 noundef %192, i64 noundef %194)
  %196 = tail call ptr @ggml_transpose(ptr noundef %3, ptr noundef %195)
  %197 = tail call ptr @ggml_cont(ptr noundef %3, ptr noundef %196)
  %198 = sdiv i32 %8, 2
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds i8, ptr %142, i64 16
  %201 = getelementptr inbounds i8, ptr %142, i64 32
  %202 = load i64, ptr %201, align 8, !tbaa !19
  %203 = tail call ptr @ggml_new_tensor_3d(ptr noundef %3, i32 noundef 0, i64 noundef %199, i64 noundef 4, i64 noundef %202)
  %204 = getelementptr inbounds i8, ptr %0, i64 352
  %205 = getelementptr inbounds i8, ptr %142, i64 56
  %206 = getelementptr inbounds i8, ptr %203, i64 16
  %207 = getelementptr inbounds i8, ptr %203, i64 32
  %208 = getelementptr inbounds i8, ptr %203, i64 56
  %209 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorI34sam_layer_dec_output_hypernet_mlpsSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %204, i64 noundef 0) #3
  %210 = load i64, ptr %200, align 8, !tbaa !19
  %211 = load i64, ptr %201, align 8, !tbaa !19
  %212 = load i64, ptr %205, align 8, !tbaa !19
  %213 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef nonnull %142, i64 noundef %210, i64 noundef %211, i64 noundef %212, i64 noundef 0)
  %214 = load ptr, ptr %209, align 8, !tbaa !44
  %215 = getelementptr inbounds i8, ptr %209, i64 8
  %216 = load ptr, ptr %215, align 8, !tbaa !46
  %217 = getelementptr inbounds i8, ptr %209, i64 16
  %218 = load ptr, ptr %217, align 8, !tbaa !47
  %219 = getelementptr inbounds i8, ptr %209, i64 24
  %220 = load ptr, ptr %219, align 8, !tbaa !48
  %221 = getelementptr inbounds i8, ptr %209, i64 32
  %222 = load ptr, ptr %221, align 8, !tbaa !49
  %223 = getelementptr inbounds i8, ptr %209, i64 40
  %224 = load ptr, ptr %223, align 8, !tbaa !50
  %225 = tail call noundef ptr @_Z26sam_decode_mask_mlp_relu_3P11ggml_tensorS0_S0_S0_S0_S0_S0_P12ggml_context(ptr noundef %213, ptr noundef %214, ptr noundef %216, ptr noundef %218, ptr noundef %220, ptr noundef %222, ptr noundef %224, ptr noundef %3)
  %226 = load i64, ptr %206, align 8, !tbaa !19
  %227 = load i64, ptr %207, align 8, !tbaa !19
  %228 = load i64, ptr %208, align 8, !tbaa !19
  %229 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef %203, i64 noundef %226, i64 noundef %227, i64 noundef %228, i64 noundef 0)
  %230 = tail call ptr @ggml_cpy(ptr noundef %3, ptr noundef %225, ptr noundef %229)
  tail call void @ggml_build_forward_expand(ptr noundef %4, ptr noundef %230)
  %231 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorI34sam_layer_dec_output_hypernet_mlpsSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %204, i64 noundef 1) #3
  %232 = load i64, ptr %200, align 8, !tbaa !19
  %233 = load i64, ptr %201, align 8, !tbaa !19
  %234 = load i64, ptr %205, align 8, !tbaa !19
  %235 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef nonnull %142, i64 noundef %232, i64 noundef %233, i64 noundef %234, i64 noundef %234)
  %236 = load ptr, ptr %231, align 8, !tbaa !44
  %237 = getelementptr inbounds i8, ptr %231, i64 8
  %238 = load ptr, ptr %237, align 8, !tbaa !46
  %239 = getelementptr inbounds i8, ptr %231, i64 16
  %240 = load ptr, ptr %239, align 8, !tbaa !47
  %241 = getelementptr inbounds i8, ptr %231, i64 24
  %242 = load ptr, ptr %241, align 8, !tbaa !48
  %243 = getelementptr inbounds i8, ptr %231, i64 32
  %244 = load ptr, ptr %243, align 8, !tbaa !49
  %245 = getelementptr inbounds i8, ptr %231, i64 40
  %246 = load ptr, ptr %245, align 8, !tbaa !50
  %247 = tail call noundef ptr @_Z26sam_decode_mask_mlp_relu_3P11ggml_tensorS0_S0_S0_S0_S0_S0_P12ggml_context(ptr noundef %235, ptr noundef %236, ptr noundef %238, ptr noundef %240, ptr noundef %242, ptr noundef %244, ptr noundef %246, ptr noundef %3)
  %248 = load i64, ptr %206, align 8, !tbaa !19
  %249 = load i64, ptr %207, align 8, !tbaa !19
  %250 = load i64, ptr %208, align 8, !tbaa !19
  %251 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef %203, i64 noundef %248, i64 noundef %249, i64 noundef %250, i64 noundef %250)
  %252 = tail call ptr @ggml_cpy(ptr noundef %3, ptr noundef %247, ptr noundef %251)
  tail call void @ggml_build_forward_expand(ptr noundef %4, ptr noundef %252)
  %253 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorI34sam_layer_dec_output_hypernet_mlpsSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %204, i64 noundef 2) #3
  %254 = load i64, ptr %200, align 8, !tbaa !19
  %255 = load i64, ptr %201, align 8, !tbaa !19
  %256 = load i64, ptr %205, align 8, !tbaa !19
  %257 = shl i64 %256, 1
  %258 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef nonnull %142, i64 noundef %254, i64 noundef %255, i64 noundef %256, i64 noundef %257)
  %259 = load ptr, ptr %253, align 8, !tbaa !44
  %260 = getelementptr inbounds i8, ptr %253, i64 8
  %261 = load ptr, ptr %260, align 8, !tbaa !46
  %262 = getelementptr inbounds i8, ptr %253, i64 16
  %263 = load ptr, ptr %262, align 8, !tbaa !47
  %264 = getelementptr inbounds i8, ptr %253, i64 24
  %265 = load ptr, ptr %264, align 8, !tbaa !48
  %266 = getelementptr inbounds i8, ptr %253, i64 32
  %267 = load ptr, ptr %266, align 8, !tbaa !49
  %268 = getelementptr inbounds i8, ptr %253, i64 40
  %269 = load ptr, ptr %268, align 8, !tbaa !50
  %270 = tail call noundef ptr @_Z26sam_decode_mask_mlp_relu_3P11ggml_tensorS0_S0_S0_S0_S0_S0_P12ggml_context(ptr noundef %258, ptr noundef %259, ptr noundef %261, ptr noundef %263, ptr noundef %265, ptr noundef %267, ptr noundef %269, ptr noundef %3)
  %271 = load i64, ptr %206, align 8, !tbaa !19
  %272 = load i64, ptr %207, align 8, !tbaa !19
  %273 = load i64, ptr %208, align 8, !tbaa !19
  %274 = shl i64 %273, 1
  %275 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef %203, i64 noundef %271, i64 noundef %272, i64 noundef %273, i64 noundef %274)
  %276 = tail call ptr @ggml_cpy(ptr noundef %3, ptr noundef %270, ptr noundef %275)
  tail call void @ggml_build_forward_expand(ptr noundef %4, ptr noundef %276)
  %277 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorI34sam_layer_dec_output_hypernet_mlpsSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %204, i64 noundef 3) #3
  %278 = load i64, ptr %200, align 8, !tbaa !19
  %279 = load i64, ptr %201, align 8, !tbaa !19
  %280 = load i64, ptr %205, align 8, !tbaa !19
  %281 = mul i64 %280, 3
  %282 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef nonnull %142, i64 noundef %278, i64 noundef %279, i64 noundef %280, i64 noundef %281)
  %283 = load ptr, ptr %277, align 8, !tbaa !44
  %284 = getelementptr inbounds i8, ptr %277, i64 8
  %285 = load ptr, ptr %284, align 8, !tbaa !46
  %286 = getelementptr inbounds i8, ptr %277, i64 16
  %287 = load ptr, ptr %286, align 8, !tbaa !47
  %288 = getelementptr inbounds i8, ptr %277, i64 24
  %289 = load ptr, ptr %288, align 8, !tbaa !48
  %290 = getelementptr inbounds i8, ptr %277, i64 32
  %291 = load ptr, ptr %290, align 8, !tbaa !49
  %292 = getelementptr inbounds i8, ptr %277, i64 40
  %293 = load ptr, ptr %292, align 8, !tbaa !50
  %294 = tail call noundef ptr @_Z26sam_decode_mask_mlp_relu_3P11ggml_tensorS0_S0_S0_S0_S0_S0_P12ggml_context(ptr noundef %282, ptr noundef %283, ptr noundef %285, ptr noundef %287, ptr noundef %289, ptr noundef %291, ptr noundef %293, ptr noundef %3)
  %295 = load i64, ptr %206, align 8, !tbaa !19
  %296 = load i64, ptr %207, align 8, !tbaa !19
  %297 = load i64, ptr %208, align 8, !tbaa !19
  %298 = mul i64 %297, 3
  %299 = tail call ptr @ggml_view_2d(ptr noundef %3, ptr noundef %203, i64 noundef %295, i64 noundef %296, i64 noundef %297, i64 noundef %298)
  %300 = tail call ptr @ggml_cpy(ptr noundef %3, ptr noundef %294, ptr noundef %299)
  tail call void @ggml_build_forward_expand(ptr noundef %4, ptr noundef %300)
  %301 = tail call ptr @ggml_mul_mat(ptr noundef %3, ptr noundef %203, ptr noundef %197)
  %302 = tail call ptr @ggml_transpose(ptr noundef %3, ptr noundef %301)
  %303 = tail call ptr @ggml_cont(ptr noundef %3, ptr noundef %302)
  %304 = load i64, ptr %186, align 8, !tbaa !19
  %305 = load i64, ptr %188, align 8, !tbaa !19
  %306 = getelementptr inbounds i8, ptr %303, i64 24
  %307 = load i64, ptr %306, align 8, !tbaa !19
  %308 = load i64, ptr %193, align 8, !tbaa !19
  %309 = tail call ptr @ggml_reshape_4d(ptr noundef %3, ptr noundef %303, i64 noundef %304, i64 noundef %305, i64 noundef %307, i64 noundef %308)
  %310 = getelementptr inbounds i8, ptr %0, i64 376
  %311 = load ptr, ptr %310, align 8, !tbaa !51
  %312 = getelementptr inbounds i8, ptr %0, i64 384
  %313 = load ptr, ptr %312, align 8, !tbaa !52
  %314 = getelementptr inbounds i8, ptr %0, i64 392
  %315 = load ptr, ptr %314, align 8, !tbaa !53
  %316 = getelementptr inbounds i8, ptr %0, i64 400
  %317 = load ptr, ptr %316, align 8, !tbaa !54
  %318 = getelementptr inbounds i8, ptr %0, i64 408
  %319 = load ptr, ptr %318, align 8, !tbaa !55
  %320 = getelementptr inbounds i8, ptr %0, i64 416
  %321 = load ptr, ptr %320, align 8, !tbaa !56
  %322 = tail call noundef ptr @_Z26sam_decode_mask_mlp_relu_3P11ggml_tensorS0_S0_S0_S0_S0_S0_P12ggml_context(ptr noundef %136, ptr noundef %311, ptr noundef %313, ptr noundef %315, ptr noundef %317, ptr noundef %319, ptr noundef %321, ptr noundef %3)
  %323 = getelementptr inbounds i8, ptr %5, i64 24
  %324 = load ptr, ptr %323, align 8, !tbaa !57
  %325 = getelementptr inbounds i8, ptr %322, i64 16
  %326 = load i64, ptr %325, align 8, !tbaa !19
  %327 = add nsw i64 %326, -1
  %328 = getelementptr inbounds i8, ptr %322, i64 48
  %329 = load i64, ptr %328, align 8, !tbaa !19
  %330 = tail call ptr @ggml_view_1d(ptr noundef %3, ptr noundef %322, i64 noundef %327, i64 noundef %329)
  %331 = getelementptr inbounds i8, ptr %5, i64 16
  %332 = load ptr, ptr %331, align 8, !tbaa !58
  %333 = tail call ptr @ggml_cpy(ptr noundef %324, ptr noundef %330, ptr noundef %332)
  %334 = getelementptr inbounds i8, ptr %309, i64 16
  %335 = load i64, ptr %334, align 8, !tbaa !19
  %336 = getelementptr inbounds i8, ptr %309, i64 24
  %337 = load i64, ptr %336, align 8, !tbaa !19
  %338 = getelementptr inbounds i8, ptr %309, i64 32
  %339 = load i64, ptr %338, align 8, !tbaa !19
  %340 = add nsw i64 %339, -1
  %341 = getelementptr inbounds i8, ptr %309, i64 40
  %342 = load i64, ptr %341, align 8, !tbaa !19
  %343 = getelementptr inbounds i8, ptr %309, i64 56
  %344 = load i64, ptr %343, align 8, !tbaa !19
  %345 = getelementptr inbounds i8, ptr %309, i64 64
  %346 = load i64, ptr %345, align 8, !tbaa !19
  %347 = getelementptr inbounds i8, ptr %309, i64 72
  %348 = load i64, ptr %347, align 8, !tbaa !19
  %349 = tail call ptr @ggml_view_4d(ptr noundef %3, ptr noundef %309, i64 noundef %335, i64 noundef %337, i64 noundef %340, i64 noundef %342, i64 noundef %344, i64 noundef %346, i64 noundef %348, i64 noundef %346)
  %350 = load ptr, ptr %323, align 8, !tbaa !57
  %351 = getelementptr inbounds i8, ptr %5, i64 8
  %352 = load ptr, ptr %351, align 8, !tbaa !59
  %353 = tail call ptr @ggml_cpy(ptr noundef %350, ptr noundef %349, ptr noundef %352)
  tail call void @ggml_build_forward_expand(ptr noundef %4, ptr noundef %353)
  tail call void @ggml_build_forward_expand(ptr noundef %4, ptr noundef %333)
  %354 = load ptr, ptr %351, align 8, !tbaa !59
  tail call void @_ZL31ggml_disconnect_node_from_graphP11ggml_tensor(ptr noundef %354)
  %355 = load ptr, ptr %331, align 8, !tbaa !58
  tail call void @_ZL31ggml_disconnect_node_from_graphP11ggml_tensor(ptr noundef %355)
  ret i1 true

356:                                              ; preds = %.lr.ph, %365
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %365 ]
  %.0350358 = phi ptr [ %26, %.lr.ph ], [ %408, %365 ]
  %.0351357 = phi ptr [ %86, %.lr.ph ], [ %421, %365 ]
  %357 = tail call noundef nonnull align 8 dereferenceable(288) ptr @_ZNKSt6vectorI25sam_layer_dec_transformerSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv) #3
  %358 = icmp eq i64 %indvars.iv, 0
  br i1 %358, label %359, label %361

359:                                              ; preds = %356
  %360 = tail call noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64) %357, ptr noundef %.0350358, ptr noundef %.0350358, ptr noundef %.0350358, ptr noundef %3, ptr noundef nonnull align 8 dereferenceable(496) %0)
  br label %365

361:                                              ; preds = %356
  %362 = tail call ptr @ggml_add(ptr noundef %3, ptr noundef %.0350358, ptr noundef %26)
  %363 = tail call noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64) %357, ptr noundef %362, ptr noundef %362, ptr noundef %.0350358, ptr noundef %3, ptr noundef nonnull align 8 dereferenceable(496) %0)
  %364 = tail call ptr @ggml_add(ptr noundef %3, ptr noundef %.0350358, ptr noundef %363)
  br label %365

365:                                              ; preds = %361, %359
  %.1 = phi ptr [ %360, %359 ], [ %364, %361 ]
  %366 = load float, ptr %115, align 8, !tbaa !31
  %367 = tail call ptr @ggml_norm(ptr noundef %3, ptr noundef %.1, float noundef %366)
  %368 = getelementptr inbounds i8, ptr %357, i64 64
  %369 = load ptr, ptr %368, align 8, !tbaa !60
  %370 = tail call ptr @ggml_mul(ptr noundef %3, ptr noundef %367, ptr noundef %369)
  %371 = getelementptr inbounds i8, ptr %357, i64 72
  %372 = load ptr, ptr %371, align 8, !tbaa !62
  %373 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %370, ptr noundef %372)
  %374 = tail call ptr @ggml_add(ptr noundef %3, ptr noundef %373, ptr noundef %26)
  %375 = tail call ptr @ggml_add(ptr noundef %3, ptr noundef %.0351357, ptr noundef %111)
  %376 = getelementptr inbounds i8, ptr %357, i64 80
  %377 = tail call noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64) %376, ptr noundef %374, ptr noundef %375, ptr noundef %.0351357, ptr noundef %3, ptr noundef nonnull align 8 dereferenceable(496) %0)
  %378 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %373, ptr noundef %377)
  %379 = load float, ptr %115, align 8, !tbaa !31
  %380 = tail call ptr @ggml_norm_inplace(ptr noundef %3, ptr noundef %378, float noundef %379)
  %381 = getelementptr inbounds i8, ptr %357, i64 144
  %382 = load ptr, ptr %381, align 8, !tbaa !63
  %383 = tail call ptr @ggml_mul(ptr noundef %3, ptr noundef %380, ptr noundef %382)
  %384 = getelementptr inbounds i8, ptr %357, i64 152
  %385 = load ptr, ptr %384, align 8, !tbaa !64
  %386 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %383, ptr noundef %385)
  %387 = getelementptr inbounds i8, ptr %357, i64 160
  %388 = load ptr, ptr %387, align 8, !tbaa !65
  %389 = tail call ptr @ggml_mul_mat(ptr noundef %3, ptr noundef %388, ptr noundef %386)
  %390 = getelementptr inbounds i8, ptr %357, i64 168
  %391 = load ptr, ptr %390, align 8, !tbaa !66
  %392 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %389, ptr noundef %391)
  %393 = tail call ptr @ggml_relu_inplace(ptr noundef %3, ptr noundef %392)
  %394 = getelementptr inbounds i8, ptr %357, i64 176
  %395 = load ptr, ptr %394, align 8, !tbaa !67
  %396 = tail call ptr @ggml_mul_mat(ptr noundef %3, ptr noundef %395, ptr noundef %393)
  %397 = getelementptr inbounds i8, ptr %357, i64 184
  %398 = load ptr, ptr %397, align 8, !tbaa !68
  %399 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %396, ptr noundef %398)
  %400 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %386, ptr noundef %399)
  %401 = load float, ptr %115, align 8, !tbaa !31
  %402 = tail call ptr @ggml_norm_inplace(ptr noundef %3, ptr noundef %400, float noundef %401)
  %403 = getelementptr inbounds i8, ptr %357, i64 192
  %404 = load ptr, ptr %403, align 8, !tbaa !69
  %405 = tail call ptr @ggml_mul(ptr noundef %3, ptr noundef %402, ptr noundef %404)
  %406 = getelementptr inbounds i8, ptr %357, i64 200
  %407 = load ptr, ptr %406, align 8, !tbaa !70
  %408 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %405, ptr noundef %407)
  %409 = tail call ptr @ggml_add(ptr noundef %3, ptr noundef %408, ptr noundef %26)
  %410 = tail call ptr @ggml_add(ptr noundef %3, ptr noundef %.0351357, ptr noundef %111)
  %411 = getelementptr inbounds i8, ptr %357, i64 224
  %412 = tail call noundef ptr @_Z32sam_decode_mask_transformer_attnRK30sam_layer_dec_transformer_attnP11ggml_tensorS3_S3_P12ggml_contextRK9sam_model(ptr noundef nonnull align 8 dereferenceable(64) %411, ptr noundef %410, ptr noundef %409, ptr noundef %408, ptr noundef %3, ptr noundef nonnull align 8 dereferenceable(496) %0)
  %413 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %.0351357, ptr noundef %412)
  %414 = load float, ptr %115, align 8, !tbaa !31
  %415 = tail call ptr @ggml_norm_inplace(ptr noundef %3, ptr noundef %413, float noundef %414)
  %416 = getelementptr inbounds i8, ptr %357, i64 208
  %417 = load ptr, ptr %416, align 8, !tbaa !71
  %418 = tail call ptr @ggml_mul(ptr noundef %3, ptr noundef %415, ptr noundef %417)
  %419 = getelementptr inbounds i8, ptr %357, i64 216
  %420 = load ptr, ptr %419, align 8, !tbaa !72
  %421 = tail call ptr @ggml_add_inplace(ptr noundef %3, ptr noundef %418, ptr noundef %420)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %422 = tail call noundef i64 @_ZNKSt6vectorI25sam_layer_dec_transformerSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  %sext366 = shl i64 %422, 32
  %423 = ashr exact i64 %sext366, 32
  %424 = icmp slt i64 %indvars.iv.next, %423
  br i1 %424, label %356, label %._crit_edge, !llvm.loop !73
}

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

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

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

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

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

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

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

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

attributes #0 = { 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 #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 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 #3 = { 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, !11, i64 224}
!6 = !{!"_ZTS16sam_decoder_mask", !7, i64 0, !14, i64 24, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !15, i64 152, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232}
!7 = !{!"_ZTSSt6vectorI25sam_layer_dec_transformerSaIS0_EE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseI25sam_layer_dec_transformerSaIS0_EE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseI25sam_layer_dec_transformerSaIS0_EE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseI25sam_layer_dec_transformerSaIS0_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTS30sam_layer_dec_transformer_attn", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!15 = !{!"_ZTSSt6vectorI34sam_layer_dec_output_hypernet_mlpsSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseI34sam_layer_dec_output_hypernet_mlpsSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI34sam_layer_dec_output_hypernet_mlpsSaIS0_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI34sam_layer_dec_output_hypernet_mlpsSaIS0_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !12, i64 0}
!21 = !{!6, !11, i64 232}
!22 = !{!11, !11, i64 0}
!23 = !{!24, !11, i64 0}
!24 = !{!"_ZTS9sam_state", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !25, i64 32, !25, i64 56, !25, i64 80, !11, i64 104}
!25 = !{!"_ZTSSt6vectorIhSaIhEE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!29 = !{!30, !11, i64 8}
!30 = !{!"_ZTS21prompt_encoder_result", !11, i64 0, !11, i64 8}
!31 = !{!32, !34, i64 48}
!32 = !{!"_ZTS11sam_hparams", !33, i64 0, !33, i64 4, !33, i64 8, !33, i64 12, !33, i64 16, !33, i64 20, !33, i64 24, !34, i64 28, !34, i64 32, !34, i64 36, !34, i64 40, !34, i64 44, !34, i64 48}
!33 = !{!"int", !12, i64 0}
!34 = !{!"float", !12, i64 0}
!35 = !{!6, !11, i64 88}
!36 = !{!6, !11, i64 96}
!37 = !{!6, !11, i64 104}
!38 = !{!6, !11, i64 112}
!39 = !{!6, !11, i64 120}
!40 = !{!6, !11, i64 128}
!41 = !{!32, !34, i64 44}
!42 = !{!6, !11, i64 136}
!43 = !{!6, !11, i64 144}
!44 = !{!45, !11, i64 0}
!45 = !{!"_ZTS34sam_layer_dec_output_hypernet_mlps", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40}
!46 = !{!45, !11, i64 8}
!47 = !{!45, !11, i64 16}
!48 = !{!45, !11, i64 24}
!49 = !{!45, !11, i64 32}
!50 = !{!45, !11, i64 40}
!51 = !{!6, !11, i64 176}
!52 = !{!6, !11, i64 184}
!53 = !{!6, !11, i64 192}
!54 = !{!6, !11, i64 200}
!55 = !{!6, !11, i64 208}
!56 = !{!6, !11, i64 216}
!57 = !{!24, !11, i64 24}
!58 = !{!24, !11, i64 16}
!59 = !{!24, !11, i64 8}
!60 = !{!61, !11, i64 64}
!61 = !{!"_ZTS25sam_layer_dec_transformer", !14, i64 0, !11, i64 64, !11, i64 72, !14, i64 80, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !14, i64 224}
!62 = !{!61, !11, i64 72}
!63 = !{!61, !11, i64 144}
!64 = !{!61, !11, i64 152}
!65 = !{!61, !11, i64 160}
!66 = !{!61, !11, i64 168}
!67 = !{!61, !11, i64 176}
!68 = !{!61, !11, i64 184}
!69 = !{!61, !11, i64 192}
!70 = !{!61, !11, i64 200}
!71 = !{!61, !11, i64 208}
!72 = !{!61, !11, i64 216}
!73 = distinct !{!73, !74}
!74 = !{!"llvm.loop.mustprogress"}


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