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

%"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 }
%"class.clearpath::Message" = type <{ ptr, [256 x i8], i64, i8, [7 x i8] }>

@_ZTIPN9clearpath18TransportExceptionE = external dso_local constant { ptr, ptr, i32, ptr }, align 8
@.str.16 = external hidden unnamed_addr constant [25 x i8], align 1
@_ZTIPN9clearpath15BadAckExceptionE = external dso_local constant { ptr, ptr, i32, ptr }, align 8
@.str.17 = external hidden unnamed_addr constant [20 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 noundef ptr @_ZN9clearpath9Transport6getAckEv(ptr noundef nonnull align 8 dereferenceable(80)) #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 uwtable
define dso_local void @_ZN9clearpath9Transport4sendEPNS_7MessageE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i16, align 2
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8
  br label %14

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

18:                                               ; preds = %14
  %19 = call ptr @__cxa_allocate_exception(i64 8) #5
  %20 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #6
          to label %21 unwind label %23

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

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

23:                                               ; preds = %18
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %5, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %6, align 4
  br label %31

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

31:                                               ; preds = %27, %23
  call void @__cxa_free_exception(ptr %19) #5
  br label %129

32:                                               ; preds = %14
  br label %33

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #5
  store i8 0, ptr %7, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #5
  call void @_ZN9clearpath9Transport4pollEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
  br label %34

34:                                               ; preds = %73, %33
  br label %35

35:                                               ; preds = %34
  %36 = load i32, ptr %9, align 4, !tbaa !22
  %37 = getelementptr inbounds %"class.clearpath::Transport", ptr %13, i32 0, i32 2
  %38 = load i32, ptr %37, align 8, !tbaa !23
  %39 = icmp sgt i32 %36, %38
  br i1 %39, label %40, label %41

40:                                               ; preds = %35
  br label %101

41:                                               ; preds = %35
  %42 = load i8, ptr %7, align 1, !tbaa !21
  %43 = icmp ne i8 %42, 0
  br i1 %43, label %55, label %44

44:                                               ; preds = %41
  %45 = getelementptr inbounds %"class.clearpath::Transport", ptr %13, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !24
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.clearpath::Message", ptr %47, i32 0, i32 1
  %49 = getelementptr inbounds [256 x i8], ptr %48, i64 0, i64 0
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %"class.clearpath::Message", ptr %50, i32 0, i32 2
  %52 = load i64, ptr %51, align 8, !tbaa !25
  %53 = trunc i64 %52 to i32
  %54 = call noundef i32 @_Z9WriteDataPvPKci(ptr noundef %46, ptr noundef %49, i32 noundef %53)
  br label %55

55:                                               ; preds = %44, %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !22
  br label %56

56:                                               ; preds = %66, %55
  %57 = load i32, ptr %11, align 4, !tbaa !22
  %58 = icmp slt i32 %57, 200
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  store i32 6, ptr %12, align 4
  br label %69

60:                                               ; preds = %56
  %61 = call i32 @usleep(i32 noundef 1000)
  %62 = call noundef ptr @_ZN9clearpath9Transport6getAckEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
  store ptr %62, ptr %8, align 8, !tbaa !5
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %65

64:                                               ; preds = %60
  store i32 6, ptr %12, align 4
  br label %69

65:                                               ; preds = %60
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %11, align 4, !tbaa !22
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %11, align 4, !tbaa !22
  br label %56, !llvm.loop !27

69:                                               ; preds = %64, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %70

70:                                               ; preds = %69
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = icmp eq ptr %71, null
  br i1 %72, label %73, label %76

73:                                               ; preds = %70
  store i8 0, ptr %7, align 1, !tbaa !21
  %74 = load i32, ptr %9, align 4, !tbaa !22
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %9, align 4, !tbaa !22
  br label %34, !llvm.loop !29

76:                                               ; preds = %70
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = call noundef ptr @_ZN9clearpath7Message17getPayloadPointerEm(ptr noundef nonnull align 8 dereferenceable(273) %77, i64 noundef 0)
  %79 = call noundef i64 @_ZN9clearpath4btouEPvm(ptr noundef %78, i64 noundef 2)
  %80 = trunc i64 %79 to i16
  store i16 %80, ptr %10, align 2, !tbaa !30
  %81 = load i16, ptr %10, align 2, !tbaa !30
  %82 = sext i16 %81 to i32
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %84, label %100

84:                                               ; preds = %76
  %85 = call ptr @__cxa_allocate_exception(i64 8) #5
  %86 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #6
          to label %87 unwind label %91

87:                                               ; preds = %84
  %88 = load i16, ptr %10, align 2, !tbaa !30
  %89 = sext i16 %88 to i32
  invoke void @_ZN9clearpath15BadAckExceptionC1Ej(ptr noundef nonnull align 8 dereferenceable(16) %86, i32 noundef %89)
          to label %90 unwind label %95

90:                                               ; preds = %87
  store ptr %86, ptr %85, align 16, !tbaa !5
  call void @__cxa_throw(ptr %85, ptr @_ZTIPN9clearpath15BadAckExceptionE, ptr null) #7
  unreachable

91:                                               ; preds = %84
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %5, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %6, align 4
  br label %99

95:                                               ; preds = %87
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %5, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %86, i64 noundef 16) #8
  br label %99

