; LLVM IR from ggml-org/ggml :: tests/test-timestep_embedding.ll (Z22set_timestep_embeddingP11ggml_tensorS0_ii)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%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] }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z22set_timestep_embeddingP11ggml_tensorS0_ii(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca %"class.std::allocator", align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca float, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %19 = load i32, ptr %7, align 4, !tbaa !9
  %20 = sdiv i32 %19, 2
  store i32 %20, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  %21 = load i32, ptr %9, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  call void @_ZNSaIfEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #6
  invoke void @_ZNSt6vectorIfSaIfEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %22, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %23 unwind label %29

23:                                               ; preds = %4
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %49, %23
  %25 = load i32, ptr %14, align 4, !tbaa !9
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %33, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %56

29:                                               ; preds = %4
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %12, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %13, align 4
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  br label %135

33:                                               ; preds = %24
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = invoke noundef double @_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %34)
          to label %36 unwind label %52

36:                                               ; preds = %33
  %37 = fneg double %35
  %38 = load i32, ptr %14, align 4, !tbaa !9
  %39 = sitofp i32 %38 to double
  %40 = fmul double %37, %39
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = sitofp i32 %41 to double
  %43 = fdiv double %40, %42
  %44 = call double @exp(double noundef %43) #6
  %45 = fptrunc double %44 to float
  %46 = load i32, ptr %14, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %47) #6
  store float %45, ptr %48, align 4, !tbaa !11
  br label %49

49:                                               ; preds = %36
  %50 = load i32, ptr %14, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %14, align 4, !tbaa !9
  br label %24, !llvm.loop !13

52:                                               ; preds = %33
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %12, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %134

56:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %130, %56
  %58 = load i32, ptr %15, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %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 !15
  %64 = icmp slt i64 %59, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %57
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %133

66:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %98, %66
  %68 = load i32, ptr %17, align 4, !tbaa !9
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %105

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = load i32, ptr %15, align 4, !tbaa !9
  %75 = invoke float @ggml_get_f32_1d(ptr noundef %73, i32 noundef %74)
          to label %76 unwind label %101

76:                                               ; preds = %72
  %77 = load i32, ptr %17, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %78) #6
  %80 = load float, ptr %79, align 4, !tbaa !11
  %81 = fmul float %75, %80
  store float %81, ptr %18, align 4, !tbaa !11
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = load float, ptr %18, align 4, !tbaa !11
  %84 = invoke noundef float @_ZSt3cosf(float noundef %83)
          to label %85 unwind label %101

85:                                               ; preds = %76
  %86 = load i32, ptr %17, align 4, !tbaa !9
  %87 = load i32, ptr %15, align 4, !tbaa !9
  invoke void @_Z19ggml_tensor_set_f32P11ggml_tensorfiiii(ptr noundef %82, float noundef %84, i32 noundef %86, i32 noundef %87, i32 noundef 0, i32 noundef 0)
          to label %88 unwind label %101

88:                                               ; preds = %85
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = load float, ptr %18, align 4, !tbaa !11
  %91 = invoke noundef float @_ZSt3sinf(float noundef %90)
          to label %92 unwind label %101

92:                                               ; preds = %88
  %93 = load i32, ptr %17, align 4, !tbaa !9
  %94 = load i32, ptr %9, align 4, !tbaa !9
  %95 = add nsw i32 %93, %94
  %96 = load i32, ptr %15, align 4, !tbaa !9
  invoke void @_Z19ggml_tensor_set_f32P11ggml_tensorfiiii(ptr noundef %89, float noundef %91, i32 noundef %95, i32 noundef %96, i32 noundef 0, i32 noundef 0)
          to label %97 unwind label %101

97:                                               ; preds = %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %17, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %17, align 4, !tbaa !9
  br label %67, !llvm.loop !17

101:                                              ; preds = %92, %88, %85, %76, %72
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %12, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %134

105:                                              ; preds = %71
  %106 = load i32, ptr %7, align 4, !tbaa !9
  %107 = srem i32 %106, 2
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %129

109:                                              ; preds = %105
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ggml_tensor, ptr %110, i32 0, i32 10
  %112 = load ptr, ptr %111, align 8, !tbaa !18
  %113 = load i32, ptr %15, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.ggml_tensor, ptr %115, i32 0, i32 3
  %117 = getelementptr inbounds [4 x i64], ptr %116, i64 0, i64 1
  %118 = load i64, ptr %117, align 8, !tbaa !15
  %119 = mul i64 %114, %118
  %120 = getelementptr inbounds i8, ptr %112, i64 %119
  %121 = load i32, ptr %7, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.ggml_tensor, ptr %123, i32 0, i32 3
  %125 = getelementptr inbounds [4 x i64], ptr %124, i64 0, i64 0
  %126 = load i64, ptr %125, align 8, !tbaa !15
  %127 = mul i64 %122, %126
  %128 = getelementptr inbounds i8, ptr %120, i64 %127
  store float 0.000000e+00, ptr %128, align 4, !tbaa !11
  br label %129

129:                                              ; preds = %109, %105
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %15, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %15, align 4, !tbaa !9
  br label %57, !llvm.loop !22

133:                                              ; preds = %65
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret void

134:                                              ; preds = %101, %52
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  br label %135

135:                                              ; preds = %134, %29
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %136

136:                                              ; preds = %135
  %137 = load ptr, ptr %12, align 8
  %138 = load i32, ptr %13, align 4
  %139 = insertvalue { ptr, i32 } poison, ptr %137, 0
  %140 = insertvalue { ptr, i32 } %139, i32 %138, 1
  resume { ptr, i32 } %140
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare double @exp(double noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #4

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

declare float @ggml_get_f32_1d(ptr noundef, i32 noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) #4

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

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

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

!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, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = distinct !{!17, !14}
!18 = !{!19, !6, i64 248}
!19 = !{!"_ZTS11ggml_tensor", !20, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !21, i64 80, !7, i64 84, !10, i64 148, !7, i64 152, !6, i64 232, !16, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}
!20 = !{!"_ZTS9ggml_type", !7, i64 0}
!21 = !{!"_ZTS7ggml_op", !7, i64 0}
!22 = distinct !{!22, !14}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z22set_timestep_embeddingP11ggml_tensorS0_ii(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = sdiv i32 %2, 2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  %8 = sext i32 %7 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIfEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt6vectorIfSaIfEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %8, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %9 unwind label %65

9:                                                ; preds = %4
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %10 = icmp sgt i32 %2, 1
  br i1 %10, label %.lr.ph, label %.preheader41.thread

.lr.ph:                                           ; preds = %9
  %11 = sitofp i32 %7 to double
  %wide.trip.count = zext nneg i32 %7 to i64
  br label %67

.preheader41:                                     ; preds = %67
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = load i64, ptr %12, align 8, !tbaa !5
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.preheader.lr.ph, label %._crit_edge46

.preheader41.thread:                              ; preds = %9
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load i64, ptr %15, align 8, !tbaa !5
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.preheader.lr.ph.thread, label %._crit_edge46

.preheader.lr.ph.thread:                          ; preds = %.preheader41.thread
  %18 = and i32 %2, 1
  %.not67 = icmp eq i32 %18, 0
  %19 = getelementptr inbounds i8, ptr %1, i64 248
  %20 = getelementptr inbounds i8, ptr %1, i64 48
  %21 = getelementptr inbounds i8, ptr %1, i64 56
  %22 = sext i32 %2 to i64
  br i1 %.not67, label %._crit_edge46, label %.preheader.lr.ph.split.split

.preheader.lr.ph:                                 ; preds = %.preheader41
  %23 = and i32 %2, 1
  %.not = icmp eq i32 %23, 0
  %24 = getelementptr inbounds i8, ptr %1, i64 248
  %25 = getelementptr inbounds i8, ptr %1, i64 48
  %26 = getelementptr inbounds i8, ptr %1, i64 56
  %27 = zext nneg i32 %2 to i64
  br i1 %10, label %.preheader.us.preheader, label %.preheader.lr.ph.split

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %28 = zext nneg i32 %7 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %38
  %indvars.iv64 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next65, %38 ]
  %29 = trunc nuw nsw i64 %indvars.iv64 to i32
  br label %41

30:                                               ; preds = %._crit_edge.us
  %31 = load ptr, ptr %24, align 8, !tbaa !9
  %32 = load i64, ptr %26, align 8, !tbaa !5
  %33 = mul i64 %32, %indvars.iv64
  %34 = getelementptr inbounds i8, ptr %31, i64 %33
  %35 = load i64, ptr %25, align 8, !tbaa !5
  %36 = mul i64 %35, %27
  %37 = getelementptr inbounds i8, ptr %34, i64 %36
  store float 0.000000e+00, ptr %37, align 4, !tbaa !15
  br label %38

38:                                               ; preds = %30, %._crit_edge.us
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %39 = load i64, ptr %12, align 8, !tbaa !5
  %40 = icmp sgt i64 %39, %indvars.iv.next65
  br i1 %40, label %.preheader.us, label %._crit_edge46, !llvm.loop !17

41:                                               ; preds = %.preheader.us, %53
  %indvars.iv59 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next60, %53 ]
  %42 = invoke float @ggml_get_f32_1d(ptr noundef %0, i32 noundef %29)
          to label %43 unwind label %.split.us

43:                                               ; preds = %41
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv59) #6
  %45 = load float, ptr %44, align 4, !tbaa !15
  %46 = fmul float %42, %45
  %47 = call noundef float @_ZSt3cosf(float noundef %46)
  %48 = trunc nuw nsw i64 %indvars.iv59 to i32
  invoke void @_Z19ggml_tensor_set_f32P11ggml_tensorfiiii(ptr noundef %1, float noundef %47, i32 noundef %48, i32 noundef %29, i32 noundef 0, i32 noundef 0)
          to label %49 unwind label %.split.us

49:                                               ; preds = %43
  %50 = call noundef float @_ZSt3sinf(float noundef %46)
  %51 = trunc i64 %indvars.iv59 to i32
  %52 = add i32 %7, %51
  invoke void @_Z19ggml_tensor_set_f32P11ggml_tensorfiiii(ptr noundef %1, float noundef %50, i32 noundef %52, i32 noundef %29, i32 noundef 0, i32 noundef 0)
          to label %53 unwind label %.split.us

53:                                               ; preds = %49
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond63.not = icmp eq i64 %indvars.iv.next60, %28
  br i1 %exitcond63.not, label %._crit_edge.us, label %41, !llvm.loop !19

._crit_edge.us:                                   ; preds = %53
  br i1 %.not, label %38, label %30

.split.us:                                        ; preds = %49, %43, %41
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %82

.preheader.lr.ph.split:                           ; preds = %.preheader.lr.ph
  br i1 %.not, label %._crit_edge46, label %.preheader.lr.ph.split.split

.preheader.lr.ph.split.split:                     ; preds = %.preheader.lr.ph.thread, %.preheader.lr.ph.split
  %55 = phi i64 [ %16, %.preheader.lr.ph.thread ], [ %13, %.preheader.lr.ph.split ]
  %56 = phi ptr [ %19, %.preheader.lr.ph.thread ], [ %24, %.preheader.lr.ph.split ]
  %57 = phi ptr [ %20, %.preheader.lr.ph.thread ], [ %25, %.preheader.lr.ph.split ]
  %58 = phi ptr [ %21, %.preheader.lr.ph.thread ], [ %26, %.preheader.lr.ph.split ]
  %59 = phi i64 [ %22, %.preheader.lr.ph.thread ], [ %27, %.preheader.lr.ph.split ]
  %60 = load ptr, ptr %56, align 8, !tbaa !9
  %61 = load i64, ptr %58, align 8, !tbaa !5
  %62 = load i64, ptr %57, align 8, !tbaa !5
  %63 = mul i64 %62, %59
  %invariant.gep = getelementptr i8, ptr %60, i64 %63
  %xtraiter = and i64 %55, 3
  %64 = icmp ult i64 %55, 4
  br i1 %64, label %._crit_edge46.loopexit71.unr-lcssa, label %.preheader.lr.ph.split.split.new

.preheader.lr.ph.split.split.new:                 ; preds = %.preheader.lr.ph.split.split
  %unroll_iter = and i64 %55, 9223372036854775804
  br label %.preheader

65:                                               ; preds = %4
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  br label %82

67:                                               ; preds = %.lr.ph, %67
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %67 ]
  %68 = call noundef double @_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %3)
  %69 = fneg double %68
  %70 = trunc nuw nsw i64 %indvars.iv to i32
  %71 = uitofp nneg i32 %70 to double
  %72 = fmul double %71, %69
  %73 = fdiv double %72, %11
  %74 = call double @exp(double noundef %73) #6
  %75 = fptrunc double %74 to float
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #6
  store float %75, ptr %76, align 4, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader41, label %67, !llvm.loop !20

.preheader:                                       ; preds = %.preheader, %.preheader.lr.ph.split.split.new
  %indvars.iv52 = phi i64 [ 0, %.preheader.lr.ph.split.split.new ], [ %indvars.iv.next53.3, %.preheader ]
  %niter = phi i64 [ 0, %.preheader.lr.ph.split.split.new ], [ %niter.next.3, %.preheader ]
  %77 = mul i64 %61, %indvars.iv52
  %gep = getelementptr i8, ptr %invariant.gep, i64 %77
  store float 0.000000e+00, ptr %gep, align 4, !tbaa !15
  %indvars.iv.next53 = or disjoint i64 %indvars.iv52, 1
  %78 = mul i64 %61, %indvars.iv.next53
  %gep.1 = getelementptr i8, ptr %invariant.gep, i64 %78
  store float 0.000000e+00, ptr %gep.1, align 4, !tbaa !15
  %indvars.iv.next53.1 = or disjoint i64 %indvars.iv52, 2
  %79 = mul i64 %61, %indvars.iv.next53.1
  %gep.2 = getelementptr i8, ptr %invariant.gep, i64 %79
  store float 0.000000e+00, ptr %gep.2, align 4, !tbaa !15
  %indvars.iv.next53.2 = or disjoint i64 %indvars.iv52, 3
  %80 = mul i64 %61, %indvars.iv.next53.2
  %gep.3 = getelementptr i8, ptr %invariant.gep, i64 %80
  store float 0.000000e+00, ptr %gep.3, align 4, !tbaa !15
  %indvars.iv.next53.3 = add nuw nsw i64 %indvars.iv52, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge46.loopexit71.unr-lcssa, label %.preheader, !llvm.loop !17

._crit_edge46.loopexit71.unr-lcssa:               ; preds = %.preheader, %.preheader.lr.ph.split.split
  %indvars.iv52.unr = phi i64 [ 0, %.preheader.lr.ph.split.split ], [ %indvars.iv.next53.3, %.preheader ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge46, label %.preheader.epil

.preheader.epil:                                  ; preds = %._crit_edge46.loopexit71.unr-lcssa, %.preheader.epil
  %indvars.iv52.epil = phi i64 [ %indvars.iv.next53.epil, %.preheader.epil ], [ %indvars.iv52.unr, %._crit_edge46.loopexit71.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader.epil ], [ 0, %._crit_edge46.loopexit71.unr-lcssa ]
  %81 = mul i64 %61, %indvars.iv52.epil
  %gep.epil = getelementptr i8, ptr %invariant.gep, i64 %81
  store float 0.000000e+00, ptr %gep.epil, align 4, !tbaa !15
  %indvars.iv.next53.epil = add nuw nsw i64 %indvars.iv52.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge46, label %.preheader.epil, !llvm.loop !21

._crit_edge46:                                    ; preds = %._crit_edge46.loopexit71.unr-lcssa, %.preheader.epil, %38, %.preheader.lr.ph.split, %.preheader.lr.ph.thread, %.preheader41.thread, %.preheader41
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  ret void

82:                                               ; preds = %.split.us, %65
  %.pn = phi { ptr, i32 } [ %54, %.split.us ], [ %66, %65 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #4

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

declare float @ggml_get_f32_1d(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) local_unnamed_addr #4

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

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

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

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 248}
!10 = !{!"_ZTS11ggml_tensor", !11, i64 0, !12, i64 8, !7, i64 16, !7, i64 48, !13, i64 80, !7, i64 84, !14, i64 148, !7, i64 152, !12, i64 232, !6, i64 240, !12, i64 248, !7, i64 256, !12, i64 320, !7, i64 328}
!11 = !{!"_ZTS9ggml_type", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_ZTS7ggml_op", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}


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