; LLVM IR from ermig1979/Simd :: src/Test/TestFilter.ll (ZN4Test23GaussianBlurSpecialTestERKNS_7OptionsE)

; 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.36 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 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

declare ptr @SimdGaussianBlurInit(i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Test23GaussianBlurSpecialTestERKNS_7OptionsE(ptr noundef nonnull align 8 dereferenceable(256) %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca [96 x i8], align 16
  %6 = alloca [96 x i8], align 16
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca float, align 4
  %11 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  store i64 8, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  store i64 12, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 96, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 96, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %12

12:                                               ; preds = %36, %1
  %13 = load i64, ptr %7, align 8, !tbaa !9
  %14 = icmp ult i64 %13, 8
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %39

16:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %17

17:                                               ; preds = %32, %16
  %18 = load i64, ptr %9, align 8, !tbaa !9
  %19 = icmp ult i64 %18, 12
  br i1 %19, label %21, label %20

20:                                               ; preds = %17
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %35

21:                                               ; preds = %17
  %22 = load i64, ptr %7, align 8, !tbaa !9
  %23 = mul i64 %22, 12
  %24 = load i64, ptr %9, align 8, !tbaa !9
  %25 = add i64 %23, %24
  %26 = trunc i64 %25 to i8
  %27 = load i64, ptr %7, align 8, !tbaa !9
  %28 = mul i64 %27, 12
  %29 = load i64, ptr %9, align 8, !tbaa !9
  %30 = add i64 %28, %29
  %31 = getelementptr inbounds [96 x i8], ptr %5, i64 0, i64 %30
  store i8 %26, ptr %31, align 1, !tbaa !11
  br label %32

32:                                               ; preds = %21
  %33 = load i64, ptr %9, align 8, !tbaa !9
  %34 = add i64 %33, 1
  store i64 %34, ptr %9, align 8, !tbaa !9
  br label %17, !llvm.loop !12

35:                                               ; preds = %20
  br label %36

36:                                               ; preds = %35
  %37 = load i64, ptr %7, align 8, !tbaa !9
  %38 = add i64 %37, 1
  store i64 %38, ptr %7, align 8, !tbaa !9
  br label %12, !llvm.loop !14

39:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store float 5.000000e-01, ptr %10, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %40 = call ptr @SimdGaussianBlurInit(i64 noundef 12, i64 noundef 8, i64 noundef 1, ptr noundef %10, ptr noundef null)
  store ptr %40, ptr %11, align 8, !tbaa !5
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = getelementptr inbounds [96 x i8], ptr %5, i64 0, i64 0
  %43 = getelementptr inbounds [96 x i8], ptr %6, i64 0, i64 0
  call void @SimdGaussianBlurRun(ptr noundef %41, ptr noundef %42, i64 noundef 12, ptr noundef %43, i64 noundef 12)
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  call void @SimdRelease(ptr noundef %44)
  %45 = getelementptr inbounds [96 x i8], ptr %5, i64 0, i64 0
  call void @_ZN4TestL5PrintEPKhmmPKc(ptr noundef %45, i64 noundef 8, i64 noundef 12, ptr noundef @.str.36)
  %46 = getelementptr inbounds [96 x i8], ptr %6, i64 0, i64 0
  call void @_ZN4TestL5PrintEPKhmmPKc(ptr noundef %46, i64 noundef 8, i64 noundef 12, ptr noundef @.str.37)
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret i1 true
}

declare void @SimdGaussianBlurRun(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #1

declare void @SimdRelease(ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN4TestL5PrintEPKhmmPKc(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { 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 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !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"

@.str.36 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

declare ptr @SimdGaussianBlurInit(i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Test23GaussianBlurSpecialTestERKNS_7OptionsE(ptr nocapture noundef nonnull readnone align 8 dereferenceable(256) %0) local_unnamed_addr #2 {
.preheader:
  %1 = alloca [96 x i8], align 16
  %2 = alloca [96 x i8], align 16
  %3 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %2) #3
  store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, ptr %1, align 16, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 16
  store <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, ptr %4, align 16, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 32
  store <16 x i8> <i8 32, i8 33, i8 34, i8 35, i8 36, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43, i8 44, i8 45, i8 46, i8 47>, ptr %5, align 16, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 48
  store <16 x i8> <i8 48, i8 49, i8 50, i8 51, i8 52, i8 53, i8 54, i8 55, i8 56, i8 57, i8 58, i8 59, i8 60, i8 61, i8 62, i8 63>, ptr %6, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %1, i64 64
  store <16 x i8> <i8 64, i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75, i8 76, i8 77, i8 78, i8 79>, ptr %7, align 16, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %1, i64 80
  store <16 x i8> <i8 80, i8 81, i8 82, i8 83, i8 84, i8 85, i8 86, i8 87, i8 88, i8 89, i8 90, i8 91, i8 92, i8 93, i8 94, i8 95>, ptr %8, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  store float 5.000000e-01, ptr %3, align 4, !tbaa !8
  %9 = call ptr @SimdGaussianBlurInit(i64 noundef 12, i64 noundef 8, i64 noundef 1, ptr noundef nonnull %3, ptr noundef null)
  call void @SimdGaussianBlurRun(ptr noundef %9, ptr noundef nonnull %1, i64 noundef 12, ptr noundef nonnull %2, i64 noundef 12)
  call void @SimdRelease(ptr noundef %9)
  call void @_ZN4TestL5PrintEPKhmmPKc(ptr noundef nonnull %1, i64 noundef 8, i64 noundef 12, ptr noundef nonnull @.str.36)
  call void @_ZN4TestL5PrintEPKhmmPKc(ptr noundef nonnull %2, i64 noundef 8, i64 noundef 12, ptr noundef nonnull @.str.37)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %1) #3
  ret i1 true
}

declare void @SimdGaussianBlurRun(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @SimdRelease(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN4TestL5PrintEPKhmmPKc(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"float", !6, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass