; 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 @_ZN9clearpath9Transport4pollEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN9clearpath9Transport7popNextENS_12MessageTypesE(ptr noundef nonnull align 8 dereferenceable(80) %0, i32 noundef %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %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
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %15 = load ptr, ptr %4, align 8
  br label %16

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

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

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

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

25:                                               ; preds = %20
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %6, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %7, align 4
  br label %33

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

33:                                               ; preds = %29, %25
  call void @__cxa_free_exception(ptr %21) #7
  br label %66

34:                                               ; preds = %16
  br label %35

35:                                               ; preds = %34
  call void @_ZN9clearpath9Transport4pollEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @_ZNSt14_List_iteratorIPN9clearpath7MessageEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %36 = getelementptr inbounds %"class.clearpath::Transport", ptr %15, i32 0, i32 3
  %37 = call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #7
  %38 = getelementptr inbounds %"struct.std::_List_iterator", ptr %10, i32 0, i32 0
  store ptr %37, ptr %38, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %10, i64 8, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %39

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

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

51:                                               ; preds = %44
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN9clearpath7MessageEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  store ptr %53, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds %"class.clearpath::Transport", ptr %15, 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
  %55 = getelementptr inbounds %"struct.std::_List_const_iterator", ptr %12, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8
  %57 = call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5eraseESt20_List_const_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr %56) #7
  %58 = getelementptr inbounds %"struct.std::_List_iterator", ptr %13, i32 0, i32 0
  store ptr %57, ptr %58, align 8
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %59, ptr %3, align 8
  store i32 1, ptr %14, align 4
  br label %64

60:                                               ; preds = %44
  br label %61

61:                                               ; preds = %60
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIPN9clearpath7MessageEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br label %39, !llvm.loop !24

63:                                               ; preds = %39
  store ptr null, ptr %3, align 8
  store i32 1, ptr %14, align 4
  br label %64

64:                                               ; preds = %63, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %65 = load ptr, ptr %3, align 8
  ret ptr %65

66:                                               ; preds = %33
  %67 = load ptr, ptr %6, align 8
  %68 = load i32, ptr %7, align 4
  %69 = insertvalue { ptr, i32 } poison, ptr %67, 0
  %70 = insertvalue { ptr, i32 } %69, i32 %68, 1
  resume { ptr, i32 } %70
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_List_iteratorIPN9clearpath7MessageEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIPN9clearpath7MessageEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #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 = !{i64 0, i64 8, !5}
!24 = distinct !{!24, !25}
!25 = !{!"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 @_ZN9clearpath9Transport4pollEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

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

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

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

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

13:                                               ; preds = %8
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %17

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

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

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

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

28:                                               ; preds = %.lr.ph
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN9clearpath7MessageEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %30 = load ptr, ptr %29, align 8, !tbaa !20
  call void @_ZNSt20_List_const_iteratorIPN9clearpath7MessageEEC2ERKSt14_List_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %31 = load ptr, ptr %5, align 8
  %32 = call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE5eraseESt20_List_const_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr %31) #6
  br label %.loopexit

33:                                               ; preds = %.lr.ph
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIPN9clearpath7MessageEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %35 = call ptr @_ZNSt7__cxx114listIPN9clearpath7MessageESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #6
  store ptr %35, ptr %4, align 8
  %36 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIPN9clearpath7MessageEES5_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %36, label %.lr.ph, label %.loopexit, !llvm.loop !21

.loopexit:                                        ; preds = %33, %18, %28
  %.0 = phi ptr [ %30, %28 ], [ null, %18 ], [ null, %33 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret ptr %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_List_iteratorIPN9clearpath7MessageEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIPN9clearpath7MessageEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) 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 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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