; LLVM IR from sbu-fsl/kernel-ml :: src/math (math)

; 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.matrix = type { i32, i32, i32, %union.anon }
%union.anon = type { ptr }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [67 x i8], align 1
@__PRETTY_FUNCTION__.softmax = external hidden unnamed_addr constant [26 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local float @exp_hybrid(float noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local double @exp_hybrid_d(double noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @softmax(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.matrix, ptr %6, i32 0, i32 0
  %8 = load i32, ptr %7, align 8, !tbaa !9
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.matrix, ptr %9, i32 0, i32 1
  %11 = load i32, ptr %10, align 4, !tbaa !12
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.matrix, ptr %12, i32 0, i32 2
  %14 = load i32, ptr %13, align 8, !tbaa !13
  %15 = call ptr @allocate_matrix(i32 noundef %8, i32 noundef %11, i32 noundef %14)
  store ptr %15, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store double 0.000000e+00, ptr %5, align 8, !tbaa !14
  store i32 0, ptr %3, align 4, !tbaa !16
  br label %16

16:                                               ; preds = %77, %1
  %17 = load i32, ptr %3, align 4, !tbaa !16
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.matrix, ptr %18, i32 0, i32 1
  %20 = load i32, ptr %19, align 4, !tbaa !12
  %21 = icmp slt i32 %17, %20
  br i1 %21, label %22, label %80

22:                                               ; preds = %16
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.matrix, ptr %23, i32 0, i32 2
  %25 = load i32, ptr %24, align 8, !tbaa !13
  switch i32 %25, label %76 [
    i32 1, label %26
    i32 2, label %51
    i32 0, label %75
  ]

26:                                               ; preds = %22
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.matrix, ptr %27, i32 0, i32 3
  %29 = load ptr, ptr %28, align 8, !tbaa !17
  %30 = load i32, ptr %3, align 4, !tbaa !16
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds float, ptr %29, i64 %31
  %33 = load float, ptr %32, align 4, !tbaa !18
  %34 = call float @exp_hybrid(float noundef %33)
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.matrix, ptr %35, i32 0, i32 3
  %37 = load ptr, ptr %36, align 8, !tbaa !17
  %38 = load i32, ptr %3, align 4, !tbaa !16
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds float, ptr %37, i64 %39
  store float %34, ptr %40, align 4, !tbaa !18
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.matrix, ptr %41, i32 0, i32 3
  %43 = load ptr, ptr %42, align 8, !tbaa !17
  %44 = load i32, ptr %3, align 4, !tbaa !16
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds float, ptr %43, i64 %45
  %47 = load float, ptr %46, align 4, !tbaa !18
  %48 = fpext float %47 to double
  %49 = load double, ptr %5, align 8, !tbaa !14
  %50 = fadd double %49, %48
  store double %50, ptr %5, align 8, !tbaa !14
  br label %76

51:                                               ; preds = %22
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.matrix, ptr %52, i32 0, i32 3
  %54 = load ptr, ptr %53, align 8, !tbaa !17
  %55 = load i32, ptr %3, align 4, !tbaa !16
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds double, ptr %54, i64 %56
  %58 = load double, ptr %57, align 8, !tbaa !14
  %59 = call double @exp_hybrid_d(double noundef %58)
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.matrix, ptr %60, i32 0, i32 3
  %62 = load ptr, ptr %61, align 8, !tbaa !17
  %63 = load i32, ptr %3, align 4, !tbaa !16
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds double, ptr %62, i64 %64
  store double %59, ptr %65, align 8, !tbaa !14
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.matrix, ptr %66, i32 0, i32 3
  %68 = load ptr, ptr %67, align 8, !tbaa !17
  %69 = load i32, ptr %3, align 4, !tbaa !16
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds double, ptr %68, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !14
  %73 = load double, ptr %5, align 8, !tbaa !14
  %74 = fadd double %73, %72
  store double %74, ptr %5, align 8, !tbaa !14
  br label %76

75:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 222, ptr noundef @__PRETTY_FUNCTION__.softmax) #5
  unreachable

76:                                               ; preds = %51, %26, %22
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %3, align 4, !tbaa !16
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %3, align 4, !tbaa !16
  br label %16, !llvm.loop !20

80:                                               ; preds = %16
  store i32 0, ptr %3, align 4, !tbaa !16
  br label %81

81:                                               ; preds = %126, %80
  %82 = load i32, ptr %3, align 4, !tbaa !16
  %83 = load ptr, ptr %2, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.matrix, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !12
  %86 = icmp slt i32 %82, %85
  br i1 %86, label %87, label %129

87:                                               ; preds = %81
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.matrix, ptr %88, i32 0, i32 2
  %90 = load i32, ptr %89, align 8, !tbaa !13
  switch i32 %90, label %125 [
    i32 1, label %91
    i32 2, label %108
    i32 0, label %124
  ]

91:                                               ; preds = %87
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.matrix, ptr %92, i32 0, i32 3
  %94 = load ptr, ptr %93, align 8, !tbaa !17
  %95 = load i32, ptr %3, align 4, !tbaa !16
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds float, ptr %94, i64 %96
  %98 = load float, ptr %97, align 4, !tbaa !18
  %99 = load double, ptr %5, align 8, !tbaa !14
  %100 = fptrunc double %99 to float
  %101 = fdiv float %98, %100
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.matrix, ptr %102, i32 0, i32 3
  %104 = load ptr, ptr %103, align 8, !tbaa !17
  %105 = load i32, ptr %3, align 4, !tbaa !16
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds float, ptr %104, i64 %106
  store float %101, ptr %107, align 4, !tbaa !18
  br label %125

108:                                              ; preds = %87
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.matrix, ptr %109, i32 0, i32 3
  %111 = load ptr, ptr %110, align 8, !tbaa !17
  %112 = load i32, ptr %3, align 4, !tbaa !16
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds double, ptr %111, i64 %113
  %115 = load double, ptr %114, align 8, !tbaa !14
  %116 = load double, ptr %5, align 8, !tbaa !14
  %117 = fdiv double %115, %116
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.matrix, ptr %118, i32 0, i32 3
  %120 = load ptr, ptr %119, align 8, !tbaa !17
  %121 = load i32, ptr %3, align 4, !tbaa !16
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds double, ptr %120, i64 %122
  store double %117, ptr %123, align 8, !tbaa !14
  br label %125

124:                                              ; preds = %87
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 238, ptr noundef @__PRETTY_FUNCTION__.softmax) #5
  unreachable

125:                                              ; preds = %108, %91, %87
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %3, align 4, !tbaa !16
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %3, align 4, !tbaa !16
  br label %81, !llvm.loop !22

129:                                              ; preds = %81
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret ptr %130
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { noreturn 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 = { nounwind }
attributes #5 = { noreturn 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/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"matrix", !11, i64 0, !11, i64 4, !11, i64 8, !7, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!10, !11, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!11, !11, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [67 x i8], align 1
@__PRETTY_FUNCTION__.softmax = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local float @exp_hybrid(float noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local double @exp_hybrid_d(double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @softmax(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = load i32, ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 4
  %4 = load i32, ptr %3, align 4, !tbaa !10
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load i32, ptr %5, align 8, !tbaa !11
  %7 = tail call ptr @allocate_matrix(i32 noundef %2, i32 noundef %4, i32 noundef %6) #3
  %8 = load i32, ptr %3, align 4, !tbaa !10
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = getelementptr inbounds i8, ptr %7, i64 16
  br label %50

.preheader:                                       ; preds = %76
  %12 = icmp sgt i32 %77, 0
  br i1 %12, label %.lr.ph43, label %._crit_edge

.lr.ph43:                                         ; preds = %.preheader
  %13 = load i32, ptr %5, align 8, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %7, i64 16
  %15 = fptrunc double %.1 to float
  switch i32 %13, label %._crit_edge [
    i32 0, label %80
    i32 1, label %.lr.ph43.split.split.us.preheader
    i32 2, label %.lr.ph43.split.split.us44.preheader
  ]

.lr.ph43.split.split.us44.preheader:              ; preds = %.lr.ph43
  %wide.trip.count = zext nneg i32 %77 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %16 = icmp ult i32 %77, 4
  br i1 %16, label %._crit_edge.loopexit62.unr-lcssa, label %.lr.ph43.split.split.us44.preheader.new

.lr.ph43.split.split.us44.preheader.new:          ; preds = %.lr.ph43.split.split.us44.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph43.split.split.us44

.lr.ph43.split.split.us.preheader:                ; preds = %.lr.ph43
  %wide.trip.count56 = zext nneg i32 %77 to i64
  %xtraiter63 = and i64 %wide.trip.count56, 3
  %17 = icmp ult i32 %77, 4
  br i1 %17, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph43.split.split.us.preheader.new

.lr.ph43.split.split.us.preheader.new:            ; preds = %.lr.ph43.split.split.us.preheader
  %unroll_iter66 = and i64 %wide.trip.count56, 2147483644
  br label %.lr.ph43.split.split.us

.lr.ph43.split.split.us:                          ; preds = %.lr.ph43.split.split.us, %.lr.ph43.split.split.us.preheader.new
  %indvars.iv53 = phi i64 [ 0, %.lr.ph43.split.split.us.preheader.new ], [ %indvars.iv.next54.3, %.lr.ph43.split.split.us ]
  %niter67 = phi i64 [ 0, %.lr.ph43.split.split.us.preheader.new ], [ %niter67.next.3, %.lr.ph43.split.split.us ]
  %18 = load ptr, ptr %14, align 8, !tbaa !12
  %19 = getelementptr inbounds float, ptr %18, i64 %indvars.iv53
  %20 = load float, ptr %19, align 4, !tbaa !13
  %21 = fdiv float %20, %15
  store float %21, ptr %19, align 4, !tbaa !13
  %indvars.iv.next54 = or disjoint i64 %indvars.iv53, 1
  %22 = load ptr, ptr %14, align 8, !tbaa !12
  %23 = getelementptr inbounds float, ptr %22, i64 %indvars.iv.next54
  %24 = load float, ptr %23, align 4, !tbaa !13
  %25 = fdiv float %24, %15
  store float %25, ptr %23, align 4, !tbaa !13
  %indvars.iv.next54.1 = or disjoint i64 %indvars.iv53, 2
  %26 = load ptr, ptr %14, align 8, !tbaa !12
  %27 = getelementptr inbounds float, ptr %26, i64 %indvars.iv.next54.1
  %28 = load float, ptr %27, align 4, !tbaa !13
  %29 = fdiv float %28, %15
  store float %29, ptr %27, align 4, !tbaa !13
  %indvars.iv.next54.2 = or disjoint i64 %indvars.iv53, 3
  %30 = load ptr, ptr %14, align 8, !tbaa !12
  %31 = getelementptr inbounds float, ptr %30, i64 %indvars.iv.next54.2
  %32 = load float, ptr %31, align 4, !tbaa !13
  %33 = fdiv float %32, %15
  store float %33, ptr %31, align 4, !tbaa !13
  %indvars.iv.next54.3 = add nuw nsw i64 %indvars.iv53, 4
  %niter67.next.3 = add i64 %niter67, 4
  %niter67.ncmp.3 = icmp eq i64 %niter67.next.3, %unroll_iter66
  br i1 %niter67.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph43.split.split.us, !llvm.loop !15

.lr.ph43.split.split.us44:                        ; preds = %.lr.ph43.split.split.us44, %.lr.ph43.split.split.us44.preheader.new
  %indvars.iv50 = phi i64 [ 0, %.lr.ph43.split.split.us44.preheader.new ], [ %indvars.iv.next51.3, %.lr.ph43.split.split.us44 ]
  %niter = phi i64 [ 0, %.lr.ph43.split.split.us44.preheader.new ], [ %niter.next.3, %.lr.ph43.split.split.us44 ]
  %34 = load ptr, ptr %14, align 8, !tbaa !12
  %35 = getelementptr inbounds double, ptr %34, i64 %indvars.iv50
  %36 = load double, ptr %35, align 8, !tbaa !17
  %37 = fdiv double %36, %.1
  store double %37, ptr %35, align 8, !tbaa !17
  %indvars.iv.next51 = or disjoint i64 %indvars.iv50, 1
  %38 = load ptr, ptr %14, align 8, !tbaa !12
  %39 = getelementptr inbounds double, ptr %38, i64 %indvars.iv.next51
  %40 = load double, ptr %39, align 8, !tbaa !17
  %41 = fdiv double %40, %.1
  store double %41, ptr %39, align 8, !tbaa !17
  %indvars.iv.next51.1 = or disjoint i64 %indvars.iv50, 2
  %42 = load ptr, ptr %14, align 8, !tbaa !12
  %43 = getelementptr inbounds double, ptr %42, i64 %indvars.iv.next51.1
  %44 = load double, ptr %43, align 8, !tbaa !17
  %45 = fdiv double %44, %.1
  store double %45, ptr %43, align 8, !tbaa !17
  %indvars.iv.next51.2 = or disjoint i64 %indvars.iv50, 3
  %46 = load ptr, ptr %14, align 8, !tbaa !12
  %47 = getelementptr inbounds double, ptr %46, i64 %indvars.iv.next51.2
  %48 = load double, ptr %47, align 8, !tbaa !17
  %49 = fdiv double %48, %.1
  store double %49, ptr %47, align 8, !tbaa !17
  %indvars.iv.next51.3 = add nuw nsw i64 %indvars.iv50, 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_edge.loopexit62.unr-lcssa, label %.lr.ph43.split.split.us44, !llvm.loop !15

50:                                               ; preds = %.lr.ph, %76
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %76 ]
  %.040 = phi double [ 0.000000e+00, %.lr.ph ], [ %.1, %76 ]
  %51 = load i32, ptr %5, align 8, !tbaa !11
  switch i32 %51, label %76 [
    i32 1, label %52
    i32 2, label %64
    i32 0, label %75
  ]

52:                                               ; preds = %50
  %53 = load ptr, ptr %10, align 8, !tbaa !12
  %54 = getelementptr inbounds float, ptr %53, i64 %indvars.iv
  %55 = load float, ptr %54, align 4, !tbaa !13
  %56 = tail call float @exp_hybrid(float noundef %55)
  %57 = load ptr, ptr %11, align 8, !tbaa !12
  %58 = getelementptr inbounds float, ptr %57, i64 %indvars.iv
  store float %56, ptr %58, align 4, !tbaa !13
  %59 = load ptr, ptr %11, align 8, !tbaa !12
  %60 = getelementptr inbounds float, ptr %59, i64 %indvars.iv
  %61 = load float, ptr %60, align 4, !tbaa !13
  %62 = fpext float %61 to double
  %63 = fadd double %.040, %62
  br label %76

64:                                               ; preds = %50
  %65 = load ptr, ptr %10, align 8, !tbaa !12
  %66 = getelementptr inbounds double, ptr %65, i64 %indvars.iv
  %67 = load double, ptr %66, align 8, !tbaa !17
  %68 = tail call double @exp_hybrid_d(double noundef %67)
  %69 = load ptr, ptr %11, align 8, !tbaa !12
  %70 = getelementptr inbounds double, ptr %69, i64 %indvars.iv
  store double %68, ptr %70, align 8, !tbaa !17
  %71 = load ptr, ptr %11, align 8, !tbaa !12
  %72 = getelementptr inbounds double, ptr %71, i64 %indvars.iv
  %73 = load double, ptr %72, align 8, !tbaa !17
  %74 = fadd double %.040, %73
  br label %76

75:                                               ; preds = %50
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 222, ptr noundef nonnull @__PRETTY_FUNCTION__.softmax) #4
  unreachable

76:                                               ; preds = %50, %52, %64
  %.1 = phi double [ %.040, %50 ], [ %74, %64 ], [ %63, %52 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %77 = load i32, ptr %3, align 4, !tbaa !10
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next, %78
  br i1 %79, label %50, label %.preheader, !llvm.loop !19

80:                                               ; preds = %.lr.ph43
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 238, ptr noundef nonnull @__PRETTY_FUNCTION__.softmax) #4
  unreachable

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph43.split.split.us, %.lr.ph43.split.split.us.preheader
  %indvars.iv53.unr = phi i64 [ 0, %.lr.ph43.split.split.us.preheader ], [ %indvars.iv.next54.3, %.lr.ph43.split.split.us ]
  %lcmp.mod65.not = icmp eq i64 %xtraiter63, 0
  br i1 %lcmp.mod65.not, label %._crit_edge, label %.lr.ph43.split.split.us.epil

.lr.ph43.split.split.us.epil:                     ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph43.split.split.us.epil
  %indvars.iv53.epil = phi i64 [ %indvars.iv.next54.epil, %.lr.ph43.split.split.us.epil ], [ %indvars.iv53.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter64 = phi i64 [ %epil.iter64.next, %.lr.ph43.split.split.us.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %81 = load ptr, ptr %14, align 8, !tbaa !12
  %82 = getelementptr inbounds float, ptr %81, i64 %indvars.iv53.epil
  %83 = load float, ptr %82, align 4, !tbaa !13
  %84 = fdiv float %83, %15
  store float %84, ptr %82, align 4, !tbaa !13
  %indvars.iv.next54.epil = add nuw nsw i64 %indvars.iv53.epil, 1
  %epil.iter64.next = add i64 %epil.iter64, 1
  %epil.iter64.cmp.not = icmp eq i64 %epil.iter64.next, %xtraiter63
  br i1 %epil.iter64.cmp.not, label %._crit_edge, label %.lr.ph43.split.split.us.epil, !llvm.loop !20

._crit_edge.loopexit62.unr-lcssa:                 ; preds = %.lr.ph43.split.split.us44, %.lr.ph43.split.split.us44.preheader
  %indvars.iv50.unr = phi i64 [ 0, %.lr.ph43.split.split.us44.preheader ], [ %indvars.iv.next51.3, %.lr.ph43.split.split.us44 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph43.split.split.us44.epil

.lr.ph43.split.split.us44.epil:                   ; preds = %._crit_edge.loopexit62.unr-lcssa, %.lr.ph43.split.split.us44.epil
  %indvars.iv50.epil = phi i64 [ %indvars.iv.next51.epil, %.lr.ph43.split.split.us44.epil ], [ %indvars.iv50.unr, %._crit_edge.loopexit62.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph43.split.split.us44.epil ], [ 0, %._crit_edge.loopexit62.unr-lcssa ]
  %85 = load ptr, ptr %14, align 8, !tbaa !12
  %86 = getelementptr inbounds double, ptr %85, i64 %indvars.iv50.epil
  %87 = load double, ptr %86, align 8, !tbaa !17
  %88 = fdiv double %87, %.1
  store double %88, ptr %86, align 8, !tbaa !17
  %indvars.iv.next51.epil = add nuw nsw i64 %indvars.iv50.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_edge, label %.lr.ph43.split.split.us44.epil, !llvm.loop !22

._crit_edge:                                      ; preds = %._crit_edge.loopexit62.unr-lcssa, %.lr.ph43.split.split.us44.epil, %._crit_edge.loopexit.unr-lcssa, %.lr.ph43.split.split.us.epil, %1, %.lr.ph43, %.preheader
  ret ptr %7
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #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 = { noreturn 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 #3 = { nounwind }
attributes #4 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"matrix", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!6, !7, i64 8}
!12 = !{!8, !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !8, i64 0}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !21}


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