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

@.str.35 = external hidden unnamed_addr constant [47 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

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

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

; 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
define dso_local noundef zeroext i1 @_ZNK4ROHC11DRTPProfile28parse_profile_1_7_flags1_encEbRN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEERKS7_RbSB_SB_RNS_15IPIDBehaviour_tERNS_12Reordering_tE(ptr noundef nonnull align 8 dereferenceable(132) %0, i1 noundef zeroext %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull align 1 dereferenceable(1) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8) #4 align 2 {
  %10 = alloca i1, align 1
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i8, align 1
  %21 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  store ptr %0, ptr %11, align 8, !tbaa !5
  %22 = zext i1 %1 to i8
  store i8 %22, ptr %12, align 1, !tbaa !9
  store ptr %2, ptr %13, align 8, !tbaa !5
  store ptr %3, ptr %14, align 8, !tbaa !5
  store ptr %4, ptr %15, align 8, !tbaa !5
  store ptr %5, ptr %16, align 8, !tbaa !5
  store ptr %6, ptr %17, align 8, !tbaa !5
  store ptr %7, ptr %18, align 8, !tbaa !5
  store ptr %8, ptr %19, align 8, !tbaa !5
  %23 = load ptr, ptr %11, align 8
  %24 = load i8, ptr %12, align 1, !tbaa !9, !range !11, !noundef !12
  %25 = trunc i8 %24 to i1
  br i1 %25, label %26, label %65

26:                                               ; preds = %9
  %27 = load ptr, ptr %14, align 8, !tbaa !5
  %28 = load ptr, ptr %13, align 8, !tbaa !5
  %29 = call noundef i64 @_ZN9__gnu_cxxmiIPhSt6vectorIhSaIhEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28) #5
  %30 = icmp slt i64 %29, 1
  br i1 %30, label %31, label %32

31:                                               ; preds = %26
  call void (ptr, ...) @_ZN4ROHC5errorEPKcz(ptr noundef @.str.35)
  store i1 false, ptr %10, align 1
  br label %66

32:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %33, i32 noundef 0) #5
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %21, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  %36 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  %37 = load i8, ptr %36, align 1, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  store i8 %37, ptr %20, align 1, !tbaa !13
  %38 = load i8, ptr %20, align 1, !tbaa !13
  %39 = zext i8 %38 to i32
  %40 = and i32 %39, 64
  %41 = icmp sgt i32 %40, 0
  %42 = load ptr, ptr %15, align 8, !tbaa !5
  %43 = zext i1 %41 to i8
  store i8 %43, ptr %42, align 1, !tbaa !9
  %44 = load i8, ptr %20, align 1, !tbaa !13
  %45 = zext i8 %44 to i32
  %46 = and i32 %45, 32
  %47 = icmp sgt i32 %46, 0
  %48 = load ptr, ptr %16, align 8, !tbaa !5
  %49 = zext i1 %47 to i8
  store i8 %49, ptr %48, align 1, !tbaa !9
  %50 = load i8, ptr %20, align 1, !tbaa !13
  %51 = zext i8 %50 to i32
  %52 = and i32 %51, 16
  %53 = icmp sgt i32 %52, 0
  %54 = load ptr, ptr %17, align 8, !tbaa !5
  %55 = zext i1 %53 to i8
  store i8 %55, ptr %54, align 1, !tbaa !9
  %56 = load i8, ptr %20, align 1, !tbaa !13
  %57 = zext i8 %56 to i32
  %58 = ashr i32 %57, 2
  %59 = and i32 %58, 3
  %60 = load ptr, ptr %18, align 8, !tbaa !5
  store i32 %59, ptr %60, align 4, !tbaa !14
  %61 = load i8, ptr %20, align 1, !tbaa !13
  %62 = zext i8 %61 to i32
  %63 = and i32 %62, 3
  %64 = load ptr, ptr %19, align 8, !tbaa !5
  store i32 %63, ptr %64, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #5
  br label %65

65:                                               ; preds = %32, %9
  store i1 true, ptr %10, align 1
  br label %66

66:                                               ; preds = %65, %31
  %67 = load i1, ptr %10, align 1
  ret i1 %67
}

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 = { "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 = { 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 #4 = { 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 #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, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"_ZTSN4ROHC15IPIDBehaviour_tE", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"_ZTSN4ROHC12Reordering_tE", !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.35 = external hidden unnamed_addr constant [47 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

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

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

; 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
define dso_local noundef zeroext i1 @_ZNK4ROHC11DRTPProfile28parse_profile_1_7_flags1_encEbRN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEERKS7_RbSB_SB_RNS_15IPIDBehaviour_tERNS_12Reordering_tE(ptr nocapture noundef nonnull readnone align 8 dereferenceable(132) %0, i1 noundef zeroext %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(1) %4, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(1) %5, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(1) %6, ptr nocapture noundef nonnull writeonly align 4 dereferenceable(4) %7, ptr nocapture noundef nonnull writeonly align 4 dereferenceable(4) %8) local_unnamed_addr #4 align 2 {
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  br i1 %1, label %11, label %26

11:                                               ; preds = %9
  %12 = tail call noundef i64 @_ZN9__gnu_cxxmiIPhSt6vectorIhSaIhEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %13 = icmp slt i64 %12, 1
  br i1 %13, label %14, label %15

14:                                               ; preds = %11
  tail call void (ptr, ...) @_ZN4ROHC5errorEPKcz(ptr noundef nonnull @.str.35)
  br label %26

15:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %16 = tail call ptr @_ZN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef 0) #5
  store ptr %16, ptr %10, align 8
  %17 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %18 = load i8, ptr %17, align 1, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  %19 = zext i8 %18 to i32
  %20 = lshr i8 %18, 6
  %.lobit = and i8 %20, 1
  store i8 %.lobit, ptr %4, align 1, !tbaa !8
  %21 = lshr i8 %18, 5
  %.lobit15 = and i8 %21, 1
  store i8 %.lobit15, ptr %5, align 1, !tbaa !8
  %22 = lshr i8 %18, 4
  %.lobit16 = and i8 %22, 1
  store i8 %.lobit16, ptr %6, align 1, !tbaa !8
  %23 = lshr i32 %19, 2
  %24 = and i32 %23, 3
  store i32 %24, ptr %7, align 4, !tbaa !10
  %25 = and i32 %19, 3
  store i32 %25, ptr %8, align 4, !tbaa !12
  br label %26

26:                                               ; preds = %9, %15, %14
  %.0 = phi i1 [ false, %14 ], [ true, %15 ], [ true, %9 ]
  ret i1 %.0
}

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 = { "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 = { 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 #4 = { 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 #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"}
!8 = !{!9, !9, i64 0}
!9 = !{!"bool", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"_ZTSN4ROHC15IPIDBehaviour_tE", !6, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"_ZTSN4ROHC12Reordering_tE", !6, i64 0}


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