; LLVM IR from Columbitech/rohc :: src/cprofile.ll (ZN4ROHC8CProfile6CreateEPNS_10CompressorEtjPKNS_5iphdrE)

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN4ROHC11CRTPProfile9ProfileIDEv() #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN4ROHC11CUDPProfile9ProfileIDEv() #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4ROHC8CProfile6CreateEPNS_10CompressorEtjPKNS_5iphdrE(ptr noundef %0, i16 noundef zeroext %1, i32 noundef %2, ptr noundef %3) #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i16 %1, ptr %7, align 2, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !11
  store ptr %3, ptr %9, align 8, !tbaa !5
  %12 = load i32, ptr %8, align 4, !tbaa !11
  %13 = call noundef zeroext i16 @_ZN4ROHC11CUDPProfile9ProfileIDEv()
  %14 = zext i16 %13 to i32
  %15 = icmp eq i32 %12, %14
  br i1 %15, label %16, label %26

16:                                               ; preds = %4
  %17 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 336) #5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = load i16, ptr %7, align 2, !tbaa !9
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN4ROHC11CUDPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(333) %17, ptr noundef %18, i16 noundef zeroext %19, ptr noundef %20)
          to label %21 unwind label %22

21:                                               ; preds = %16
  store ptr %17, ptr %5, align 8
  br label %69

22:                                               ; preds = %16
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %10, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %11, align 4
  call void @_ZdlPvm(ptr noundef %17, i64 noundef 336) #6
  br label %71

26:                                               ; preds = %4
  %27 = load i32, ptr %8, align 4, !tbaa !11
  %28 = call noundef zeroext i16 @_ZN4ROHC11CRTPProfile9ProfileIDEv()
  %29 = zext i16 %28 to i32
  %30 = icmp eq i32 %27, %29
  br i1 %30, label %31, label %41

31:                                               ; preds = %26
  %32 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 448) #5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = load i16, ptr %7, align 2, !tbaa !9
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN4ROHC11CRTPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(445) %32, ptr noundef %33, i16 noundef zeroext %34, ptr noundef %35)
          to label %36 unwind label %37

36:                                               ; preds = %31
  store ptr %32, ptr %5, align 8
  br label %69

37:                                               ; preds = %31
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %10, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %11, align 4
  call void @_ZdlPvm(ptr noundef %32, i64 noundef 448) #6
  br label %71

41:                                               ; preds = %26
  %42 = call noundef zeroext i16 @_ZN4ROHC11CTCPProfile9ProfileIDEv()
  %43 = zext i16 %42 to i32
  %44 = load i32, ptr %8, align 4, !tbaa !11
  %45 = icmp eq i32 %43, %44
  br i1 %45, label %46, label %56

46:                                               ; preds = %41
  %47 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 352) #5
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = load i16, ptr %7, align 2, !tbaa !9
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN4ROHC11CTCPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(348) %47, ptr noundef %48, i16 noundef zeroext %49, ptr noundef %50)
          to label %51 unwind label %52

51:                                               ; preds = %46
  store ptr %47, ptr %5, align 8
  br label %69

52:                                               ; preds = %46
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %10, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %11, align 4
  call void @_ZdlPvm(ptr noundef %47, i64 noundef 352) #6
  br label %71

56:                                               ; preds = %41
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  %59 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 336) #5
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load i16, ptr %7, align 2, !tbaa !9
  %62 = zext i16 %61 to i32
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN4ROHC20CUncompressedProfileC1EPNS_10CompressorEjPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(329) %59, ptr noundef %60, i32 noundef %62, ptr noundef %63)
          to label %64 unwind label %65

64:                                               ; preds = %58
  store ptr %59, ptr %5, align 8
  br label %69

65:                                               ; preds = %58
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %10, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %11, align 4
  call void @_ZdlPvm(ptr noundef %59, i64 noundef 336) #6
  br label %71

69:                                               ; preds = %64, %51, %36, %21
  %70 = load ptr, ptr %5, align 8
  ret ptr %70

71:                                               ; preds = %65, %52, %37, %22
  %72 = load ptr, ptr %10, align 8
  %73 = load i32, ptr %11, align 4
  %74 = insertvalue { ptr, i32 } poison, ptr %72, 0
  %75 = insertvalue { ptr, i32 } %74, i32 %73, 1
  resume { ptr, i32 } %75
}

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

declare void @_ZN4ROHC11CUDPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(333), ptr noundef, i16 noundef zeroext, ptr noundef) unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #4

declare void @_ZN4ROHC11CRTPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(445), ptr noundef, i16 noundef zeroext, ptr noundef) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN4ROHC11CTCPProfile9ProfileIDEv() #0 align 2

