; LLVM IR from intel/qpl :: tools/utils/generators/configurators/rfc1951_stream/correct_stream_generators/c_1a4c29f0 (generator29CannedSmallBlocksConfigurator8generateEv)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN12gz_generator29CannedSmallBlocksConfigurator8generateEv(ptr noundef nonnull align 8 dereferenceable(384) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %12

12:                                               ; preds = %54, %1
  %13 = load i32, ptr %4, align 4, !tbaa !9
  %14 = icmp ult i32 %13, 4
  br i1 %14, label %16, label %15

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

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

17:                                               ; preds = %50, %16
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = icmp ult i32 %18, 4
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %17
  call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %30, %21
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = icmp ult i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %33

27:                                               ; preds = %22
  %28 = load i32, ptr %3, align 4, !tbaa !9
  %29 = add i32 %28, 1
  store i32 %29, ptr %3, align 4, !tbaa !9
  call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %11, i32 noundef %28)
  br label %30

30:                                               ; preds = %27
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = add i32 %31, 1
  store i32 %32, ptr %7, align 4, !tbaa !9
  br label %22, !llvm.loop !11

33:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %46, %33
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = icmp ult i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %49

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = add i32 %40, 3
  store i32 %41, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = add i32 %42, 1
  store i32 %43, ptr %10, align 4, !tbaa !9
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %11, i32 noundef %44, i32 noundef %45)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %46

46:                                               ; preds = %39
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = add i32 %47, 1
  store i32 %48, ptr %8, align 4, !tbaa !9
  br label %34, !llvm.loop !13

49:                                               ; preds = %38
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = add i32 %51, 1
  store i32 %52, ptr %6, align 4, !tbaa !9
  br label %17, !llvm.loop !14

53:                                               ; preds = %20
  br label %54

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

57:                                               ; preds = %15
  call void @_ZN12gz_generator16TestConfigurator18declareFinishBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %11)
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret i32 0
}

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

declare void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384)) #2

declare void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384), i32 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 @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384), i32 noundef, i32 noundef) #2

declare void @_ZN12gz_generator16TestConfigurator18declareFinishBlockEv(ptr noundef nonnull align 8 dereferenceable(384)) #2

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


; 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: mustprogress uwtable
define dso_local noundef i32 @_ZN12gz_generator29CannedSmallBlocksConfigurator8generateEv(ptr noundef nonnull align 8 dereferenceable(384) %0) unnamed_addr #0 align 2 {
._crit_edge.3:
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 0)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 2)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 4, i32 noundef 2)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 4)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 5)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 4, i32 noundef 2)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 5, i32 noundef 3)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 6)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 7)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 8)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 4, i32 noundef 2)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 9)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 10)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 11)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 4, i32 noundef 2)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 5, i32 noundef 3)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 12)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 13)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 14)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 4, i32 noundef 2)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 15)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 16)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 17)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 4, i32 noundef 2)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 5, i32 noundef 3)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 18)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 19)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 20)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 4, i32 noundef 2)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 21)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 22)
  tail call void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 23)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 3, i32 noundef 1)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 4, i32 noundef 2)
  tail call void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 5, i32 noundef 3)
  tail call void @_ZN12gz_generator16TestConfigurator18declareFinishBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  ret i32 0
}

declare void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384)) local_unnamed_addr #1

declare void @_ZN12gz_generator16TestConfigurator14declareLiteralEj(ptr noundef nonnull align 8 dereferenceable(384), i32 noundef) local_unnamed_addr #1

declare void @_ZN12gz_generator16TestConfigurator16declareReferenceEjj(ptr noundef nonnull align 8 dereferenceable(384), i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN12gz_generator16TestConfigurator18declareFinishBlockEv(ptr noundef nonnull align 8 dereferenceable(384)) local_unnamed_addr #1

attributes #0 = { 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 #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" }

!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,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass