; LLVM IR from erwincoumans/tiny-differentiable-simulator :: third_party/zeromq/src/msg.ll (ZN3zmq5msg_t5closeEv)

; 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.zmq::msg_t" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { ptr, [34 x i8], i8, i8, [16 x i8], i32 }
%struct.anon.1 = type { ptr, ptr, [26 x i8], i8, i8, [16 x i8], i32 }
%"struct.zmq::msg_t::content_t" = type { ptr, i64, ptr, ptr, %"class.zmq::atomic_counter_t" }
%"class.zmq::atomic_counter_t" = type { %"struct.std::atomic", [4 x i8] }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%struct.anon.2 = type { ptr, ptr, [26 x i8], i8, i8, [16 x i8], i32 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3zmq5msg_t5checkEv(ptr noundef nonnull align 8 dereferenceable(64)) #0 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #1

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare i32 @fflush(ptr noundef) #4

declare void @_ZN3zmq9zmq_abortEPKc(ptr noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3zmq5msg_t5closeEv(ptr noundef nonnull align 8 dereferenceable(64) %0) #5 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %4 = load ptr, ptr %3, align 8
  %5 = call noundef zeroext i1 @_ZNK3zmq5msg_t5checkEv(ptr noundef nonnull align 8 dereferenceable(64) %4)
  %6 = xor i1 %5, true
  %7 = zext i1 %6 to i64
  %8 = call i64 @llvm.expect.i64(i64 %7, i64 0)
  %9 = icmp ne i64 %8, 0
  br i1 %9, label %10, label %12

10:                                               ; preds = %1
  %11 = call ptr @__errno_location() #8
  store i32 14, ptr %11, align 4, !tbaa !9
  store i32 -1, ptr %2, align 4
  br label %142

12:                                               ; preds = %1
  %13 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %14 = getelementptr inbounds %struct.anon, ptr %13, i32 0, i32 2
  %15 = load i8, ptr %14, align 2, !tbaa !11
  %16 = zext i8 %15 to i32
  %17 = icmp eq i32 %16, 102
  br i1 %17, label %18, label %63

18:                                               ; preds = %12
  %19 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %20 = getelementptr inbounds %struct.anon.1, ptr %19, i32 0, i32 4
  %21 = load i8, ptr %20, align 1, !tbaa !11
  %22 = zext i8 %21 to i32
  %23 = and i32 %22, 128
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %31

25:                                               ; preds = %18
  %26 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %27 = getelementptr inbounds %struct.anon.1, ptr %26, i32 0, i32 1
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %28, i32 0, i32 4
  %30 = call noundef zeroext i1 @_ZN3zmq16atomic_counter_t3subEj(ptr noundef nonnull align 8 dereferenceable(4) %29, i32 noundef 1)
  br i1 %30, label %62, label %31

31:                                               ; preds = %25, %18
  %32 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %33 = getelementptr inbounds %struct.anon.1, ptr %32, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %34, i32 0, i32 4
  %36 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %37 = getelementptr inbounds %struct.anon.1, ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %38, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !12
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %58

42:                                               ; preds = %31
  %43 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %44 = getelementptr inbounds %struct.anon.1, ptr %43, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !11
  %46 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %45, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !12
  %48 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %49 = getelementptr inbounds %struct.anon.1, ptr %48, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %51 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !18
  %53 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %54 = getelementptr inbounds %struct.anon.1, ptr %53, i32 0, i32 1
  %55 = load ptr, ptr %54, align 8, !tbaa !11
  %56 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %55, i32 0, i32 3
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  call void %47(ptr noundef %52, ptr noundef %57)
  br label %58

58:                                               ; preds = %42, %31
  %59 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %60 = getelementptr inbounds %struct.anon.1, ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  call void @free(ptr noundef %61) #9
  br label %62

62:                                               ; preds = %58, %25
  br label %63

63:                                               ; preds = %62, %12
  %64 = call noundef zeroext i1 @_ZNK3zmq5msg_t8is_zcmsgEv(ptr noundef nonnull align 8 dereferenceable(64) %4)
  br i1 %64, label %65, label %117

65:                                               ; preds = %63
  br label %66

66:                                               ; preds = %65
  %67 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %68 = getelementptr inbounds %struct.anon.2, ptr %67, i32 0, i32 1
  %69 = load ptr, ptr %68, align 8, !tbaa !11
  %70 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %69, i32 0, i32 2
  %71 = load ptr, ptr %70, align 8, !tbaa !12
  %72 = icmp ne ptr %71, null
  %73 = xor i1 %72, true
  %74 = zext i1 %73 to i64
  %75 = call i64 @llvm.expect.i64(i64 %74, i64 0)
  %76 = icmp ne i64 %75, 0
  br i1 %76, label %77, label %82

77:                                               ; preds = %66
  %78 = load ptr, ptr @stderr, align 8, !tbaa !5
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef @.str, ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 240) #9
  %80 = load ptr, ptr @stderr, align 8, !tbaa !5
  %81 = call i32 @fflush(ptr noundef %80)
  call void @_ZN3zmq9zmq_abortEPKc(ptr noundef @.str.5)
  br label %82

82:                                               ; preds = %77, %66
  br label %83

83:                                               ; preds = %82
  %84 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %85 = getelementptr inbounds %struct.anon.2, ptr %84, i32 0, i32 4
  %86 = load i8, ptr %85, align 1, !tbaa !11
  %87 = zext i8 %86 to i32
  %88 = and i32 %87, 128
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %96

90:                                               ; preds = %83
  %91 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %92 = getelementptr inbounds %struct.anon.2, ptr %91, i32 0, i32 1
  %93 = load ptr, ptr %92, align 8, !tbaa !11
  %94 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %93, i32 0, i32 4
  %95 = call noundef zeroext i1 @_ZN3zmq16atomic_counter_t3subEj(ptr noundef nonnull align 8 dereferenceable(4) %94, i32 noundef 1)
  br i1 %95, label %116, label %96

96:                                               ; preds = %90, %83
  %97 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %98 = getelementptr inbounds %struct.anon.2, ptr %97, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !11
  %100 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %99, i32 0, i32 4
  %101 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %102 = getelementptr inbounds %struct.anon.2, ptr %101, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !11
  %104 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %103, i32 0, i32 2
  %105 = load ptr, ptr %104, align 8, !tbaa !12
  %106 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %107 = getelementptr inbounds %struct.anon.2, ptr %106, i32 0, i32 1
  %108 = load ptr, ptr %107, align 8, !tbaa !11
  %109 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !18
  %111 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %112 = getelementptr inbounds %struct.anon.2, ptr %111, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !11
  %114 = getelementptr inbounds %"struct.zmq::msg_t::content_t", ptr %113, i32 0, i32 3
  %115 = load ptr, ptr %114, align 8, !tbaa !19
  call void %105(ptr noundef %110, ptr noundef %115)
  br label %116

116:                                              ; preds = %96, %90
  br label %117

117:                                              ; preds = %116, %63
  %118 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %119 = getelementptr inbounds %struct.anon, ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !11
  %121 = icmp ne ptr %120, null
  br i1 %121, label %122, label %139

122:                                              ; preds = %117
  %123 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %124 = getelementptr inbounds %struct.anon, ptr %123, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !11
  %126 = call noundef zeroext i1 @_ZN3zmq10metadata_t8drop_refEv(ptr noundef nonnull align 8 dereferenceable(56) %125)
  br i1 %126, label %127, label %136

127:                                              ; preds = %122
  %128 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %129 = getelementptr inbounds %struct.anon, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !11
  %131 = icmp eq ptr %130, null
  br i1 %131, label %133, label %132

132:                                              ; preds = %127
  call void @_ZN3zmq10metadata_tD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %130) #9
  call void @_ZdlPvm(ptr noundef %130, i64 noundef 56) #10
  br label %133

133:                                              ; preds = %132, %127
  %134 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %135 = getelementptr inbounds %struct.anon, ptr %134, i32 0, i32 0
  store ptr null, ptr %135, align 8, !tbaa !11
  br label %136

136:                                              ; preds = %133, %122
  %137 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %138 = getelementptr inbounds %struct.anon, ptr %137, i32 0, i32 0
  store ptr null, ptr %138, align 8, !tbaa !11
  br label %139

139:                                              ; preds = %136, %117
  %140 = getelementptr inbounds %"class.zmq::msg_t", ptr %4, i32 0, i32 0
  %141 = getelementptr inbounds %struct.anon, ptr %140, i32 0, i32 2
  store i8 0, ptr %141, align 2, !tbaa !11
  store i32 0, ptr %2, align 4
  br label %142

142:                                              ; preds = %139, %10
  %143 = load i32, ptr %2, align 4
  ret i32 %143
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3zmq16atomic_counter_t3subEj(ptr noundef nonnull align 8 dereferenceable(4), i32 noundef) #6 align 2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3zmq5msg_t8is_zcmsgEv(ptr noundef nonnull align 8 dereferenceable(64)) #0 align 2

declare noundef zeroext i1 @_ZN3zmq10metadata_t8drop_refEv(ptr noundef nonnull align 8 dereferenceable(56)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3zmq10metadata_tD2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #6 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #2 = { nounwind willreturn memory(none) "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 = { 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 #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 = { 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 #6 = { 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 #7 = { 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 #8 = { nounwind willreturn memory(none) }
attributes #9 = { nounwind }
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 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 16}
!13 = !{!"_ZTSN3zmq5msg_t9content_tE", !6, i64 0, !14, i64 8, !6, i64 16, !6, i64 24, !15, i64 32}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN3zmq16atomic_counter_tE", !16, i64 0}
!16 = !{!"_ZTSSt6atomicIjE", !17, i64 0}
!17 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!18 = !{!13, !6, i64 0}
!19 = !{!13, !6, i64 24}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3zmq5msg_t5checkEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2

declare void @_ZN3zmq9zmq_abortEPKc(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -1, 1) i32 @_ZN3zmq5msg_t5closeEv(ptr noundef nonnull align 8 dereferenceable(64) %0) local_unnamed_addr #4 align 2 {
  %2 = tail call noundef zeroext i1 @_ZNK3zmq5msg_t5checkEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  br i1 %2, label %5, label %3, !prof !5

3:                                                ; preds = %1
  %4 = tail call ptr @__errno_location() #8
  store i32 14, ptr %4, align 4, !tbaa !6
  br label %63

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 42
  %7 = load i8, ptr %6, align 2, !tbaa !10
  %8 = icmp eq i8 %7, 102
  br i1 %8, label %9, label %28

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 43
  %11 = load i8, ptr %10, align 1, !tbaa !10
  %.not = icmp sgt i8 %11, -1
  br i1 %.not, label %17, label %12

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !10
  %15 = getelementptr inbounds i8, ptr %14, i64 32
  %16 = tail call noundef zeroext i1 @_ZN3zmq16atomic_counter_t3subEj(ptr noundef nonnull align 8 dereferenceable(4) %15, i32 noundef 1)
  br i1 %16, label %28, label %17

17:                                               ; preds = %12, %9
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !10
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %.not4 = icmp eq ptr %21, null
  br i1 %.not4, label %26, label %22

22:                                               ; preds = %17
  %23 = load ptr, ptr %19, align 8, !tbaa !18
  %24 = getelementptr inbounds i8, ptr %19, i64 24
  %25 = load ptr, ptr %24, align 8, !tbaa !19
  tail call void %21(ptr noundef %23, ptr noundef %25)
  %.pre = load ptr, ptr %18, align 8, !tbaa !10
  br label %26

26:                                               ; preds = %22, %17
  %27 = phi ptr [ %.pre, %22 ], [ %19, %17 ]
  tail call void @free(ptr noundef %27) #9
  br label %28

28:                                               ; preds = %12, %26, %5
  %29 = tail call noundef zeroext i1 @_ZNK3zmq5msg_t8is_zcmsgEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  br i1 %29, label %30, label %53

30:                                               ; preds = %28
  %31 = getelementptr inbounds i8, ptr %0, i64 8
  %32 = load ptr, ptr %31, align 8, !tbaa !10
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %.not5 = icmp eq ptr %34, null
  br i1 %.not5, label %35, label %40, !prof !20

35:                                               ; preds = %30
  %36 = load ptr, ptr @stderr, align 8, !tbaa !21
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.2, i32 noundef 240) #10
  %38 = load ptr, ptr @stderr, align 8, !tbaa !21
  %39 = tail call i32 @fflush(ptr noundef %38)
  tail call void @_ZN3zmq9zmq_abortEPKc(ptr noundef nonnull @.str.5)
  %.pre9.pre = load ptr, ptr %31, align 8, !tbaa !10
  br label %40

40:                                               ; preds = %30, %35
  %.pre9 = phi ptr [ %32, %30 ], [ %.pre9.pre, %35 ]
  %41 = getelementptr inbounds i8, ptr %0, i64 43
  %42 = load i8, ptr %41, align 1, !tbaa !10
  %.not6 = icmp sgt i8 %42, -1
  br i1 %.not6, label %46, label %43

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %.pre9, i64 32
  %45 = tail call noundef zeroext i1 @_ZN3zmq16atomic_counter_t3subEj(ptr noundef nonnull align 8 dereferenceable(4) %44, i32 noundef 1)
  br i1 %45, label %53, label %._crit_edge

._crit_edge:                                      ; preds = %43
  %.pre8 = load ptr, ptr %31, align 8, !tbaa !10
  br label %46

46:                                               ; preds = %._crit_edge, %40
  %47 = phi ptr [ %.pre8, %._crit_edge ], [ %.pre9, %40 ]
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  %50 = load ptr, ptr %47, align 8, !tbaa !18
  %51 = getelementptr inbounds i8, ptr %47, i64 24
  %52 = load ptr, ptr %51, align 8, !tbaa !19
  tail call void %49(ptr noundef %50, ptr noundef %52)
  br label %53

53:                                               ; preds = %43, %46, %28
  %54 = load ptr, ptr %0, align 8, !tbaa !10
  %.not7 = icmp eq ptr %54, null
  br i1 %.not7, label %62, label %55

55:                                               ; preds = %53
  %56 = tail call noundef zeroext i1 @_ZN3zmq10metadata_t8drop_refEv(ptr noundef nonnull align 8 dereferenceable(56) %54)
  br i1 %56, label %57, label %61

57:                                               ; preds = %55
  %58 = load ptr, ptr %0, align 8, !tbaa !10
  %59 = icmp eq ptr %58, null
  br i1 %59, label %61, label %60

60:                                               ; preds = %57
  tail call void @_ZN3zmq10metadata_tD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %58) #9
  tail call void @_ZdlPvm(ptr noundef nonnull %58, i64 noundef 56) #11
  br label %61

61:                                               ; preds = %57, %60, %55
  store ptr null, ptr %0, align 8, !tbaa !10
  br label %62

62:                                               ; preds = %61, %53
  store i8 0, ptr %6, align 2, !tbaa !10
  br label %63

63:                                               ; preds = %62, %3
  %.0 = phi i32 [ -1, %3 ], [ 0, %62 ]
  ret i32 %.0
}

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3zmq5msg_t8is_zcmsgEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #0 align 2

declare noundef zeroext i1 @_ZN3zmq10metadata_t8drop_refEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3zmq10metadata_tD2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5 align 2

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

attributes #0 = { 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 #1 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { nofree 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 = { "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 = { 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 #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #8 = { nounwind willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { cold nounwind }
attributes #11 = { 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 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!8, !8, i64 0}
!11 = !{!12, !13, i64 16}
!12 = !{!"_ZTSN3zmq5msg_t9content_tE", !13, i64 0, !14, i64 8, !13, i64 16, !13, i64 24, !15, i64 32}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!"_ZTSN3zmq16atomic_counter_tE", !16, i64 0}
!16 = !{!"_ZTSSt6atomicIjE", !17, i64 0}
!17 = !{!"_ZTSSt13__atomic_baseIjE", !7, i64 0}
!18 = !{!12, !13, i64 0}
!19 = !{!12, !13, i64 24}
!20 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!21 = !{!13, !13, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass,TailCallElimPass