; 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::DProfile" = type <{ ptr, ptr, i16, [2 x i8], i32, i16, i16, i32, i32, i32, i64, i64, i8, [3 x i8], %"struct.ROHC::iphdr", i64, i32, [4 x i8] }>
%"struct.ROHC::iphdr" = type { i8, i8, i16, i16, i16, i8, i8, i16, i32, i32 }

@.str.17 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [27 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 @_ZN4ROHC11DRTPProfile15parse_pt_0_crc3ERN9__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 i8, align 1
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i16, align 2
  %14 = alloca i16, align 2
  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
  %15 = load ptr, ptr %5, align 8
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = call noundef i64 @_ZN9__gnu_cxxmiIPhSt6vectorIhSaIhEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  %19 = icmp slt i64 %18, 1
  br i1 %19, label %20, label %21

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

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

39:                                               ; preds = %21
  call void (ptr, ...) @_ZN4ROHC5errorEPKcz(ptr noundef @.str.18)
  call void @_ZN4ROHC8DProfile8SendNackEv(ptr noundef nonnull align 8 dereferenceable(92) %15)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %55

40:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #5
  %41 = load i8, ptr %8, align 1, !tbaa !9
  %42 = zext i8 %41 to i32
  %43 = ashr i32 %42, 3
  %44 = and i32 %43, 15
  %45 = trunc i32 %44 to i16
  store i16 %45, ptr %13, align 2, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #5
  %46 = load i16, ptr %13, align 2, !tbaa !10
  %47 = getelementptr inbounds %"class.ROHC::DProfile", ptr %15, i32 0, i32 5
  %48 = call noundef zeroext i16 @_ZNK4ROHC8DProfile9UpdateMSNEtjRt(ptr noundef nonnull align 8 dereferenceable(92) %15, i16 noundef zeroext %46, i32 noundef 4, ptr noundef nonnull align 2 dereferenceable(2) %47)
  store i16 %48, ptr %14, align 2, !tbaa !10
  %49 = load i16, ptr %14, align 2, !tbaa !10
  %50 = call noundef zeroext i1 @_ZN4ROHC11DRTPProfile24parse_inferred_scaled_tsEt(ptr noundef nonnull align 8 dereferenceable(132) %15, i16 noundef zeroext %49)
  br i1 %50, label %52, label %51

51:                                               ; preds = %40
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %54

52:                                               ; preds = %40
  %53 = load i16, ptr %14, align 2, !tbaa !10
  call void @_ZN4ROHC8DProfile31parse_inferred_sequential_ip_idEt(ptr noundef nonnull align 8 dereferenceable(92) %15, i16 noundef zeroext %53)
  store i1 true, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %54

54:                                               ; preds = %52, %51
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #5
  br label %55

55:                                               ; preds = %54, %39
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  br label %56

56:                                               ; preds = %55, %20
  %57 = load i1, ptr %4, align 1
  ret i1 %57
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4ROHC11DRTPProfile24parse_inferred_scaled_tsEt(ptr noundef nonnull align 8 dereferenceable(132), i16 noundef zeroext) #2 align 2

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

declare noundef zeroext i16 @_ZNK4ROHC8DProfile9UpdateMSNEtjRt(ptr noundef nonnull align 8 dereferenceable(92), i16 noundef zeroext, i32 noundef, ptr noundef nonnull align 2 dereferenceable(2)) #3

declare void @_ZN4ROHC8DProfile31parse_inferred_sequential_ip_idEt(ptr noundef nonnull align 8 dereferenceable(92), i16 noundef zeroext) #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}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !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.17 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [27 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 @_ZN4ROHC11DRTPProfile15parse_pt_0_crc3ERN9__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 %"class.__gnu_cxx::__normal_iterator.0", align 8
  %5 = alloca i8, align 1
  %6 = 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
  %7 = icmp slt i64 %6, 1
  br i1 %7, label %8, label %9

8:                                                ; preds = %3
  tail call void (ptr, ...) @_ZN4ROHC5errorEPKcz(ptr noundef nonnull @.str.17)
  br label %27

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

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

18:                                               ; preds = %9
  %19 = lshr i8 %12, 3
  %20 = and i8 %19, 15
  %21 = zext nneg i8 %20 to i16
  %22 = getelementptr inbounds i8, ptr %0, i64 24
  %23 = call noundef zeroext i16 @_ZNK4ROHC8DProfile9UpdateMSNEtjRt(ptr noundef nonnull align 8 dereferenceable(92) %0, i16 noundef zeroext %21, i32 noundef 4, ptr noundef nonnull align 2 dereferenceable(2) %22)
  %24 = call noundef zeroext i1 @_ZN4ROHC11DRTPProfile24parse_inferred_scaled_tsEt(ptr noundef nonnull align 8 dereferenceable(132) %0, i16 noundef zeroext %23)
  br i1 %24, label %25, label %26

25:                                               ; preds = %18
  call void @_ZN4ROHC8DProfile31parse_inferred_sequential_ip_idEt(ptr noundef nonnull align 8 dereferenceable(92) %0, i16 noundef zeroext %23)
  br label %26

26:                                               ; preds = %25, %18, %17
  %.1 = phi i1 [ false, %17 ], [ false, %18 ], [ true, %25 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  br label %27

27:                                               ; preds = %26, %8
  %.2 = phi i1 [ false, %8 ], [ %.1, %26 ]
  ret i1 %.2
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4ROHC11DRTPProfile24parse_inferred_scaled_tsEt(ptr noundef nonnull align 8 dereferenceable(132), i16 noundef zeroext) local_unnamed_addr #2 align 2

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

declare noundef zeroext i16 @_ZNK4ROHC8DProfile9UpdateMSNEtjRt(ptr noundef nonnull align 8 dereferenceable(92), i16 noundef zeroext, i32 noundef, ptr noundef nonnull align 2 dereferenceable(2)) local_unnamed_addr #3

declare void @_ZN4ROHC8DProfile31parse_inferred_sequential_ip_idEt(ptr noundef nonnull align 8 dereferenceable(92), i16 noundef zeroext) 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: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass