; LLVM IR from libxsmm/libxsmm :: src (generator_common_aarch64)

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

@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [291 x i8], align 1
@__PRETTY_FUNCTION__.libxsmm_generator_prepare_coeffs_sigmoid_ps_rational_78_aarch64_sve = external hidden unnamed_addr constant [412 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; 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 void @libxsmm_aarch64_instruction_broadcast_scalar_to_vec_sve(ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i8 noundef zeroext, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_prepare_coeffs_tanh_ps_rational_78_aarch64_sve(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext) #2

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_prepare_coeffs_sigmoid_ps_rational_78_aarch64_sve(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10, i32 noundef %11, i32 noundef %12, i32 noundef %13, i32 noundef %14, i8 noundef zeroext %15) #2 {
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i8, align 1
  %33 = alloca i64, align 8
  store ptr %0, ptr %17, align 8, !tbaa !5
  store i32 %1, ptr %18, align 4, !tbaa !9
  store i32 %2, ptr %19, align 4, !tbaa !9
  store i32 %3, ptr %20, align 4, !tbaa !9
  store i32 %4, ptr %21, align 4, !tbaa !9
  store i32 %5, ptr %22, align 4, !tbaa !9
  store i32 %6, ptr %23, align 4, !tbaa !9
  store i32 %7, ptr %24, align 4, !tbaa !9
  store i32 %8, ptr %25, align 4, !tbaa !9
  store i32 %9, ptr %26, align 4, !tbaa !9
  store i32 %10, ptr %27, align 4, !tbaa !9
  store i32 %11, ptr %28, align 4, !tbaa !9
  store i32 %12, ptr %29, align 4, !tbaa !9
  store i32 %13, ptr %30, align 4, !tbaa !9
  store i32 %14, ptr %31, align 4, !tbaa !9
  store i8 %15, ptr %32, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #3
  store i64 1056964608, ptr %33, align 8, !tbaa !12
  %34 = load ptr, ptr %17, align 8, !tbaa !5
  %35 = load i32, ptr %29, align 4, !tbaa !9
  %36 = trunc i32 %35 to i8
  %37 = zext i8 %36 to i32
  %38 = icmp eq i32 0, %37
  br i1 %38, label %44, label %39

39:                                               ; preds = %16
  %40 = load i32, ptr %29, align 4, !tbaa !9
  %41 = trunc i32 %40 to i8
  %42 = zext i8 %41 to i32
  %43 = icmp slt i32 0, %42
  br i1 %43, label %44, label %62

44:                                               ; preds = %39, %16
  %45 = load i32, ptr %29, align 4, !tbaa !9
  %46 = zext i32 %45 to i64
  %47 = mul i64 1, %46
  %48 = icmp ult i64 %47, 255
  br i1 %48, label %49, label %53

49:                                               ; preds = %44
  %50 = load i32, ptr %29, align 4, !tbaa !9
  %51 = zext i32 %50 to i64
  %52 = mul i64 1, %51
  br label %54

53:                                               ; preds = %44
  br label %54

54:                                               ; preds = %53, %49
  %55 = phi i64 [ %52, %49 ], [ 255, %53 ]
  %56 = icmp ule i64 %55, 255
  br i1 %56, label %57, label %62

57:                                               ; preds = %54
  %58 = load i32, ptr %29, align 4, !tbaa !9
  %59 = uitofp i32 %58 to double
  %60 = fcmp ole double 0.000000e+00, %59
  br i1 %60, label %61, label %62

61:                                               ; preds = %57
  br label %63

62:                                               ; preds = %57, %54, %39
  call void @__assert_fail(ptr noundef @.str.35, ptr noundef @.str.1, i32 noundef 3873, ptr noundef @__PRETTY_FUNCTION__.libxsmm_generator_prepare_coeffs_sigmoid_ps_rational_78_aarch64_sve) #4
  unreachable

63:                                               ; preds = %61
  %64 = load i32, ptr %29, align 4, !tbaa !9
  %65 = trunc i32 %64 to i8
  %66 = load i32, ptr %30, align 4, !tbaa !9
  %67 = load i32, ptr %31, align 4, !tbaa !9
  %68 = load i8, ptr %32, align 1, !tbaa !11
  %69 = load i64, ptr %33, align 8, !tbaa !12
  call void @libxsmm_aarch64_instruction_broadcast_scalar_to_vec_sve(ptr noundef %34, i8 noundef zeroext %65, i32 noundef %66, i32 noundef %67, i8 noundef zeroext %68, i64 noundef %69)
  %70 = load ptr, ptr %17, align 8, !tbaa !5
  %71 = load i32, ptr %18, align 4, !tbaa !9
  %72 = load i32, ptr %19, align 4, !tbaa !9
  %73 = load i32, ptr %20, align 4, !tbaa !9
  %74 = load i32, ptr %21, align 4, !tbaa !9
  %75 = load i32, ptr %22, align 4, !tbaa !9
  %76 = load i32, ptr %23, align 4, !tbaa !9
  %77 = load i32, ptr %24, align 4, !tbaa !9
  %78 = load i32, ptr %25, align 4, !tbaa !9
  %79 = load i32, ptr %26, align 4, !tbaa !9
  %80 = load i32, ptr %27, align 4, !tbaa !9
  %81 = load i32, ptr %28, align 4, !tbaa !9
  %82 = load i32, ptr %30, align 4, !tbaa !9
  %83 = load i32, ptr %31, align 4, !tbaa !9
  %84 = load i8, ptr %32, align 1, !tbaa !11
  call void @libxsmm_generator_prepare_coeffs_tanh_ps_rational_78_aarch64_sve(ptr noundef %70, i32 noundef %71, i32 noundef %72, i32 noundef %73, i32 noundef %74, i32 noundef %75, i32 noundef %76, i32 noundef %77, i32 noundef %78, i32 noundef %79, i32 noundef %80, i32 noundef %81, i32 noundef %82, i32 noundef %83, i8 noundef zeroext %84)
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 }
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, !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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}


; 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: nounwind uwtable
declare dso_local void @libxsmm_aarch64_instruction_broadcast_scalar_to_vec_sve(ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i8 noundef zeroext, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_prepare_coeffs_tanh_ps_rational_78_aarch64_sve(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_prepare_coeffs_sigmoid_ps_rational_78_aarch64_sve(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10, i32 noundef %11, i32 noundef %12, i32 noundef %13, i32 noundef %14, i8 noundef zeroext %15) local_unnamed_addr #0 {
  %17 = trunc i32 %12 to i8
  tail call void @libxsmm_aarch64_instruction_broadcast_scalar_to_vec_sve(ptr noundef %0, i8 noundef zeroext %17, i32 noundef %13, i32 noundef %14, i8 noundef zeroext %15, i64 noundef 1056964608)
  tail call void @libxsmm_generator_prepare_coeffs_tanh_ps_rational_78_aarch64_sve(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10, i32 noundef %11, i32 noundef %13, i32 noundef %14, i8 noundef zeroext %15)
  ret void
}

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

!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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass