; 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.0" = type { ptr }
%"class.ROHC::DRTPProfile" = type { %"class.ROHC::DProfile.base", i32, i32, i32, i32, i8, %"struct.ROHC::udphdr", %"struct.ROHC::rtphdr", [4 x i8] }
%"class.ROHC::DProfile.base" = type <{ ptr, ptr, i16, [2 x i8], i32, i16, i16, i32, i32, i32, i64, i64, i8, [3 x i8], %"struct.ROHC::iphdr", i64, i32 }>
%"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.25 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [29 x i8], align 1

; 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 nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ROHC11DRTPProfile17parse_pt_1_seq_tsERN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEERKS7_(ptr noundef nonnull align 8 dereferenceable(132) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #2 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca [2 x i8], align 1
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  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
  %14 = load ptr, ptr %5, align 8
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = call noundef i64 @_ZN9__gnu_cxxmiIPhSt6vectorIhSaIhEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %18 = icmp slt i64 %17, 2
  br i1 %18, label %19, label %20

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

20:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %21, i32 noundef 0) #5
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %9, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  %24 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = getelementptr inbounds [2 x i8], ptr %8, i64 0, i64 0
  store i8 %25, ptr %26, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %27, i32 noundef 0) #5
  %29 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %10, i32 0, i32 0
  store ptr %28, ptr %29, align 8
  %30 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = getelementptr inbounds [2 x i8], ptr %8, i64 0, i64 1
  store i8 %31, ptr %32, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  %33 = getelementptr inbounds [2 x i8], ptr %8, i64 0, i64 1
  %34 = load i8, ptr %33, align 1, !tbaa !9
  store i8 %34, ptr %11, align 1, !tbaa !9
  %35 = getelementptr inbounds [2 x i8], ptr %8, i64 0, i64 1
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %37 = zext i8 %36 to i32
  %38 = and i32 %37, 248
  %39 = trunc i32 %38 to i8
  store i8 %39, ptr %35, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  %40 = getelementptr inbounds [2 x i8], ptr %8, i64 0, i64 0
  %41 = getelementptr inbounds [2 x i8], ptr %8, i64 0, i64 0
  %42 = getelementptr inbounds i8, ptr %41, i64 2
  %43 = call noundef zeroext i8 @_ZN4ROHC4CRC3EPKhS1_(ptr noundef %40, ptr noundef %42)
  store i8 %43, ptr %12, align 1, !tbaa !9
  %44 = load i8, ptr %12, align 1, !tbaa !9
  %45 = zext i8 %44 to i32
  %46 = load i8, ptr %11, align 1, !tbaa !9
  %47 = zext i8 %46 to i32
  %48 = and i32 %47, 7
  %49 = icmp ne i32 %45, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %20
  call void (ptr, ...) @_ZN4ROHC5errorEPKcz(ptr noundef @.str.26)
  call void @_ZN4ROHC8DProfile8SendNackEv(ptr noundef nonnull align 8 dereferenceable(92) %14)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %64

51:                                               ; preds = %20
  %52 = getelementptr inbounds [2 x i8], ptr %8, i64 0, i64 0
  %53 = load i8, ptr %52, align 1, !tbaa !9
  %54 = zext i8 %53 to i32
  %55 = and i32 %54, 16
  %56 = trunc i32 %55 to i8
  %57 = getelementptr inbounds %"class.ROHC::DRTPProfile", ptr %14, i32 0, i32 7
  %58 = zext i8 %56 to i16
  %59 = load i16, ptr %57, align 8
  %60 = and i16 %58, 1
  %61 = shl i16 %60, 15
  %62 = and i16 %59, 32767
  %63 = or i16 %62, %61
  store i16 %63, ptr %57, align 8
  store i1 true, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %64

64:                                               ; preds = %51, %50
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #5
  br label %65

65:                                               ; preds = %64, %19
  %66 = load i1, ptr %4, align 1
  ret i1 %66
}

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

declare void @_ZN4ROHC8DProfile8SendNackEv(ptr noundef nonnull align 8 dereferenceable(92)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN9__gnu_cxxmiIPhSt6vectorIhSaIhEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1 align 2

declare noundef zeroext i8 @_ZN4ROHC4CRC3EPKhS1_(ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 #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 = !{!7, !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"

%"class.__gnu_cxx::__normal_iterator.0" = type { ptr }

@.str.25 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [29 x i8], align 1

; 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 nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ROHC11DRTPProfile17parse_pt_1_seq_tsERN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEERKS7_(ptr noundef nonnull align 8 dereferenceable(132) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) local_unnamed_addr #2 align 2 {
  %4 = alloca [2 x i8], align 1
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %7 = tail call noundef i64 @_ZN9__gnu_cxxmiIPhSt6vectorIhSaIhEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %1) #5
  %8 = icmp slt i64 %7, 2
  br i1 %8, label %9, label %10

9:                                                ; preds = %3
  tail call void (ptr, ...) @_ZN4ROHC5errorEPKcz(ptr noundef nonnull @.str.25)
  br label %28

10:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %11 = tail call ptr @_ZN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 0) #5
  store ptr %11, ptr %5, align 8
  %12 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %13 = load i8, ptr %12, align 1, !tbaa !5
  store i8 %13, ptr %4, align 1, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %14 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 0) #5
  store ptr %14, ptr %6, align 8
  %15 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %16 = load i8, ptr %15, align 1, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %4, i64 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %18 = and i8 %16, -8
  store i8 %18, ptr %17, align 1, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %4, i64 2
  %20 = call noundef zeroext i8 @_ZN4ROHC4CRC3EPKhS1_(ptr noundef nonnull %4, ptr noundef nonnull %19)
  %21 = and i8 %16, 7
  %.not = icmp eq i8 %20, %21
  br i1 %.not, label %23, label %22

22:                                               ; preds = %10
  call void (ptr, ...) @_ZN4ROHC5errorEPKcz(ptr noundef nonnull @.str.26)
  call void @_ZN4ROHC8DProfile8SendNackEv(ptr noundef nonnull align 8 dereferenceable(92) %0)
  br label %27

23:                                               ; preds = %10
  %24 = getelementptr inbounds i8, ptr %0, i64 120
  %25 = load i16, ptr %24, align 8
  %26 = and i16 %25, 32767
  store i16 %26, ptr %24, align 8
  br label %27

27:                                               ; preds = %23, %22
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %4) #5
  br label %28

28:                                               ; preds = %27, %9
  %.1 = phi i1 [ false, %9 ], [ %.not, %27 ]
  ret i1 %.1
}

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

declare void @_ZN4ROHC8DProfile8SendNackEv(ptr noundef nonnull align 8 dereferenceable(92)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN9__gnu_cxxmiIPhSt6vectorIhSaIhEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i8 @_ZN4ROHC4CRC3EPKhS1_(ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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