declare void @_ZN4ROHC11CTCPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(348), ptr noundef, i16 noundef zeroext, ptr noundef) unnamed_addr #3

declare void @_ZN4ROHC20CUncompressedProfileC1EPNS_10CompressorEjPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(329), ptr noundef, i32 noundef, ptr noundef) unnamed_addr #3

attributes #0 = { mustprogress 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 #1 = { 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 #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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !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 i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN4ROHC11CRTPProfile9ProfileIDEv() local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN4ROHC11CUDPProfile9ProfileIDEv() local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull ptr @_ZN4ROHC8CProfile6CreateEPNS_10CompressorEtjPKNS_5iphdrE(ptr noundef %0, i16 noundef zeroext %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = tail call noundef zeroext i16 @_ZN4ROHC11CUDPProfile9ProfileIDEv()
  %6 = zext i16 %5 to i32
  %7 = icmp eq i32 %6, %2
  br i1 %7, label %8, label %12

8:                                                ; preds = %4
  %9 = tail call noalias noundef nonnull dereferenceable(336) ptr @_Znwm(i64 noundef 336) #5
  invoke void @_ZN4ROHC11CUDPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(333) %9, ptr noundef %0, i16 noundef zeroext %1, ptr noundef %3)
          to label %33 unwind label %10

10:                                               ; preds = %8
  %11 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %9, i64 noundef 336) #6
  br label %34

12:                                               ; preds = %4
  %13 = tail call noundef zeroext i16 @_ZN4ROHC11CRTPProfile9ProfileIDEv()
  %14 = zext i16 %13 to i32
  %15 = icmp eq i32 %14, %2
  br i1 %15, label %16, label %20

16:                                               ; preds = %12
  %17 = tail call noalias noundef nonnull dereferenceable(448) ptr @_Znwm(i64 noundef 448) #5
  invoke void @_ZN4ROHC11CRTPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(445) %17, ptr noundef %0, i16 noundef zeroext %1, ptr noundef %3)
          to label %33 unwind label %18

18:                                               ; preds = %16
  %19 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %17, i64 noundef 448) #6
  br label %34

20:                                               ; preds = %12
  %21 = tail call noundef zeroext i16 @_ZN4ROHC11CTCPProfile9ProfileIDEv()
  %22 = zext i16 %21 to i32
  %23 = icmp eq i32 %22, %2
  br i1 %23, label %24, label %28

24:                                               ; preds = %20
  %25 = tail call noalias noundef nonnull dereferenceable(352) ptr @_Znwm(i64 noundef 352) #5
  invoke void @_ZN4ROHC11CTCPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(348) %25, ptr noundef %0, i16 noundef zeroext %1, ptr noundef %3)
          to label %33 unwind label %26

26:                                               ; preds = %24
  %27 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %25, i64 noundef 352) #6
  br label %34

28:                                               ; preds = %20
  %29 = tail call noalias noundef nonnull dereferenceable(336) ptr @_Znwm(i64 noundef 336) #5
  %30 = zext i16 %1 to i32
  invoke void @_ZN4ROHC20CUncompressedProfileC1EPNS_10CompressorEjPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(329) %29, ptr noundef %0, i32 noundef %30, ptr noundef %3)
          to label %33 unwind label %31

31:                                               ; preds = %28
  %32 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %29, i64 noundef 336) #6
  br label %34

33:                                               ; preds = %28, %24, %16, %8
  %.018 = phi ptr [ %9, %8 ], [ %17, %16 ], [ %25, %24 ], [ %29, %28 ]
  ret ptr %.018

34:                                               ; preds = %31, %26, %18, %10
  %.pn = phi { ptr, i32 } [ %11, %10 ], [ %19, %18 ], [ %27, %26 ], [ %32, %31 ]
  resume { ptr, i32 } %.pn
}

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

declare void @_ZN4ROHC11CUDPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(333), ptr noundef, i16 noundef zeroext, ptr noundef) unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

declare void @_ZN4ROHC11CRTPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(445), ptr noundef, i16 noundef zeroext, ptr noundef) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN4ROHC11CTCPProfile9ProfileIDEv() local_unnamed_addr #0 align 2

declare void @_ZN4ROHC11CTCPProfileC1EPNS_10CompressorEtPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(348), ptr noundef, i16 noundef zeroext, ptr noundef) unnamed_addr #3

declare void @_ZN4ROHC20CUncompressedProfileC1EPNS_10CompressorEjPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(329), ptr noundef, i32 noundef, ptr noundef) unnamed_addr #3

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


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass