; LLVM IR from Columbitech/rohc :: src (crtp_profile)

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

%"class.ROHC::CProfile" = type { ptr, ptr, i16, i64, i32, i32, i32, i32, i64, i64, i32, i32, i16, %"class.ROHC::WLSB", i32, i32, i8, i32, i32, i32, %"struct.ROHC::iphdr", i16, i16, %"class.ROHC::WLSB", [11 x i64] }
%"struct.ROHC::iphdr" = type { i8, i8, i16, i16, i16, i8, i8, i16, i32, i32 }
%"class.ROHC::WLSB" = type { %"class.std::vector", i64, i64, i64, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ROHC::WLSB<int>::LSB, std::allocator<ROHC::WLSB<int>::LSB>>::_Vector_impl" }
%"struct.std::_Vector_base<ROHC::WLSB<int>::LSB, std::allocator<ROHC::WLSB<int>::LSB>>::_Vector_impl" = type { %"struct.std::_Vector_base<ROHC::WLSB<int>::LSB, std::allocator<ROHC::WLSB<int>::LSB>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ROHC::WLSB<int>::LSB, std::allocator<ROHC::WLSB<int>::LSB>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4ROHC8CProfile10TOSChangedEPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(328), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4ROHC8CProfile10TTLChangedEPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(328), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ROHC11CRTPProfile29create_profile_1_7_flags1_encEbPKNS_5iphdrERSt6vectorIhSaIhEE(ptr noundef nonnull align 8 dereferenceable(445) %0, i1 noundef zeroext %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3) #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  %10 = zext i1 %1 to i8
  store i8 %10, ptr %6, align 1, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8
  %12 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %13 = trunc i8 %12 to i1
  br i1 %13, label %14, label %59

14:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  store i8 0, ptr %9, align 1, !tbaa !13
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = call noundef zeroext i1 @_ZNK4ROHC8CProfile10TTLChangedEPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(328) %11, ptr noundef %15)
  br i1 %16, label %17, label %22

17:                                               ; preds = %14
  %18 = load i8, ptr %9, align 1, !tbaa !13
  %19 = zext i8 %18 to i32
  %20 = or i32 %19, 64
  %21 = trunc i32 %20 to i8
  store i8 %21, ptr %9, align 1, !tbaa !13
  br label %22

22:                                               ; preds = %17, %14
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = call noundef zeroext i1 @_ZNK4ROHC8CProfile10TOSChangedEPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(328) %11, ptr noundef %23)
  br i1 %24, label %25, label %30

25:                                               ; preds = %22
  %26 = load i8, ptr %9, align 1, !tbaa !13
  %27 = zext i8 %26 to i32
  %28 = or i32 %27, 32
  %29 = trunc i32 %28 to i8
  store i8 %29, ptr %9, align 1, !tbaa !13
  br label %30

30:                                               ; preds = %25, %22
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = call noundef zeroext i1 @_ZN4ROHC15HasDontFragmentEPKNS_5iphdrE(ptr noundef %31)
  br i1 %32, label %33, label %38

33:                                               ; preds = %30
  %34 = load i8, ptr %9, align 1, !tbaa !13
  %35 = zext i8 %34 to i32
  %36 = or i32 %35, 16
  %37 = trunc i32 %36 to i8
  store i8 %37, ptr %9, align 1, !tbaa !13
  br label %38

38:                                               ; preds = %33, %30
  %39 = getelementptr inbounds %"class.ROHC::CProfile", ptr %11, i32 0, i32 15
  %40 = load i32, ptr %39, align 4, !tbaa !14
  %41 = trunc i32 %40 to i8
  %42 = zext i8 %41 to i32
  %43 = and i32 %42, 3
  %44 = shl i32 %43, 2
  %45 = load i8, ptr %9, align 1, !tbaa !13
  %46 = zext i8 %45 to i32
  %47 = or i32 %46, %44
  %48 = trunc i32 %47 to i8
  store i8 %48, ptr %9, align 1, !tbaa !13
  %49 = getelementptr inbounds %"class.ROHC::CProfile", ptr %11, i32 0, i32 14
  %50 = load i32, ptr %49, align 8, !tbaa !28
  %51 = trunc i32 %50 to i8
  %52 = zext i8 %51 to i32
  %53 = and i32 %52, 3
  %54 = load i8, ptr %9, align 1, !tbaa !13
  %55 = zext i8 %54 to i32
  %56 = or i32 %55, %53
  %57 = trunc i32 %56 to i8
  store i8 %57, ptr %9, align 1, !tbaa !13
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 1 dereferenceable(1) %9)
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  br label %59

59:                                               ; preds = %38, %4
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4ROHC15HasDontFragmentEPKNS_5iphdrE(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !25, i64 140}
!15 = !{!"_ZTSN4ROHC8CProfileE", !6, i64 8, !16, i64 16, !17, i64 24, !18, i64 32, !18, i64 36, !18, i64 40, !18, i64 44, !17, i64 48, !17, i64 56, !18, i64 64, !18, i64 68, !16, i64 72, !19, i64 80, !24, i64 136, !25, i64 140, !10, i64 144, !26, i64 148, !18, i64 152, !18, i64 156, !27, i64 160, !16, i64 180, !16, i64 182, !19, i64 184, !7, i64 240}
!16 = !{!"short", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSN4ROHC4WLSBIiEE", !20, i64 0, !17, i64 24, !17, i64 32, !17, i64 40, !18, i64 48, !18, i64 52}
!20 = !{!"_ZTSSt6vectorIN4ROHC4WLSBIiE3LSBESaIS3_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"_ZTSN4ROHC12Reordering_tE", !7, i64 0}
!25 = !{!"_ZTSN4ROHC15IPIDBehaviour_tE", !7, i64 0}
!26 = !{!"_ZTSN4ROHC8CProfileUt_E", !7, i64 0}
!27 = !{!"_ZTSN4ROHC5iphdrE", !7, i64 0, !7, i64 0, !7, i64 1, !16, i64 2, !16, i64 4, !16, i64 6, !7, i64 8, !7, i64 9, !16, i64 10, !18, i64 12, !18, i64 16}
!28 = !{!15, !24, i64 136}


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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4ROHC8CProfile10TOSChangedEPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(328), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4ROHC8CProfile10TTLChangedEPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(328), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ROHC11CRTPProfile29create_profile_1_7_flags1_encEbPKNS_5iphdrERSt6vectorIhSaIhEE(ptr noundef nonnull align 8 dereferenceable(445) %0, i1 noundef zeroext %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3) local_unnamed_addr #1 align 2 {
  %5 = alloca i8, align 1
  br i1 %1, label %6, label %24

6:                                                ; preds = %4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  %7 = tail call noundef zeroext i1 @_ZNK4ROHC8CProfile10TTLChangedEPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(328) %0, ptr noundef %2)
  %spec.select = select i1 %7, i8 64, i8 0
  %8 = tail call noundef zeroext i1 @_ZNK4ROHC8CProfile10TOSChangedEPKNS_5iphdrE(ptr noundef nonnull align 8 dereferenceable(328) %0, ptr noundef %2)
  %9 = or disjoint i8 %spec.select, 32
  %10 = select i1 %8, i8 %9, i8 %spec.select
  %11 = tail call noundef zeroext i1 @_ZN4ROHC15HasDontFragmentEPKNS_5iphdrE(ptr noundef %2)
  %12 = or disjoint i8 %10, 16
  %13 = select i1 %11, i8 %12, i8 %10
  %14 = getelementptr inbounds i8, ptr %0, i64 140
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %.tr = trunc i32 %15 to i8
  %16 = shl i8 %.tr, 2
  %17 = and i8 %16, 12
  %18 = or disjoint i8 %17, %13
  %19 = getelementptr inbounds i8, ptr %0, i64 136
  %20 = load i32, ptr %19, align 8, !tbaa !23
  %21 = trunc i32 %20 to i8
  %22 = and i8 %21, 3
  %23 = or i8 %22, %18
  store i8 %23, ptr %5, align 1, !tbaa !24
  call void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  br label %24

24:                                               ; preds = %6, %4
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4ROHC15HasDontFragmentEPKNS_5iphdrE(ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #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, !19, i64 140}
!6 = !{!"_ZTSN4ROHC8CProfileE", !7, i64 8, !10, i64 16, !11, i64 24, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !11, i64 48, !11, i64 56, !12, i64 64, !12, i64 68, !10, i64 72, !13, i64 80, !18, i64 136, !19, i64 140, !20, i64 144, !21, i64 148, !12, i64 152, !12, i64 156, !22, i64 160, !10, i64 180, !10, i64 182, !13, i64 184, !8, i64 240}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTSN4ROHC4WLSBIiEE", !14, i64 0, !11, i64 24, !11, i64 32, !11, i64 40, !12, i64 48, !12, i64 52}
!14 = !{!"_ZTSSt6vectorIN4ROHC4WLSBIiE3LSBESaIS3_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!18 = !{!"_ZTSN4ROHC12Reordering_tE", !8, i64 0}
!19 = !{!"_ZTSN4ROHC15IPIDBehaviour_tE", !8, i64 0}
!20 = !{!"bool", !8, i64 0}
!21 = !{!"_ZTSN4ROHC8CProfileUt_E", !8, i64 0}
!22 = !{!"_ZTSN4ROHC5iphdrE", !8, i64 0, !8, i64 0, !8, i64 1, !10, i64 2, !10, i64 4, !10, i64 6, !8, i64 8, !8, i64 9, !10, i64 10, !12, i64 12, !12, i64 16}
!23 = !{!6, !18, i64 136}
!24 = !{!8, !8, i64 0}


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