; LLVM IR from mrbid/CSGO_TENSOR_TRIGGER :: GOBOT15/StandaloneFNN/benchmark (bench1)

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

@aim_model_layer0 = external dso_local constant [6280 x float], align 16
@aim_model_layer1 = external dso_local constant [9 x float], align 16

; Function Attrs: nounwind uwtable
define dso_local float @processModelRM(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca [8 x float], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #6
  call void @llvm.memset.p0.i64(ptr align 16 %3, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %9

9:                                                ; preds = %54, %1
  %10 = load i32, ptr %6, align 4, !tbaa !9
  %11 = icmp slt i32 %10, 6280
  br i1 %11, label %13, label %12

12:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %57

13:                                               ; preds = %9
  %14 = load i32, ptr %5, align 4, !tbaa !9
  %15 = icmp sgt i32 %14, 784
  br i1 %15, label %16, label %36

16:                                               ; preds = %13
  %17 = load i32, ptr %6, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [6280 x float], ptr @aim_model_layer0, i64 0, i64 %18
  %20 = load float, ptr %19, align 4, !tbaa !11
  %21 = load i32, ptr %4, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [8 x float], ptr %3, i64 0, i64 %22
  %24 = load float, ptr %23, align 4, !tbaa !11
  %25 = fadd float %24, %20
  store float %25, ptr %23, align 4, !tbaa !11
  %26 = load i32, ptr %4, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [8 x float], ptr %3, i64 0, i64 %27
  %29 = load float, ptr %28, align 4, !tbaa !11
  %30 = call float @tanhf(float noundef %29) #6
  %31 = load i32, ptr %4, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [8 x float], ptr %3, i64 0, i64 %32
  store float %30, ptr %33, align 4, !tbaa !11
  %34 = load i32, ptr %4, align 4, !tbaa !9
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %4, align 4, !tbaa !9
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %53

36:                                               ; preds = %13
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = load i32, ptr %5, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds float, ptr %37, i64 %39
  %41 = load float, ptr %40, align 4, !tbaa !11
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [6280 x float], ptr @aim_model_layer0, i64 0, i64 %43
  %45 = load float, ptr %44, align 4, !tbaa !11
  %46 = load i32, ptr %4, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [8 x float], ptr %3, i64 0, i64 %47
  %49 = load float, ptr %48, align 4, !tbaa !11
  %50 = call float @llvm.fmuladd.f32(float %41, float %45, float %49)
  store float %50, ptr %48, align 4, !tbaa !11
  %51 = load i32, ptr %5, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %5, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %36, %16
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %6, align 4, !tbaa !9
  br label %9, !llvm.loop !13

57:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store float 0.000000e+00, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %73, %57
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = icmp slt i32 %59, 8
  br i1 %60, label %62, label %61

61:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %76

62:                                               ; preds = %58
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [8 x float], ptr %3, i64 0, i64 %64
  %66 = load float, ptr %65, align 4, !tbaa !11
  %67 = load i32, ptr %8, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [9 x float], ptr @aim_model_layer1, i64 0, i64 %68
  %70 = load float, ptr %69, align 4, !tbaa !11
  %71 = load float, ptr %7, align 4, !tbaa !11
  %72 = call float @llvm.fmuladd.f32(float %66, float %70, float %71)
  store float %72, ptr %7, align 4, !tbaa !11
  br label %73

73:                                               ; preds = %62
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %8, align 4, !tbaa !9
  br label %58, !llvm.loop !15

76:                                               ; preds = %61
  %77 = load float, ptr getelementptr inbounds ([9 x float], ptr @aim_model_layer1, i64 0, i64 8), align 16, !tbaa !11
  %78 = load float, ptr %7, align 4, !tbaa !11
  %79 = fadd float %78, %77
  store float %79, ptr %7, align 4, !tbaa !11
  %80 = load float, ptr %7, align 4, !tbaa !11
  %81 = call float @sigmoid(float noundef %80)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #6
  ret float %81
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nounwind
declare float @tanhf(float noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

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

; Function Attrs: alwaysinline nounwind uwtable
declare float @sigmoid(float noundef) #5

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

!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, !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 = distinct !{!15, !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"

@aim_model_layer0 = external dso_local local_unnamed_addr constant [6280 x float], align 16
@aim_model_layer1 = external dso_local local_unnamed_addr constant [9 x float], align 16

; Function Attrs: nounwind uwtable
define dso_local float @processModelRM(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = alloca [8 x float], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %2, i8 0, i64 32, i1 false)
  br label %3

3:                                                ; preds = %1, %25
  %indvars.iv = phi i64 [ 0, %1 ], [ %indvars.iv.next, %25 ]
  %.02125 = phi i32 [ 0, %1 ], [ %.1, %25 ]
  %.02224 = phi i32 [ 0, %1 ], [ %.123, %25 ]
  %4 = icmp sgt i32 %.02125, 784
  br i1 %4, label %5, label %14

5:                                                ; preds = %3
  %6 = getelementptr inbounds [6280 x float], ptr @aim_model_layer0, i64 0, i64 %indvars.iv
  %7 = load float, ptr %6, align 4, !tbaa !5
  %8 = sext i32 %.02224 to i64
  %9 = getelementptr inbounds [8 x float], ptr %2, i64 0, i64 %8
  %10 = load float, ptr %9, align 4, !tbaa !5
  %11 = fadd float %7, %10
  %12 = tail call float @tanhf(float noundef %11) #6
  store float %12, ptr %9, align 4, !tbaa !5
  %13 = add nsw i32 %.02224, 1
  br label %25

14:                                               ; preds = %3
  %15 = sext i32 %.02125 to i64
  %16 = getelementptr inbounds float, ptr %0, i64 %15
  %17 = load float, ptr %16, align 4, !tbaa !5
  %18 = getelementptr inbounds [6280 x float], ptr @aim_model_layer0, i64 0, i64 %indvars.iv
  %19 = load float, ptr %18, align 4, !tbaa !5
  %20 = sext i32 %.02224 to i64
  %21 = getelementptr inbounds [8 x float], ptr %2, i64 0, i64 %20
  %22 = load float, ptr %21, align 4, !tbaa !5
  %23 = tail call float @llvm.fmuladd.f32(float %17, float %19, float %22)
  store float %23, ptr %21, align 4, !tbaa !5
  %24 = add nsw i32 %.02125, 1
  br label %25

25:                                               ; preds = %5, %14
  %.123 = phi i32 [ %13, %5 ], [ %.02224, %14 ]
  %.1 = phi i32 [ 0, %5 ], [ %24, %14 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 6280
  br i1 %exitcond.not, label %.preheader.preheader, label %3, !llvm.loop !9

.preheader.preheader:                             ; preds = %25
  %26 = load float, ptr %2, align 16, !tbaa !5
  %27 = load float, ptr @aim_model_layer1, align 16, !tbaa !5
  %28 = tail call float @llvm.fmuladd.f32(float %26, float %27, float 0.000000e+00)
  %29 = getelementptr inbounds i8, ptr %2, i64 4
  %30 = load float, ptr %29, align 4, !tbaa !5
  %31 = load float, ptr getelementptr inbounds (i8, ptr @aim_model_layer1, i64 4), align 4, !tbaa !5
  %32 = tail call float @llvm.fmuladd.f32(float %30, float %31, float %28)
  %33 = getelementptr inbounds i8, ptr %2, i64 8
  %34 = load float, ptr %33, align 8, !tbaa !5
  %35 = load float, ptr getelementptr inbounds (i8, ptr @aim_model_layer1, i64 8), align 8, !tbaa !5
  %36 = tail call float @llvm.fmuladd.f32(float %34, float %35, float %32)
  %37 = getelementptr inbounds i8, ptr %2, i64 12
  %38 = load float, ptr %37, align 4, !tbaa !5
  %39 = load float, ptr getelementptr inbounds (i8, ptr @aim_model_layer1, i64 12), align 4, !tbaa !5
  %40 = tail call float @llvm.fmuladd.f32(float %38, float %39, float %36)
  %41 = getelementptr inbounds i8, ptr %2, i64 16
  %42 = load float, ptr %41, align 16, !tbaa !5
  %43 = load float, ptr getelementptr inbounds (i8, ptr @aim_model_layer1, i64 16), align 16, !tbaa !5
  %44 = tail call float @llvm.fmuladd.f32(float %42, float %43, float %40)
  %45 = getelementptr inbounds i8, ptr %2, i64 20
  %46 = load float, ptr %45, align 4, !tbaa !5
  %47 = load float, ptr getelementptr inbounds (i8, ptr @aim_model_layer1, i64 20), align 4, !tbaa !5
  %48 = tail call float @llvm.fmuladd.f32(float %46, float %47, float %44)
  %49 = getelementptr inbounds i8, ptr %2, i64 24
  %50 = load float, ptr %49, align 8, !tbaa !5
  %51 = load float, ptr getelementptr inbounds (i8, ptr @aim_model_layer1, i64 24), align 8, !tbaa !5
  %52 = tail call float @llvm.fmuladd.f32(float %50, float %51, float %48)
  %53 = getelementptr inbounds i8, ptr %2, i64 28
  %54 = load float, ptr %53, align 4, !tbaa !5
  %55 = load float, ptr getelementptr inbounds (i8, ptr @aim_model_layer1, i64 28), align 4, !tbaa !5
  %56 = tail call float @llvm.fmuladd.f32(float %54, float %55, float %52)
  %57 = load float, ptr getelementptr inbounds (i8, ptr @aim_model_layer1, i64 32), align 16, !tbaa !5
  %58 = fadd float %56, %57
  %59 = tail call float @sigmoid(float noundef %58)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  ret float %59
}

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

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

; Function Attrs: alwaysinline nounwind uwtable
declare float @sigmoid(float noundef) local_unnamed_addr #5

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

!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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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