; LLVM IR from intel/qpl :: tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/_86138024 (generator37AllZeroLiteralLengthCodesConfigurator8generateEv)

; 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_generator37AllZeroLiteralLengthCodesConfigurator8generateEv(ptr noundef nonnull align 8 dereferenceable(384) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 286, ptr %5, align 4, !tbaa !9
  %8 = call noalias noundef nonnull ptr @_Znam(i64 noundef 1144) #6
  store ptr %8, ptr %3, align 8, !tbaa !5
  %9 = call noalias noundef nonnull ptr @_Znam(i64 noundef 76) #6
  store ptr %9, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = call noundef i32 @_ZNK12gz_generator16TestConfigurator26makeRandomLengthCodesTableEPjjh(ptr noundef nonnull align 8 dereferenceable(384) %7, ptr noundef %10, i32 noundef 286, i8 noundef zeroext 15)
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = call noundef i32 @_ZNK12gz_generator16TestConfigurator26makeRandomLengthCodesTableEPjjh(ptr noundef nonnull align 8 dereferenceable(384) %7, ptr noundef %12, i32 noundef 19, i8 noundef zeroext 7)
  call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %7)
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN12gz_generator16TestConfigurator18declareVectorTokenENS0_15VectorTokenTypeEPKjj(ptr noundef nonnull align 8 dereferenceable(384) %7, i8 noundef zeroext 0, ptr noundef %14, i32 noundef 286)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %24, %1
  %16 = load i32, ptr %6, align 4, !tbaa !9
  %17 = icmp ult i32 %16, 286
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %27

19:                                               ; preds = %15
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = zext i32 %21 to i64
  %23 = getelementptr inbounds i32, ptr %20, i64 %22
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = add i32 %25, 1
  store i32 %26, ptr %6, align 4, !tbaa !9
  br label %15, !llvm.loop !11

27:                                               ; preds = %18
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN12gz_generator16TestConfigurator18declareVectorTokenENS0_15VectorTokenTypeEPKjj(ptr noundef nonnull align 8 dereferenceable(384) %7, i8 noundef zeroext 1, ptr noundef %28, i32 noundef 286)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN12gz_generator16TestConfigurator18declareVectorTokenENS0_15VectorTokenTypeEPKjj(ptr noundef nonnull align 8 dereferenceable(384) %7, i8 noundef zeroext 5, ptr noundef %29, i32 noundef 19)
  call void @_ZN12gz_generator16TestConfigurator23writeRandomHuffmanBlockEj(ptr noundef nonnull align 8 dereferenceable(384) %7, i32 noundef 0)
  call void @_ZN12gz_generator16TestConfigurator18declareFinishBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %7)
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  call void @_ZdaPv(ptr noundef %30) #7
  br label %33

33:                                               ; preds = %32, %27
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = icmp eq ptr %34, null
  br i1 %35, label %37, label %36

36:                                               ; preds = %33
  call void @_ZdaPv(ptr noundef %34) #7
  br label %37

37:                                               ; preds = %36, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret i32 0
}

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

declare noundef i32 @_ZNK12gz_generator16TestConfigurator26makeRandomLengthCodesTableEPjjh(ptr noundef nonnull align 8 dereferenceable(384), ptr noundef, i32 noundef, i8 noundef zeroext) #3

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

declare void @_ZN12gz_generator16TestConfigurator18declareVectorTokenENS0_15VectorTokenTypeEPKjj(ptr noundef nonnull align 8 dereferenceable(384), i8 noundef zeroext, ptr noundef, i32 noundef) #3

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

declare void @_ZN12gz_generator16TestConfigurator23writeRandomHuffmanBlockEj(ptr noundef nonnull align 8 dereferenceable(384), i32 noundef) #3

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #4

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 = { nobuiltin allocsize(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 = { "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 = { nobuiltin 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 #5 = { nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { builtin 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"}


; 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_generator37AllZeroLiteralLengthCodesConfigurator8generateEv(ptr noundef nonnull align 8 dereferenceable(384) %0) unnamed_addr #0 align 2 {
  %2 = tail call noalias noundef nonnull dereferenceable(1144) ptr @_Znam(i64 noundef 1144) #5
  %3 = tail call noalias noundef nonnull dereferenceable(76) ptr @_Znam(i64 noundef 76) #5
  %4 = tail call noundef i32 @_ZNK12gz_generator16TestConfigurator26makeRandomLengthCodesTableEPjjh(ptr noundef nonnull align 8 dereferenceable(384) %0, ptr noundef nonnull %2, i32 noundef 286, i8 noundef zeroext 15)
  %5 = tail call noundef i32 @_ZNK12gz_generator16TestConfigurator26makeRandomLengthCodesTableEPjjh(ptr noundef nonnull align 8 dereferenceable(384) %0, ptr noundef nonnull %3, i32 noundef 19, i8 noundef zeroext 7)
  tail call void @_ZN12gz_generator16TestConfigurator19declareDynamicBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZN12gz_generator16TestConfigurator18declareVectorTokenENS0_15VectorTokenTypeEPKjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i8 noundef zeroext 0, ptr noundef nonnull %2, i32 noundef 286)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1144) %2, i8 0, i64 1144, i1 false), !tbaa !5
  tail call void @_ZN12gz_generator16TestConfigurator18declareVectorTokenENS0_15VectorTokenTypeEPKjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i8 noundef zeroext 1, ptr noundef nonnull %2, i32 noundef 286)
  tail call void @_ZN12gz_generator16TestConfigurator18declareVectorTokenENS0_15VectorTokenTypeEPKjj(ptr noundef nonnull align 8 dereferenceable(384) %0, i8 noundef zeroext 5, ptr noundef nonnull %3, i32 noundef 19)
  tail call void @_ZN12gz_generator16TestConfigurator23writeRandomHuffmanBlockEj(ptr noundef nonnull align 8 dereferenceable(384) %0, i32 noundef 0)
  tail call void @_ZN12gz_generator16TestConfigurator18declareFinishBlockEv(ptr noundef nonnull align 8 dereferenceable(384) %0)
  tail call void @_ZdaPv(ptr noundef nonnull %2) #6
  tail call void @_ZdaPv(ptr noundef nonnull %3) #6
  ret i32 0
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

declare noundef i32 @_ZNK12gz_generator16TestConfigurator26makeRandomLengthCodesTableEPjjh(ptr noundef nonnull align 8 dereferenceable(384), ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #2

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

declare void @_ZN12gz_generator16TestConfigurator18declareVectorTokenENS0_15VectorTokenTypeEPKjj(ptr noundef nonnull align 8 dereferenceable(384), i8 noundef zeroext, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #3

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

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 = { nobuiltin allocsize(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 = { "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 = { nobuiltin 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 nounwind willreturn memory(argmem: write) }
attributes #5 = { builtin allocsize(0) }
attributes #6 = { builtin 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopIdiomRecognizePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass