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

%struct.libxsmm_generated_code = type { ptr, i32, i32, i32, i32, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [311 x i8], align 1
@__PRETTY_FUNCTION__.libxsmm_generator_prepare_dropout_aarch64_asimd = external hidden unnamed_addr constant [179 x i8], align 1

declare void @libxsmm_aarch64_instruction_sve_compute(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i32 noundef) #0

declare void @libxsmm_aarch64_instruction_asimd_compute(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext, i32 noundef, i32 noundef) #0

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

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

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

declare void @libxsmm_aarch64_instruction_sve_move(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

declare void @libxsmm_aarch64_instruction_asimd_struct_r_move(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_prepare_dropout_aarch64_asimd(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #3 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %14, i32 0, i32 6
  %16 = load i32, ptr %15, align 4, !tbaa !11
  %17 = icmp uge i32 %16, 2201
  br i1 %17, label %18, label %81

18:                                               ; preds = %6
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %19, i32 0, i32 6
  %21 = load i32, ptr %20, align 4, !tbaa !11
  %22 = icmp ule i32 %21, 2999
  br i1 %22, label %23, label %81

23:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  store i8 0, ptr %13, align 1, !tbaa !13
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = trunc i32 %25 to i8
  %27 = zext i8 %26 to i32
  %28 = icmp eq i32 0, %27
  br i1 %28, label %34, label %29

29:                                               ; preds = %23
  %30 = load i32, ptr %10, align 4, !tbaa !9
  %31 = trunc i32 %30 to i8
  %32 = zext i8 %31 to i32
  %33 = icmp slt i32 0, %32
  br i1 %33, label %34, label %52

34:                                               ; preds = %29, %23
  %35 = load i32, ptr %10, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = mul i64 1, %36
  %38 = icmp ult i64 %37, 255
  br i1 %38, label %39, label %43

39:                                               ; preds = %34
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = zext i32 %40 to i64
  %42 = mul i64 1, %41
  br label %44

43:                                               ; preds = %34
  br label %44

44:                                               ; preds = %43, %39
  %45 = phi i64 [ %42, %39 ], [ 255, %43 ]
  %46 = icmp ule i64 %45, 255
  br i1 %46, label %47, label %52

47:                                               ; preds = %44
  %48 = load i32, ptr %10, align 4, !tbaa !9
  %49 = uitofp i32 %48 to double
  %50 = fcmp ole double 0.000000e+00, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %47
  br label %53

52:                                               ; preds = %47, %44, %29
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 2302, ptr noundef @__PRETTY_FUNCTION__.libxsmm_generator_prepare_dropout_aarch64_asimd) #5
  unreachable

53:                                               ; preds = %51
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = trunc i32 %54 to i8
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = load i8, ptr %13, align 1, !tbaa !13
  call void @libxsmm_aarch64_instruction_broadcast_scalar_to_vec_sve(ptr noundef %24, i8 noundef zeroext %55, i32 noundef %56, i32 noundef 2, i8 noundef zeroext %57, i64 noundef 1065353216)
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = load i32, ptr %11, align 4, !tbaa !9
  %61 = load i8, ptr %13, align 1, !tbaa !13
  %62 = zext i8 %61 to i32
  call void @libxsmm_aarch64_instruction_sve_move(ptr noundef %58, i32 noundef -2059353978, i32 noundef %59, i32 noundef 0, i32 noundef 0, i32 noundef %60, i32 noundef %62)
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = load i32, ptr %10, align 4, !tbaa !9
  %65 = load i32, ptr %11, align 4, !tbaa !9
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = load i8, ptr %13, align 1, !tbaa !13
  %68 = zext i8 %67 to i32
  call void @libxsmm_aarch64_instruction_sve_compute(ptr noundef %63, i32 noundef 1694499843, i32 noundef %64, i32 noundef %65, i8 noundef zeroext 0, i32 noundef %66, i32 noundef %68, i32 noundef 2)
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = load i32, ptr %12, align 4, !tbaa !9
  %73 = load i8, ptr %13, align 1, !tbaa !13
  %74 = zext i8 %73 to i32
  call void @libxsmm_aarch64_instruction_sve_compute(ptr noundef %69, i32 noundef 73412611, i32 noundef %70, i32 noundef %71, i8 noundef zeroext 0, i32 noundef %72, i32 noundef %74, i32 noundef 2)
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = load i32, ptr %10, align 4, !tbaa !9
  %78 = load i32, ptr %12, align 4, !tbaa !9
  %79 = load i8, ptr %13, align 1, !tbaa !13
  %80 = zext i8 %79 to i32
  call void @libxsmm_aarch64_instruction_sve_compute(ptr noundef %75, i32 noundef 1695318178, i32 noundef %76, i32 noundef %77, i8 noundef zeroext 0, i32 noundef %78, i32 noundef %80, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  br label %126

81:                                               ; preds = %18, %6
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = trunc i32 %83 to i8
  %85 = zext i8 %84 to i32
  %86 = icmp eq i32 0, %85
  br i1 %86, label %92, label %87

87:                                               ; preds = %81
  %88 = load i32, ptr %10, align 4, !tbaa !9
  %89 = trunc i32 %88 to i8
  %90 = zext i8 %89 to i32
  %91 = icmp slt i32 0, %90
  br i1 %91, label %92, label %110

92:                                               ; preds = %87, %81
  %93 = load i32, ptr %10, align 4, !tbaa !9
  %94 = zext i32 %93 to i64
  %95 = mul i64 1, %94
  %96 = icmp ult i64 %95, 255
  br i1 %96, label %97, label %101

97:                                               ; preds = %92
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = zext i32 %98 to i64
  %100 = mul i64 1, %99
  br label %102

101:                                              ; preds = %92
  br label %102

102:                                              ; preds = %101, %97
  %103 = phi i64 [ %100, %97 ], [ 255, %101 ]
  %104 = icmp ule i64 %103, 255
  br i1 %104, label %105, label %110

105:                                              ; preds = %102
  %106 = load i32, ptr %10, align 4, !tbaa !9
  %107 = uitofp i32 %106 to double
  %108 = fcmp ole double 0.000000e+00, %107
  br i1 %108, label %109, label %110

109:                                              ; preds = %105
  br label %111

110:                                              ; preds = %105, %102, %87
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 2323, ptr noundef @__PRETTY_FUNCTION__.libxsmm_generator_prepare_dropout_aarch64_asimd) #5
  unreachable

111:                                              ; preds = %109
  %112 = load i32, ptr %10, align 4, !tbaa !9
  %113 = trunc i32 %112 to i8
  %114 = load i32, ptr %8, align 4, !tbaa !9
  call void @libxsmm_aarch64_instruction_broadcast_scalar_to_vec_asimd(ptr noundef %82, i8 noundef zeroext %113, i32 noundef %114, i32 noundef 5, i64 noundef 1065353216)
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = load i32, ptr %9, align 4, !tbaa !9
  %117 = load i32, ptr %11, align 4, !tbaa !9
  call void @libxsmm_aarch64_instruction_asimd_struct_r_move(ptr noundef %115, i32 noundef 222347266, i32 noundef %116, i32 noundef 127, i32 noundef %117, i32 noundef 5)
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = load i32, ptr %11, align 4, !tbaa !9
  %121 = load i32, ptr %11, align 4, !tbaa !9
  call void @libxsmm_aarch64_instruction_asimd_compute(ptr noundef %118, i32 noundef 245421067, i32 noundef %119, i32 noundef %120, i8 noundef zeroext 0, i32 noundef %121, i32 noundef 5)
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = load i32, ptr %10, align 4, !tbaa !9
  %124 = load i32, ptr %11, align 4, !tbaa !9
  %125 = load i32, ptr %12, align 4, !tbaa !9
  call void @libxsmm_aarch64_instruction_asimd_compute(ptr noundef %122, i32 noundef 773913611, i32 noundef %123, i32 noundef %124, i8 noundef zeroext 0, i32 noundef %125, i32 noundef 5)
  br label %126

126:                                              ; preds = %111, %53
  ret void
}

; 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) #3

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_aarch64_instruction_broadcast_scalar_to_vec_asimd(ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i64 noundef) #3

attributes #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 = { 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 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 #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 28}
!12 = !{!"libxsmm_generated_code", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!13 = !{!7, !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"

declare void @libxsmm_aarch64_instruction_sve_compute(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare void @libxsmm_aarch64_instruction_asimd_compute(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext, i32 noundef, i32 noundef) local_unnamed_addr #0

declare void @libxsmm_aarch64_instruction_sve_move(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare void @libxsmm_aarch64_instruction_asimd_struct_r_move(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_prepare_dropout_aarch64_asimd(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #1 {
  %7 = getelementptr inbounds i8, ptr %0, i64 28
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = add i32 %8, -2201
  %or.cond = icmp ult i32 %9, 799
  %10 = trunc i32 %3 to i8
  br i1 %or.cond, label %11, label %12

11:                                               ; preds = %6
  tail call void @libxsmm_aarch64_instruction_broadcast_scalar_to_vec_sve(ptr noundef nonnull %0, i8 noundef zeroext %10, i32 noundef %1, i32 noundef 2, i8 noundef zeroext 0, i64 noundef 1065353216)
  tail call void @libxsmm_aarch64_instruction_sve_move(ptr noundef nonnull %0, i32 noundef -2059353978, i32 noundef %2, i32 noundef 0, i32 noundef 0, i32 noundef %4, i32 noundef 0) #2
  tail call void @libxsmm_aarch64_instruction_sve_compute(ptr noundef nonnull %0, i32 noundef 1694499843, i32 noundef %3, i32 noundef %4, i8 noundef zeroext 0, i32 noundef %4, i32 noundef 0, i32 noundef 2) #2
  tail call void @libxsmm_aarch64_instruction_sve_compute(ptr noundef nonnull %0, i32 noundef 73412611, i32 noundef %4, i32 noundef %4, i8 noundef zeroext 0, i32 noundef %5, i32 noundef 0, i32 noundef 2) #2
  tail call void @libxsmm_aarch64_instruction_sve_compute(ptr noundef nonnull %0, i32 noundef 1695318178, i32 noundef %5, i32 noundef %3, i8 noundef zeroext 0, i32 noundef %5, i32 noundef 0, i32 noundef 2) #2
  br label %13

12:                                               ; preds = %6
  tail call void @libxsmm_aarch64_instruction_broadcast_scalar_to_vec_asimd(ptr noundef nonnull %0, i8 noundef zeroext %10, i32 noundef %1, i32 noundef 5, i64 noundef 1065353216)
  tail call void @libxsmm_aarch64_instruction_asimd_struct_r_move(ptr noundef nonnull %0, i32 noundef 222347266, i32 noundef %2, i32 noundef 127, i32 noundef %4, i32 noundef 5) #2
  tail call void @libxsmm_aarch64_instruction_asimd_compute(ptr noundef nonnull %0, i32 noundef 245421067, i32 noundef %3, i32 noundef %4, i8 noundef zeroext 0, i32 noundef %4, i32 noundef 5) #2
  tail call void @libxsmm_aarch64_instruction_asimd_compute(ptr noundef nonnull %0, i32 noundef 773913611, i32 noundef %3, i32 noundef %4, i8 noundef zeroext 0, i32 noundef %5, i32 noundef 5) #2
  br label %13

13:                                               ; preds = %12, %11
  ret void
}

; 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 #1

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

attributes #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 = { 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 = { 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, !10, i64 28}
!6 = !{!"libxsmm_generated_code", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}


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