99:                                               ; preds = %95, %91
  call void @__cxa_free_exception(ptr %85) #5
  br label %128

100:                                              ; preds = %76
  br label %101

101:                                              ; preds = %100, %40
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = icmp eq ptr %102, null
  br i1 %103, label %104, label %118

104:                                              ; preds = %101
  %105 = call ptr @__cxa_allocate_exception(i64 8) #5
  %106 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #6
          to label %107 unwind label %109

107:                                              ; preds = %104
  invoke void @_ZN9clearpath18TransportExceptionC1EPKcNS0_6errorsE(ptr noundef nonnull align 8 dereferenceable(12) %106, ptr noundef @.str.17, i32 noundef 3)
          to label %108 unwind label %113

108:                                              ; preds = %107
  store ptr %106, ptr %105, align 16, !tbaa !5
  call void @__cxa_throw(ptr %105, ptr @_ZTIPN9clearpath18TransportExceptionE, ptr null) #7
  unreachable

109:                                              ; preds = %104
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %5, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %6, align 4
  br label %117

113:                                              ; preds = %107
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %5, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %106, i64 noundef 16) #8
  br label %117

117:                                              ; preds = %113, %109
  call void @__cxa_free_exception(ptr %105) #5
  br label %128

118:                                              ; preds = %101
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = icmp eq ptr %119, null
  br i1 %120, label %125, label %121

121:                                              ; preds = %118
  %122 = load ptr, ptr %119, align 8, !tbaa !32
  %123 = getelementptr inbounds ptr, ptr %122, i64 1
  %124 = load ptr, ptr %123, align 8
  call void %124(ptr noundef nonnull align 8 dereferenceable(273) %119) #5
  br label %125

125:                                              ; preds = %121, %118
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %"class.clearpath::Message", ptr %126, i32 0, i32 3
  store i8 1, ptr %127, align 8, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  ret void

128:                                              ; preds = %117, %99
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  br label %129

129:                                              ; preds = %128, %31
  %130 = load ptr, ptr %5, align 8
  %131 = load i32, ptr %6, align 4
  %132 = insertvalue { ptr, i32 } poison, ptr %130, 0
  %133 = insertvalue { ptr, i32 } %132, i32 %131, 1
  resume { ptr, i32 } %133
}

declare noundef i32 @_Z9WriteDataPvPKci(ptr noundef, ptr noundef, i32 noundef) #4

declare i32 @usleep(i32 noundef) #4

declare noundef i64 @_ZN9clearpath4btouEPvm(ptr noundef, i64 noundef) #4

declare noundef ptr @_ZN9clearpath7Message17getPayloadPointerEm(ptr noundef nonnull align 8 dereferenceable(273), i64 noundef) #4

declare void @_ZN9clearpath18TransportExceptionC1EPKcNS0_6errorsE(ptr, ptr, i32)

declare void @_ZN9clearpath15BadAckExceptionC1Ej(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 = { "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 }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { noreturn }
attributes #8 = { 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, !11, i64 0}
!10 = !{!"_ZTSN9clearpath9TransportE", !11, i64 0, !6, i64 8, !12, i64 16, !13, i64 24, !7, i64 48}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSNSt7__cxx114listIPN9clearpath7MessageESaIS3_EEE", !14, i64 0}
!14 = !{!"_ZTSNSt7__cxx1110_List_baseIPN9clearpath7MessageESaIS3_EEE", !15, i64 0}
!15 = !{!"_ZTSNSt7__cxx1110_List_baseIPN9clearpath7MessageESaIS3_EE10_List_implE", !16, i64 0}
!16 = !{!"_ZTSNSt8__detail17_List_node_headerE", !17, i64 0, !18, i64 16}
!17 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!18 = !{!"long", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!7, !7, i64 0}
!22 = !{!12, !12, i64 0}
!23 = !{!10, !12, i64 16}
!24 = !{!10, !6, i64 8}
!25 = !{!26, !18, i64 264}
!26 = !{!"_ZTSN9clearpath7MessageE", !7, i64 8, !18, i64 264, !11, i64 272}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = !{!31, !31, i64 0}
!31 = !{!"short", !7, i64 0}
!32 = !{!33, !33, i64 0}
!33 = !{!"vtable pointer", !8, i64 0}
!34 = !{!26, !11, i64 272}


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

@_ZTIPN9clearpath18TransportExceptionE = external dso_local constant { ptr, ptr, i32, ptr }, align 8
@.str.16 = external hidden unnamed_addr constant [25 x i8], align 1
@_ZTIPN9clearpath15BadAckExceptionE = external dso_local constant { ptr, ptr, i32, ptr }, align 8
@.str.17 = external hidden unnamed_addr constant [20 x i8], align 1

declare i32 @__gxx_personality_v0(...)

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9clearpath9Transport4sendEPNS_7MessageE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = load i8, ptr %0, align 8, !tbaa !5, !range !18, !noundef !19
  %4 = trunc nuw i8 %3 to i1
  br i1 %4, label %14, label %5

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

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

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

10:                                               ; preds = %5
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %62

12:                                               ; preds = %8
  %13 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %7, i64 noundef 16) #7
  br label %62

14:                                               ; preds = %2
  tail call void @_ZN9clearpath9Transport4pollEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load i32, ptr %15, align 8, !tbaa !21
  %17 = icmp slt i32 %16, 0
  br i1 %17, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %14
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = getelementptr inbounds i8, ptr %1, i64 8
  %20 = getelementptr inbounds i8, ptr %1, i64 264
  br label %21

21:                                               ; preds = %.lr.ph, %31
  %.01742 = phi i32 [ 0, %.lr.ph ], [ %32, %31 ]
  %22 = load ptr, ptr %18, align 8, !tbaa !22
  %23 = load i64, ptr %20, align 8, !tbaa !23
  %24 = trunc i64 %23 to i32
  %25 = tail call noundef i32 @_Z9WriteDataPvPKci(ptr noundef %22, ptr noundef nonnull %19, i32 noundef %24)
  br label %28

26:                                               ; preds = %28
  %27 = add nuw nsw i32 %.041, 1
  %exitcond.not = icmp eq i32 %27, 200
  br i1 %exitcond.not, label %31, label %28, !llvm.loop !25

28:                                               ; preds = %21, %26
  %.041 = phi i32 [ 0, %21 ], [ %27, %26 ]
  %29 = tail call i32 @usleep(i32 noundef 1000)
  %30 = tail call noundef ptr @_ZN9clearpath9Transport6getAckEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %.not = icmp eq ptr %30, null
  br i1 %.not, label %26, label %34

31:                                               ; preds = %26
  %32 = add nuw nsw i32 %.01742, 1
  %33 = load i32, ptr %15, align 8, !tbaa !21
  %.not43 = icmp slt i32 %.01742, %33
  br i1 %.not43, label %21, label %._crit_edge, !llvm.loop !27

34:                                               ; preds = %28
  %35 = tail call noundef ptr @_ZN9clearpath7Message17getPayloadPointerEm(ptr noundef nonnull align 8 dereferenceable(273) %30, i64 noundef 0)
  %36 = tail call noundef i64 @_ZN9clearpath4btouEPvm(ptr noundef %35, i64 noundef 2)
  %37 = trunc i64 %36 to i32
  %sext = shl i32 %37, 16
  %38 = ashr exact i32 %sext, 16
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %40, label %57

40:                                               ; preds = %34
  %41 = tail call ptr @__cxa_allocate_exception(i64 8) #4
  %42 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #5
          to label %43 unwind label %45

43:                                               ; preds = %40
  invoke void @_ZN9clearpath15BadAckExceptionC1Ej(ptr noundef nonnull align 8 dereferenceable(16) %42, i32 noundef %38)
          to label %44 unwind label %47

44:                                               ; preds = %43
  store ptr %42, ptr %41, align 16, !tbaa !20
  tail call void @__cxa_throw(ptr nonnull %41, ptr nonnull @_ZTIPN9clearpath15BadAckExceptionE, ptr null) #6
  unreachable

45:                                               ; preds = %40
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %62

47:                                               ; preds = %43
  %48 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %42, i64 noundef 16) #7
  br label %62

._crit_edge:                                      ; preds = %31, %14
  %49 = tail call ptr @__cxa_allocate_exception(i64 8) #4
  %50 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #5
          to label %51 unwind label %53

51:                                               ; preds = %._crit_edge
  invoke void @_ZN9clearpath18TransportExceptionC1EPKcNS0_6errorsE(ptr noundef nonnull align 8 dereferenceable(12) %50, ptr noundef nonnull @.str.17, i32 noundef 3)
          to label %52 unwind label %55

52:                                               ; preds = %51
  store ptr %50, ptr %49, align 16, !tbaa !20
  tail call void @__cxa_throw(ptr nonnull %49, ptr nonnull @_ZTIPN9clearpath18TransportExceptionE, ptr null) #6
  unreachable

53:                                               ; preds = %._crit_edge
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %62

55:                                               ; preds = %51
  %56 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %50, i64 noundef 16) #7
  br label %62

57:                                               ; preds = %34
  %58 = load ptr, ptr %30, align 8, !tbaa !28
  %59 = getelementptr inbounds i8, ptr %58, i64 8
  %60 = load ptr, ptr %59, align 8
  tail call void %60(ptr noundef nonnull align 8 dereferenceable(273) %30) #4
  %61 = getelementptr inbounds i8, ptr %1, i64 272
  store i8 1, ptr %61, align 8, !tbaa !30
  ret void

62:                                               ; preds = %53, %55, %45, %47, %10, %12
  %.sink = phi ptr [ %6, %12 ], [ %6, %10 ], [ %41, %47 ], [ %41, %45 ], [ %49, %55 ], [ %49, %53 ]
  %.pn34.pn.pn = phi { ptr, i32 } [ %13, %12 ], [ %11, %10 ], [ %48, %47 ], [ %46, %45 ], [ %56, %55 ], [ %54, %53 ]
  tail call void @__cxa_free_exception(ptr %.sink) #4
  resume { ptr, i32 } %.pn34.pn.pn
}

declare noundef i32 @_Z9WriteDataPvPKci(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @usleep(i32 noundef) local_unnamed_addr #3

declare noundef i64 @_ZN9clearpath4btouEPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

declare noundef ptr @_ZN9clearpath7Message17getPayloadPointerEm(ptr noundef nonnull align 8 dereferenceable(273), i64 noundef) local_unnamed_addr #3

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

declare void @_ZN9clearpath15BadAckExceptionC1Ej(ptr, i32) local_unnamed_addr

attributes #0 = { 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 #1 = { 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 #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 = { nounwind }
attributes #5 = { builtin allocsize(0) }
attributes #6 = { noreturn }
attributes #7 = { 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 = !{!6, !11, i64 16}
!22 = !{!6, !10, i64 8}
!23 = !{!24, !17, i64 264}
!24 = !{!"_ZTSN9clearpath7MessageE", !8, i64 8, !17, i64 264, !7, i64 272}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}
!28 = !{!29, !29, i64 0}
!29 = !{!"vtable pointer", !9, i64 0}
!30 = !{!24, !7, i64 272}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass