; LLVM IR from Columbitech/rohc :: src (drtp_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.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.ROHC::global_control" = type { i16, i32, i32, i32, i32, i32, i32, %"struct.ROHC::iphdr", i8, %"struct.ROHC::udphdr", %"struct.ROHC::rtphdr" }
%"struct.ROHC::iphdr" = type { i8, i8, i16, i16, i16, i8, i8, i16, i32, i32 }
%"struct.ROHC::udphdr" = type { i16, i16, i16, i16 }
%"struct.ROHC::rtphdr" = type { i16, i16, i32, i32 }

@.str.10 = external hidden unnamed_addr constant [55 x i8], align 1

; 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) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ROHC11DRTPProfile25parse_udp_regular_dynamicERNS_14global_controlERN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEESA_(ptr noundef nonnull align 4 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr %2) #1 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %2, ptr %9, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  %10 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %5, i64 8, i1 false), !tbaa.struct !9
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = getelementptr inbounds %"struct.ROHC::global_control", ptr %11, i32 0, i32 9
  %13 = getelementptr inbounds %"struct.ROHC::udphdr", ptr %12, i32 0, i32 3
  %14 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %15 = load ptr, ptr %14, align 8
  %16 = call noundef zeroext i1 @_ZN4ROHC8GetValueItN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEEbRT0_S9_RT_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr %15, ptr noundef nonnull align 2 dereferenceable(2) %13)
  br i1 %16, label %18, label %17

17:                                               ; preds = %3
  call void (ptr, ...) @_ZN4ROHC5errorEPKcz(ptr noundef @.str.10)
  store i1 false, ptr %4, align 1
  br label %28

18:                                               ; preds = %3
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.ROHC::global_control", ptr %19, i32 0, i32 9
  %21 = getelementptr inbounds %"struct.ROHC::udphdr", ptr %20, i32 0, i32 3
  %22 = load i16, ptr %21, align 2, !tbaa !10
  %23 = zext i16 %22 to i32
  %24 = icmp ne i32 %23, 0
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.ROHC::global_control", ptr %25, i32 0, i32 8
  %27 = zext i1 %24 to i8
  store i8 %27, ptr %26, align 4, !tbaa !20
  store i1 true, ptr %4, align 1
  br label %28

28:                                               ; preds = %18, %17
  %29 = load i1, ptr %4, align 1
  ret i1 %29
}

declare void @_ZN4ROHC5errorEPKcz(ptr noundef, ...) #2

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

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

!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 = !{i64 0, i64 8, !5}
!10 = !{!11, !12, i64 56}
!11 = !{!"_ZTSN4ROHC14global_controlE", !12, i64 0, !13, i64 4, !14, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !16, i64 28, !17, i64 48, !18, i64 50, !19, i64 60}
!12 = !{!"short", !7, i64 0}
!13 = !{!"_ZTSN4ROHC12Reordering_tE", !7, i64 0}
!14 = !{!"_ZTSN4ROHC15IPIDBehaviour_tE", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN4ROHC5iphdrE", !7, i64 0, !7, i64 0, !7, i64 1, !12, i64 2, !12, i64 4, !12, i64 6, !7, i64 8, !7, i64 9, !12, i64 10, !15, i64 12, !15, i64 16}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"_ZTSN4ROHC6udphdrE", !12, i64 0, !12, i64 2, !12, i64 4, !12, i64 6}
!19 = !{!"_ZTSN4ROHC6rtphdrE", !7, i64 0, !7, i64 0, !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !12, i64 2, !15, i64 4, !15, i64 8}
!20 = !{!11, !17, i64 48}


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

@.str.10 = external hidden unnamed_addr constant [55 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ROHC11DRTPProfile25parse_udp_regular_dynamicERNS_14global_controlERN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEESA_(ptr noundef nonnull align 4 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr %2) local_unnamed_addr #0 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 56
  %5 = tail call noundef zeroext i1 @_ZN4ROHC8GetValueItN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEEbRT0_S9_RT_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr %2, ptr noundef nonnull align 2 dereferenceable(2) %4)
  br i1 %5, label %7, label %6

6:                                                ; preds = %3
  tail call void (ptr, ...) @_ZN4ROHC5errorEPKcz(ptr noundef nonnull @.str.10)
  br label %12

7:                                                ; preds = %3
  %8 = load i16, ptr %4, align 4, !tbaa !5
  %9 = icmp ne i16 %8, 0
  %10 = getelementptr inbounds i8, ptr %0, i64 48
  %11 = zext i1 %9 to i8
  store i8 %11, ptr %10, align 4, !tbaa !17
  br label %12

12:                                               ; preds = %7, %6
  ret i1 %5
}

declare void @_ZN4ROHC5errorEPKcz(ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4ROHC8GetValueItN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEEbRT0_S9_RT_(ptr noundef nonnull align 8 dereferenceable(8), ptr, ptr noundef nonnull align 2 dereferenceable(2)) local_unnamed_addr #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 = { "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 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" }

!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, !7, i64 56}
!6 = !{!"_ZTSN4ROHC14global_controlE", !7, i64 0, !10, i64 4, !11, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !13, i64 28, !14, i64 48, !15, i64 50, !16, i64 60}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4ROHC12Reordering_tE", !8, i64 0}
!11 = !{!"_ZTSN4ROHC15IPIDBehaviour_tE", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTSN4ROHC5iphdrE", !8, i64 0, !8, i64 0, !8, i64 1, !7, i64 2, !7, i64 4, !7, i64 6, !8, i64 8, !8, i64 9, !7, i64 10, !12, i64 12, !12, i64 16}
!14 = !{!"bool", !8, i64 0}
!15 = !{!"_ZTSN4ROHC6udphdrE", !7, i64 0, !7, i64 2, !7, i64 4, !7, i64 6}
!16 = !{!"_ZTSN4ROHC6rtphdrE", !8, i64 0, !8, i64 0, !8, i64 0, !8, i64 0, !8, i64 1, !8, i64 1, !7, i64 2, !12, i64 4, !12, i64 8}
!17 = !{!6, !14, i64 48}


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