; LLVM IR from dmr-goncalves/HumanAwareRobotNavigation :: src/husky/husky_base/src/horizon_legacy (Transport)

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

%"struct.std::_List_iterator" = type { ptr }
%"struct.std::_List_const_iterator" = type { ptr }
%"class.clearpath::Transport" = type { i8, ptr, i32, %"class.std::__cxx11::list", [4 x i64] }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<clearpath::Message *, std::allocator<clearpath::Message *>>::_List_impl" }
%"struct.std::__cxx11::_List_base<clearpath::Message *, std::allocator<clearpath::Message *>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }

@_ZTIPN9clearpath18TransportExceptionE = external dso_local constant { ptr, ptr, i32, ptr }, align 8
@.str.16 = external hidden unnamed_addr constant [25 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9clearpath9Transport4pollEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN9clearpath7MessageEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

declare noundef zeroext i16 @_ZN9clearpath7Message7getTypeEv(ptr noundef nonnull align 8 dereferenceable(273)) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5eraseESt20_List_const_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(24), ptr) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt20_List_const_iteratorIPN9clearpath7MessageEEC2ERKSt14_List_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9clearpath9Transport5flushENS_12MessageTypesEPNSt7__cxx114listIPNS_7MessageESaIS5_EEE(ptr noundef nonnull align 8 dereferenceable(80) %0, i32 noundef %1, ptr noundef %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::_List_iterator", align 8
  %10 = alloca %"struct.std::_List_iterator", align 8
  %11 = alloca %"struct.std::_List_iterator", align 8
  %12 = alloca %"struct.std::_List_const_iterator", align 8
  %13 = alloca %"struct.std::_List_iterator", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  br label %15

15:                                               ; preds = %3
  %16 = getelementptr inbounds %"class.clearpath::Transport", ptr %14, i32 0, i32 0
  %17 = load i8, ptr %16, align 8, !tbaa !11, !range !21, !noundef !22
  %18 = trunc i8 %17 to i1
  br i1 %18, label %33, label %19

19:                                               ; preds = %15
  %20 = call ptr @__cxa_allocate_exception(i64 8) #7
  %21 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #8
          to label %22 unwind label %24

22:                                               ; preds = %19
  invoke void @_ZN9clearpath18TransportExceptionC1EPKcNS0_6errorsE(ptr noundef nonnull align 8 dereferenceable(12) %21, ptr noundef @.str.16, i32 noundef 1)
          to label %23 unwind label %28

23:                                               ; preds = %22
  store ptr %21, ptr %20, align 16, !tbaa !5
  call void @__cxa_throw(ptr %20, ptr @_ZTIPN9clearpath18TransportExceptionE, ptr null) #9
  unreachable

24:                                               ; preds = %19
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %7, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %8, align 4
  br label %32

28:                                               ; preds = %22
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %7, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %21, i64 noundef 16) #10
  br label %32

32:                                               ; preds = %28, %24
  call void @__cxa_free_exception(ptr %20) #7
  br label %76

33:                                               ; preds = %15
  br label %34

34:                                               ; preds = %33
  call void @_ZN9clearpath9Transport4pollEv(ptr noundef nonnull align 8 dereferenceable(80) %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %35 = getelementptr inbounds %"class.clearpath::Transport", ptr %14, i32 0, i32 3
  %36 = call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #7
  %37 = getelementptr inbounds %"struct.std::_List_iterator", ptr %9, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  br label %38

38:                                               ; preds = %74, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %39 = getelementptr inbounds %"class.clearpath::Transport", ptr %14, i32 0, i32 3
  %40 = call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #7
  %41 = getelementptr inbounds %"struct.std::_List_iterator", ptr %10, i32 0, i32 0
  store ptr %40, ptr %41, align 8
  %42 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIPN9clearpath7MessageEES5_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br i1 %42, label %43, label %75

43:                                               ; preds = %38
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN9clearpath7MessageEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = call noundef zeroext i16 @_ZN9clearpath7Message7getTypeEv(ptr noundef nonnull align 8 dereferenceable(273) %45)
  %47 = zext i16 %46 to i32
  %48 = load i32, ptr %5, align 4, !tbaa !9
  %49 = icmp eq i32 %47, %48
  br i1 %49, label %50, label %71

50:                                               ; preds = %43
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %56

53:                                               ; preds = %50
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN9clearpath7MessageEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr noundef nonnull align 8 dereferenceable(8) %55)
  br label %65

56:                                               ; preds = %50
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN9clearpath7MessageEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = icmp eq ptr %58, null
  br i1 %59, label %64, label %60

60:                                               ; preds = %56
  %61 = load ptr, ptr %58, align 8, !tbaa !23
  %62 = getelementptr inbounds ptr, ptr %61, i64 1
  %63 = load ptr, ptr %62, align 8
  call void %63(ptr noundef nonnull align 8 dereferenceable(273) %58) #7
  br label %64

64:                                               ; preds = %60, %56
  br label %65

65:                                               ; preds = %64, %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %66 = getelementptr inbounds %"class.clearpath::Transport", ptr %14, i32 0, i32 3
  call void @_ZNSt20_List_const_iteratorIPN9clearpath7MessageEEC2ERKSt14_List_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %67 = getelementptr inbounds %"struct.std::_List_const_iterator", ptr %12, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8
  %69 = call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5eraseESt20_List_const_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(24) %66, ptr %68) #7
  %70 = getelementptr inbounds %"struct.std::_List_iterator", ptr %11, i32 0, i32 0
  store ptr %69, ptr %70, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %74

71:                                               ; preds = %43
  %72 = call ptr @_ZNSt14_List_iteratorIPN9clearpath7MessageEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef 0) #7
  %73 = getelementptr inbounds %"struct.std::_List_iterator", ptr %13, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  br label %74

74:                                               ; preds = %71, %65
  br label %38, !llvm.loop !26

75:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  ret void

76:                                               ; preds = %32
  %77 = load ptr, ptr %7, align 8
  %78 = load i32, ptr %8, align 4
  %79 = insertvalue { ptr, i32 } poison, ptr %77, 0
  %80 = insertvalue { ptr, i32 } %79, i32 %78, 1
  resume { ptr, i32 } %80
}

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

declare void @_ZN9clearpath18TransportExceptionC1EPKcNS0_6errorsE(ptr, ptr, i32)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { "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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { noreturn }
attributes #10 = { builtin 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 = !{!"_ZTSN9clearpath12MessageTypesE", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN9clearpath9TransportE", !13, i64 0, !6, i64 8, !14, i64 16, !15, i64 24, !7, i64 48}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSNSt7__cxx114listIPN9clearpath7MessageESaIS3_EEE", !16, i64 0}
!16 = !{!"_ZTSNSt7__cxx1110_List_baseIPN9clearpath7MessageESaIS3_EEE", !17, i64 0}
!17 = !{!"_ZTSNSt7__cxx1110_List_baseIPN9clearpath7MessageESaIS3_EE10_List_implE", !18, i64 0}
!18 = !{!"_ZTSNSt8__detail17_List_node_headerE", !19, i64 0, !20, i64 16}
!19 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!20 = !{!"long", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !8, i64 0}
!25 = !{i64 0, i64 8, !5}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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

%"struct.std::_List_iterator" = type { ptr }
%"struct.std::_List_const_iterator" = type { ptr }

@_ZTIPN9clearpath18TransportExceptionE = external dso_local constant { ptr, ptr, i32, ptr }, align 8
@.str.16 = external hidden unnamed_addr constant [25 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @__cxa_free_exception(ptr) local_unnamed_addr

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9clearpath9Transport4pollEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt14_List_iteratorIPN9clearpath7MessageEES5_(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 @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN9clearpath7MessageEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

declare noundef zeroext i16 @_ZN9clearpath7Message7getTypeEv(ptr noundef nonnull align 8 dereferenceable(273)) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5eraseESt20_List_const_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(24), ptr) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt20_List_const_iteratorIPN9clearpath7MessageEEC2ERKSt14_List_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9clearpath9Transport5flushENS_12MessageTypesEPNSt7__cxx114listIPNS_7MessageESaIS5_EEE(ptr noundef nonnull align 8 dereferenceable(80) %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.std::_List_iterator", align 8
  %5 = alloca %"struct.std::_List_iterator", align 8
  %6 = alloca %"struct.std::_List_const_iterator", align 8
  %7 = load i8, ptr %0, align 8, !tbaa !5, !range !18, !noundef !19
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %19, label %9

9:                                                ; preds = %3
  %10 = tail call ptr @__cxa_allocate_exception(i64 8) #6
  %11 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #7
          to label %12 unwind label %14

12:                                               ; preds = %9
  invoke void @_ZN9clearpath18TransportExceptionC1EPKcNS0_6errorsE(ptr noundef nonnull align 8 dereferenceable(12) %11, ptr noundef nonnull @.str.16, i32 noundef 1)
          to label %13 unwind label %16

13:                                               ; preds = %12
  store ptr %11, ptr %10, align 16, !tbaa !20
  tail call void @__cxa_throw(ptr nonnull %10, ptr nonnull @_ZTIPN9clearpath18TransportExceptionE, ptr null) #8
  unreachable

14:                                               ; preds = %9
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %18

16:                                               ; preds = %12
  %17 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %11, i64 noundef 16) #9
  br label %18

18:                                               ; preds = %16, %14
  %.pn = phi { ptr, i32 } [ %17, %16 ], [ %15, %14 ]
  tail call void @__cxa_free_exception(ptr %10) #6
  resume { ptr, i32 } %.pn

19:                                               ; preds = %3
  tail call void @_ZN9clearpath9Transport4pollEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %20 = getelementptr inbounds i8, ptr %0, i64 24
  %21 = tail call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  store ptr %21, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %22 = tail call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  store ptr %22, ptr %5, align 8
  %23 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIPN9clearpath7MessageEES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br i1 %23, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %19
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %42
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN9clearpath7MessageEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %25 = load ptr, ptr %24, align 8, !tbaa !20
  %26 = call noundef zeroext i16 @_ZN9clearpath7Message7getTypeEv(ptr noundef nonnull align 8 dereferenceable(273) %25)
  %27 = zext i16 %26 to i32
  %28 = icmp eq i32 %27, %1
  br i1 %28, label %31, label %29

29:                                               ; preds = %.lr.ph.split.us
  %30 = call ptr @_ZNSt14_List_iteratorIPN9clearpath7MessageEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0) #6
  br label %42

31:                                               ; preds = %.lr.ph.split.us
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN9clearpath7MessageEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %33 = load ptr, ptr %32, align 8, !tbaa !20
  %34 = icmp eq ptr %33, null
  br i1 %34, label %39, label %35

35:                                               ; preds = %31
  %36 = load ptr, ptr %33, align 8, !tbaa !21
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  %38 = load ptr, ptr %37, align 8
  call void %38(ptr noundef nonnull align 8 dereferenceable(273) %33) #6
  br label %39

39:                                               ; preds = %35, %31
  call void @_ZNSt20_List_const_iteratorIPN9clearpath7MessageEEC2ERKSt14_List_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %40 = load ptr, ptr %6, align 8
  %41 = call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5eraseESt20_List_const_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr %40) #6
  store ptr %41, ptr %4, align 8, !tbaa !20
  br label %42

42:                                               ; preds = %39, %29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %43 = call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  store ptr %43, ptr %5, align 8
  %44 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIPN9clearpath7MessageEES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br i1 %44, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !23

.lr.ph.split:                                     ; preds = %.lr.ph, %56
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN9clearpath7MessageEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %46 = load ptr, ptr %45, align 8, !tbaa !20
  %47 = call noundef zeroext i16 @_ZN9clearpath7Message7getTypeEv(ptr noundef nonnull align 8 dereferenceable(273) %46)
  %48 = zext i16 %47 to i32
  %49 = icmp eq i32 %48, %1
  br i1 %49, label %50, label %54

50:                                               ; preds = %.lr.ph.split
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN9clearpath7MessageEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %51)
  call void @_ZNSt20_List_const_iteratorIPN9clearpath7MessageEEC2ERKSt14_List_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %52 = load ptr, ptr %6, align 8
  %53 = call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5eraseESt20_List_const_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr %52) #6
  store ptr %53, ptr %4, align 8, !tbaa !20
  br label %56

54:                                               ; preds = %.lr.ph.split
  %55 = call ptr @_ZNSt14_List_iteratorIPN9clearpath7MessageEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0) #6
  br label %56

56:                                               ; preds = %54, %50
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %57 = call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  store ptr %57, ptr %5, align 8
  %58 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIPN9clearpath7MessageEES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br i1 %58, label %.lr.ph.split, label %._crit_edge, !llvm.loop !23

._crit_edge:                                      ; preds = %56, %42, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  ret void
}

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

declare void @_ZN9clearpath18TransportExceptionC1EPKcNS0_6errorsE(ptr, ptr, i32) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 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 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 = { "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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { noreturn }
attributes #9 = { builtin 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, !7, i64 0}
!6 = !{!"_ZTSN9clearpath9TransportE", !7, i64 0, !10, i64 8, !11, i64 16, !12, i64 24, !8, i64 48}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_ZTSNSt7__cxx114listIPN9clearpath7MessageESaIS3_EEE", !13, i64 0}
!13 = !{!"_ZTSNSt7__cxx1110_List_baseIPN9clearpath7MessageESaIS3_EEE", !14, i64 0}
!14 = !{!"_ZTSNSt7__cxx1110_List_baseIPN9clearpath7MessageESaIS3_EE10_List_implE", !15, i64 0}
!15 = !{!"_ZTSNSt8__detail17_List_node_headerE", !16, i64 0, !17, i64 16}
!16 = !{!"_ZTSNSt8__detail15_List_node_baseE", !10, i64 0, !10, i64 8}
!17 = !{!"long", !8, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!10, !10, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"vtable pointer", !9, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass