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

; 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::CRTPProfile" = type <{ %"class.ROHC::CProfile", %"class.std::vector.0", i16, i16, %"struct.ROHC::rtphdr", i32, i32, i32, i32, %"class.ROHC::WLSB.5", i32, i8, [3 x i8] }>
%"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 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<ROHC::CRTPProfile::CSRCItem, std::allocator<ROHC::CRTPProfile::CSRCItem>>::_Vector_impl" }
%"struct.std::_Vector_base<ROHC::CRTPProfile::CSRCItem, std::allocator<ROHC::CRTPProfile::CSRCItem>>::_Vector_impl" = type { %"struct.std::_Vector_base<ROHC::CRTPProfile::CSRCItem, std::allocator<ROHC::CRTPProfile::CSRCItem>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ROHC::CRTPProfile::CSRCItem, std::allocator<ROHC::CRTPProfile::CSRCItem>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.ROHC::rtphdr" = type { i16, i16, i32, i32 }
%"class.ROHC::WLSB.5" = type { %"class.std::vector.6", i64, i64, i64, i32, i32 }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<ROHC::WLSB<unsigned int>::LSB, std::allocator<ROHC::WLSB<unsigned int>::LSB>>::_Vector_impl" }
%"struct.std::_Vector_base<ROHC::WLSB<unsigned int>::LSB, std::allocator<ROHC::WLSB<unsigned int>::LSB>>::_Vector_impl" = type { %"struct.std::_Vector_base<ROHC::WLSB<unsigned int>::LSB, std::allocator<ROHC::WLSB<unsigned int>::LSB>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ROHC::WLSB<unsigned int>::LSB, std::allocator<ROHC::WLSB<unsigned 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
define dso_local void @_ZN4ROHC11CRTPProfile20UpdateRtpInformationEPKNS_6rtphdrE(ptr noundef nonnull align 8 dereferenceable(445) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  %7 = getelementptr inbounds %"class.ROHC::CRTPProfile", ptr %6, i32 0, i32 4
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %8, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %"struct.ROHC::rtphdr", ptr %9, i32 0, i32 2
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = call noundef i32 @_ZN4ROHC10rohc_htonlEj(i32 noundef %11)
  store i32 %12, ptr %5, align 4, !tbaa !13
  %13 = load i32, ptr %5, align 4, !tbaa !13
  %14 = getelementptr inbounds %"class.ROHC::CRTPProfile", ptr %6, i32 0, i32 10
  %15 = load i32, ptr %14, align 8, !tbaa !14
  %16 = udiv i32 %13, %15
  %17 = getelementptr inbounds %"class.ROHC::CRTPProfile", ptr %6, i32 0, i32 5
  store i32 %16, ptr %17, align 8, !tbaa !37
  %18 = load i32, ptr %5, align 4, !tbaa !13
  %19 = getelementptr inbounds %"class.ROHC::CRTPProfile", ptr %6, i32 0, i32 10
  %20 = load i32, ptr %19, align 8, !tbaa !14
  %21 = urem i32 %18, %20
  %22 = getelementptr inbounds %"class.ROHC::CRTPProfile", ptr %6, i32 0, i32 6
  store i32 %21, ptr %22, align 4, !tbaa !38
  %23 = getelementptr inbounds %"class.ROHC::CRTPProfile", ptr %6, i32 0, i32 9
  %24 = getelementptr inbounds %"class.ROHC::CProfile", ptr %6, i32 0, i32 12
  %25 = load i16, ptr %24, align 8, !tbaa !39
  %26 = getelementptr inbounds %"class.ROHC::CRTPProfile", ptr %6, i32 0, i32 5
  %27 = load i32, ptr %26, align 8, !tbaa !37
  call void @_ZN4ROHC4WLSBIjE3addEtj(ptr noundef nonnull align 8 dereferenceable(56) %23, i16 noundef zeroext %25, i32 noundef %27)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4ROHC10rohc_htonlEj(i32 noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ROHC4WLSBIjE3addEtj(ptr noundef nonnull align 8 dereferenceable(56), i16 noundef zeroext, i32 noundef) #4 align 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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, !12, i64 4}
!10 = !{!"_ZTSN4ROHC6rtphdrE", !7, i64 0, !7, i64 0, !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !11, i64 2, !12, i64 4, !12, i64 8}
!11 = !{!"short", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!15, !12, i64 440}
!15 = !{!"_ZTSN4ROHC11CRTPProfileE", !16, i64 0, !28, i64 328, !11, i64 352, !11, i64 354, !10, i64 356, !12, i64 368, !12, i64 372, !12, i64 376, !12, i64 380, !32, i64 384, !12, i64 440, !25, i64 444}
!16 = !{!"_ZTSN4ROHC8CProfileE", !6, i64 8, !11, i64 16, !17, i64 24, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !17, i64 48, !17, i64 56, !12, i64 64, !12, i64 68, !11, i64 72, !18, i64 80, !23, i64 136, !24, i64 140, !25, i64 144, !26, i64 148, !12, i64 152, !12, i64 156, !27, i64 160, !11, i64 180, !11, i64 182, !18, i64 184, !7, i64 240}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN4ROHC4WLSBIiEE", !19, i64 0, !17, i64 24, !17, i64 32, !17, i64 40, !12, i64 48, !12, i64 52}
!19 = !{!"_ZTSSt6vectorIN4ROHC4WLSBIiE3LSBESaIS3_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSN4ROHC12Reordering_tE", !7, i64 0}
!24 = !{!"_ZTSN4ROHC15IPIDBehaviour_tE", !7, i64 0}
!25 = !{!"bool", !7, i64 0}
!26 = !{!"_ZTSN4ROHC8CProfileUt_E", !7, i64 0}
!27 = !{!"_ZTSN4ROHC5iphdrE", !7, i64 0, !7, i64 0, !7, i64 1, !11, i64 2, !11, i64 4, !11, i64 6, !7, i64 8, !7, i64 9, !11, i64 10, !12, i64 12, !12, i64 16}
!28 = !{!"_ZTSSt6vectorIN4ROHC11CRTPProfile8CSRCItemESaIS2_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIN4ROHC11CRTPProfile8CSRCItemESaIS2_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIN4ROHC11CRTPProfile8CSRCItemESaIS2_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN4ROHC11CRTPProfile8CSRCItemESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!"_ZTSN4ROHC4WLSBIjEE", !33, i64 0, !17, i64 24, !17, i64 32, !17, i64 40, !12, i64 48, !12, i64 52}
!33 = !{!"_ZTSSt6vectorIN4ROHC4WLSBIjE3LSBESaIS3_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseIN4ROHC4WLSBIjE3LSBESaIS3_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIjE3LSBESaIS3_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIjE3LSBESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = !{!15, !12, i64 368}
!38 = !{!15, !12, i64 372}
!39 = !{!16, !11, i64 72}


; 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 nounwind uwtable
define dso_local void @_ZN4ROHC11CRTPProfile20UpdateRtpInformationEPKNS_6rtphdrE(ptr noundef nonnull align 8 dereferenceable(445) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 356
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %1, i64 12, i1 false)
  %4 = getelementptr inbounds i8, ptr %1, i64 4
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = tail call noundef i32 @_ZN4ROHC10rohc_htonlEj(i32 noundef %5)
  %7 = getelementptr inbounds i8, ptr %0, i64 440
  %8 = load i32, ptr %7, align 8, !tbaa !11
  %9 = udiv i32 %6, %8
  %10 = getelementptr inbounds i8, ptr %0, i64 368
  store i32 %9, ptr %10, align 8, !tbaa !35
  %11 = urem i32 %6, %8
  %12 = getelementptr inbounds i8, ptr %0, i64 372
  store i32 %11, ptr %12, align 4, !tbaa !36
  %13 = getelementptr inbounds i8, ptr %0, i64 384
  %14 = getelementptr inbounds i8, ptr %0, i64 72
  %15 = load i16, ptr %14, align 8, !tbaa !37
  tail call void @_ZN4ROHC4WLSBIjE3addEtj(ptr noundef nonnull align 8 dereferenceable(56) %13, i16 noundef zeroext %15, i32 noundef %9)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4ROHC10rohc_htonlEj(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ROHC4WLSBIjE3addEtj(ptr noundef nonnull align 8 dereferenceable(56), i16 noundef zeroext, i32 noundef) local_unnamed_addr #0 align 2

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 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }

!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, !10, i64 4}
!6 = !{!"_ZTSN4ROHC6rtphdrE", !7, i64 0, !7, i64 0, !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !9, i64 2, !10, i64 4, !10, i64 8}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"short", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 440}
!12 = !{!"_ZTSN4ROHC11CRTPProfileE", !13, i64 0, !26, i64 328, !9, i64 352, !9, i64 354, !6, i64 356, !10, i64 368, !10, i64 372, !10, i64 376, !10, i64 380, !30, i64 384, !10, i64 440, !23, i64 444}
!13 = !{!"_ZTSN4ROHC8CProfileE", !14, i64 8, !9, i64 16, !15, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !15, i64 48, !15, i64 56, !10, i64 64, !10, i64 68, !9, i64 72, !16, i64 80, !21, i64 136, !22, i64 140, !23, i64 144, !24, i64 148, !10, i64 152, !10, i64 156, !25, i64 160, !9, i64 180, !9, i64 182, !16, i64 184, !7, i64 240}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTSN4ROHC4WLSBIiEE", !17, i64 0, !15, i64 24, !15, i64 32, !15, i64 40, !10, i64 48, !10, i64 52}
!17 = !{!"_ZTSSt6vectorIN4ROHC4WLSBIiE3LSBESaIS3_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIiE3LSBESaIS3_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!21 = !{!"_ZTSN4ROHC12Reordering_tE", !7, i64 0}
!22 = !{!"_ZTSN4ROHC15IPIDBehaviour_tE", !7, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTSN4ROHC8CProfileUt_E", !7, i64 0}
!25 = !{!"_ZTSN4ROHC5iphdrE", !7, i64 0, !7, i64 0, !7, i64 1, !9, i64 2, !9, i64 4, !9, i64 6, !7, i64 8, !7, i64 9, !9, i64 10, !10, i64 12, !10, i64 16}
!26 = !{!"_ZTSSt6vectorIN4ROHC11CRTPProfile8CSRCItemESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIN4ROHC11CRTPProfile8CSRCItemESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN4ROHC11CRTPProfile8CSRCItemESaIS2_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN4ROHC11CRTPProfile8CSRCItemESaIS2_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!30 = !{!"_ZTSN4ROHC4WLSBIjEE", !31, i64 0, !15, i64 24, !15, i64 32, !15, i64 40, !10, i64 48, !10, i64 52}
!31 = !{!"_ZTSSt6vectorIN4ROHC4WLSBIjE3LSBESaIS3_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseIN4ROHC4WLSBIjE3LSBESaIS3_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIjE3LSBESaIS3_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIN4ROHC4WLSBIjE3LSBESaIS3_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!35 = !{!12, !10, i64 368}
!36 = !{!12, !10, i64 372}
!37 = !{!13, !9, i64 72}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass