; LLVM IR from Columbitech/rohc :: src (dudp_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.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 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 @_ZN4ROHC11DUDPProfile16parse_udp_staticERNS_14global_controlERN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEESB_(ptr noundef nonnull align 4 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #1 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %10 = load ptr, ptr %6, align 8, !tbaa !5
  %11 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !9
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.ROHC::global_control", ptr %12, i32 0, i32 9
  %14 = getelementptr inbounds %"struct.ROHC::udphdr", ptr %13, i32 0, i32 0
  %15 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8
  %17 = call noundef zeroext i1 @_ZN4ROHC8GetValueItN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEEbRT0_S9_RT_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr %16, ptr noundef nonnull align 2 dereferenceable(2) %14)
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %3
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %21, i64 8, i1 false), !tbaa.struct !9
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.ROHC::global_control", ptr %22, i32 0, i32 9
  %24 = getelementptr inbounds %"struct.ROHC::udphdr", ptr %23, i32 0, i32 1
  %25 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8
  %27 = call noundef zeroext i1 @_ZN4ROHC8GetValueItN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEEbRT0_S9_RT_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr %26, ptr noundef nonnull align 2 dereferenceable(2) %24)
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %19
  store i1 true, ptr %4, align 1
  br label %30

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

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

declare void @_ZN4ROHC5errorEPKcz(ptr noundef, ...) #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 = { 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 = { "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}


; 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.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ROHC11DUDPProfile16parse_udp_staticERNS_14global_controlERN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEESB_(ptr noundef nonnull align 4 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %2) local_unnamed_addr #0 align 2 {
  %.sroa.01.0.copyload = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 50
  %5 = tail call noundef zeroext i1 @_ZN4ROHC8GetValueItN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEEbRT0_S9_RT_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr %.sroa.01.0.copyload, ptr noundef nonnull align 2 dereferenceable(2) %4)
  br i1 %5, label %6, label %.sink.split

6:                                                ; preds = %3
  %.sroa.0.0.copyload = load ptr, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 52
  %8 = tail call noundef zeroext i1 @_ZN4ROHC8GetValueItN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEEbRT0_S9_RT_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr %.sroa.0.0.copyload, ptr noundef nonnull align 2 dereferenceable(2) %7)
  br i1 %8, label %9, label %.sink.split

.sink.split:                                      ; preds = %6, %3
  %.str.7.sink = phi ptr [ @.str.6, %3 ], [ @.str.7, %6 ]
  tail call void (ptr, ...) @_ZN4ROHC5errorEPKcz(ptr noundef nonnull %.str.7.sink)
  br label %9

9:                                                ; preds = %.sink.split, %6
  %.0 = phi i1 [ true, %6 ], [ false, %.sink.split ]
  ret i1 %.0
}

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

declare void @_ZN4ROHC5errorEPKcz(ptr noundef, ...) 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 = { 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 = { "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"}


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