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

; 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::v1_decoder_t" = type { %"class.zmq::decoder_base_t", [8 x i8], %"class.zmq::msg_t", i64 }
%"class.zmq::decoder_base_t" = type { %"class.zmq::i_decoder", { i64, i64 }, ptr, i64, %"class.zmq::c_single_allocator", ptr }
%"class.zmq::i_decoder" = type { ptr }
%"class.zmq::c_single_allocator" = type { i64, ptr }
%"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 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [114 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@__PRETTY_FUNCTION__._ZN3zmq12v1_decoder_t19one_byte_size_readyEPKh = external hidden unnamed_addr constant [66 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 noundef i32 @_ZN3zmq5msg_t4initEv(ptr noundef nonnull align 8 dereferenceable(64)) #1

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #3

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

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

declare i32 @fflush(ptr noundef) #1

declare void @_ZN3zmq9zmq_abortEPKc(ptr noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3zmq14decoder_base_tINS_12v1_decoder_tENS_18c_single_allocatorEE9next_stepEPvmMS1_FiPKhE(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, i64 noundef, i64, i64) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3zmq12v1_decoder_t19one_byte_size_readyEPKh(ptr noundef nonnull align 8 dereferenceable(144) %0, ptr noundef %1) #6 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca { i64, i64 }, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca { i64, i64 }, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8
  %13 = getelementptr inbounds %"class.zmq::v1_decoder_t", ptr %12, i32 0, i32 1
  %14 = getelementptr inbounds [8 x i8], ptr %13, i64 0, i64 0
  %15 = load i8, ptr %14, align 8, !tbaa !9
  %16 = zext i8 %15 to i32
  %17 = icmp eq i32 %16, 255
  br i1 %17, label %18, label %25

18:                                               ; preds = %2
  %19 = getelementptr inbounds %"class.zmq::v1_decoder_t", ptr %12, i32 0, i32 1
  %20 = getelementptr inbounds [8 x i8], ptr %19, i64 0, i64 0
  store { i64, i64 } { i64 ptrtoint (ptr @_ZN3zmq12v1_decoder_t21eight_byte_size_readyEPKh to i64), i64 0 }, ptr %6, align 8, !tbaa !9
  %21 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 0
  %22 = load i64, ptr %21, align 8
  %23 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 1
  %24 = load i64, ptr %23, align 8
  call void @_ZN3zmq14decoder_base_tINS_12v1_decoder_tENS_18c_single_allocatorEE9next_stepEPvmMS1_FiPKhE(ptr noundef nonnull align 8 dereferenceable(64) %12, ptr noundef %20, i64 noundef 8, i64 %22, i64 %24)
  br label %122

25:                                               ; preds = %2
  %26 = getelementptr inbounds %"class.zmq::v1_decoder_t", ptr %12, i32 0, i32 1
  %27 = getelementptr inbounds [8 x i8], ptr %26, i64 0, i64 0
  %28 = load i8, ptr %27, align 8, !tbaa !9
  %29 = icmp ne i8 %28, 0
  br i1 %29, label %32, label %30

30:                                               ; preds = %25
  %31 = call ptr @__errno_location() #8
  store i32 71, ptr %31, align 4, !tbaa !10
  store i32 -1, ptr %3, align 4
  br label %123

32:                                               ; preds = %25
  %33 = getelementptr inbounds %"class.zmq::v1_decoder_t", ptr %12, i32 0, i32 3
  %34 = load i64, ptr %33, align 8, !tbaa !12
  %35 = icmp sge i64 %34, 0
  br i1 %35, label %36, label %48

36:                                               ; preds = %32
  %37 = getelementptr inbounds %"class.zmq::v1_decoder_t", ptr %12, i32 0, i32 1
  %38 = getelementptr inbounds [8 x i8], ptr %37, i64 0, i64 0
  %39 = load i8, ptr %38, align 8, !tbaa !9
  %40 = zext i8 %39 to i32
  %41 = sub nsw i32 %40, 1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %"class.zmq::v1_decoder_t", ptr %12, i32 0, i32 3
  %44 = load i64, ptr %43, align 8, !tbaa !12
  %45 = icmp sgt i64 %42, %44
  br i1 %45, label %46, label %48

46:                                               ; preds = %36
  %47 = call ptr @__errno_location() #8
  store i32 90, ptr %47, align 4, !tbaa !10
  store i32 -1, ptr %3, align 4
  br label %123

48:                                               ; preds = %36, %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  %49 = getelementptr inbounds %"class.zmq::v1_decoder_t", ptr %12, i32 0, i32 2
  %50 = call noundef i32 @_ZN3zmq5msg_t5closeEv(ptr noundef nonnull align 8 dereferenceable(64) %49)
  store i32 %50, ptr %7, align 4, !tbaa !10
  %51 = load i32, ptr %7, align 4, !tbaa !10
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %54

53:                                               ; preds = %48
  br label %56

54:                                               ; preds = %48
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 80, ptr noundef @__PRETTY_FUNCTION__._ZN3zmq12v1_decoder_t19one_byte_size_readyEPKh) #10
  unreachable

55:                                               ; No predecessors!
  br label %56

56:                                               ; preds = %55, %53
  %57 = getelementptr inbounds %"class.zmq::v1_decoder_t", ptr %12, i32 0, i32 2
  %58 = getelementptr inbounds %"class.zmq::v1_decoder_t", ptr %12, i32 0, i32 1
  %59 = getelementptr inbounds [8 x i8], ptr %58, i64 0, i64 0
  %60 = load i8, ptr %59, align 8, !tbaa !9
  %61 = zext i8 %60 to i32
  %62 = sub nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = call noundef i32 @_ZN3zmq5msg_t9init_sizeEm(ptr noundef nonnull align 8 dereferenceable(64) %57, i64 noundef %63)
  store i32 %64, ptr %7, align 4, !tbaa !10
  %65 = load i32, ptr %7, align 4, !tbaa !10
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %112

67:                                               ; preds = %56
  br label %68

68:                                               ; preds = %67
  %69 = call ptr @__errno_location() #8
  %70 = load i32, ptr %69, align 4, !tbaa !10
  %71 = icmp eq i32 %70, 12
  %72 = xor i1 %71, true
  %73 = zext i1 %72 to i64
  %74 = call i64 @llvm.expect.i64(i64 %73, i64 0)
  %75 = icmp ne i64 %74, 0
  br i1 %75, label %76, label %86

76:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %77 = call ptr @__errno_location() #8
  %78 = load i32, ptr %77, align 4, !tbaa !10
  %79 = call ptr @strerror(i32 noundef %78) #9
  store ptr %79, ptr %8, align 8, !tbaa !5
  %80 = load ptr, ptr @stderr, align 8, !tbaa !5
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef @.str, ptr noundef %81, ptr noundef @.str.1, i32 noundef 83) #9
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  %84 = call i32 @fflush(ptr noundef %83)
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN3zmq9zmq_abortEPKc(ptr noundef %85)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  br label %86

86:                                               ; preds = %76, %68
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  %89 = getelementptr inbounds %"class.zmq::v1_decoder_t", ptr %12, i32 0, i32 2
  %90 = call noundef i32 @_ZN3zmq5msg_t4initEv(ptr noundef nonnull align 8 dereferenceable(64) %89)
  store i32 %90, ptr %7, align 4, !tbaa !10
  br label %91

91:                                               ; preds = %88
  %92 = load i32, ptr %7, align 4, !tbaa !10
  %93 = icmp eq i32 %92, 0
  %94 = xor i1 %93, true
  %95 = zext i1 %94 to i64
  %96 = call i64 @llvm.expect.i64(i64 %95, i64 0)
  %97 = icmp ne i64 %96, 0
  br i1 %97, label %98, label %108

98:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %99 = call ptr @__errno_location() #8
  %100 = load i32, ptr %99, align 4, !tbaa !10
  %101 = call ptr @strerror(i32 noundef %100) #9
  store ptr %101, ptr %9, align 8, !tbaa !5
  %102 = load ptr, ptr @stderr, align 8, !tbaa !5
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %102, ptr noundef @.str, ptr noundef %103, ptr noundef @.str.1, i32 noundef 85) #9
  %105 = load ptr, ptr @stderr, align 8, !tbaa !5
  %106 = call i32 @fflush(ptr noundef %105)
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN3zmq9zmq_abortEPKc(ptr noundef %107)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %108

108:                                              ; preds = %98, %91
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  %111 = call ptr @__errno_location() #8
  store i32 12, ptr %111, align 4, !tbaa !10
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %119

112:                                              ; preds = %56
  %113 = getelementptr inbounds %"class.zmq::v1_decoder_t", ptr %12, i32 0, i32 1
  %114 = getelementptr inbounds [8 x i8], ptr %113, i64 0, i64 0
  store { i64, i64 } { i64 ptrtoint (ptr @_ZN3zmq12v1_decoder_t11flags_readyEPKh to i64), i64 0 }, ptr %11, align 8, !tbaa !9
  %115 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %116 = load i64, ptr %115, align 8
  %117 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %118 = load i64, ptr %117, align 8
  call void @_ZN3zmq14decoder_base_tINS_12v1_decoder_tENS_18c_single_allocatorEE9next_stepEPvmMS1_FiPKhE(ptr noundef nonnull align 8 dereferenceable(64) %12, ptr noundef %114, i64 noundef 1, i64 %116, i64 %118)
  store i32 0, ptr %10, align 4
  br label %119

119:                                              ; preds = %112, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  %120 = load i32, ptr %10, align 4
  switch i32 %120, label %125 [
    i32 0, label %121
    i32 1, label %123
  ]

121:                                              ; preds = %119
  br label %122

122:                                              ; preds = %121, %18
  store i32 0, ptr %3, align 4
  br label %123

123:                                              ; preds = %122, %119, %46, %30
  %124 = load i32, ptr %3, align 4
  ret i32 %124

125:                                              ; preds = %119
  unreachable
}

declare noundef i32 @_ZN3zmq5msg_t5closeEv(ptr noundef nonnull align 8 dereferenceable(64)) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3zmq12v1_decoder_t21eight_byte_size_readyEPKh(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef) #6 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #7

declare noundef i32 @_ZN3zmq5msg_t9init_sizeEm(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3zmq12v1_decoder_t11flags_readyEPKh(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef) #6 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { nocallback nofree nosync nounwind willreturn memory(none) }
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 = { 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 #5 = { 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 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 = { noreturn 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 = { noreturn 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !16, i64 136}
!13 = !{!"_ZTSN3zmq12v1_decoder_tE", !14, i64 0, !7, i64 64, !18, i64 72, !16, i64 136}
!14 = !{!"_ZTSN3zmq14decoder_base_tINS_12v1_decoder_tENS_18c_single_allocatorEEE", !15, i64 0, !7, i64 8, !6, i64 24, !16, i64 32, !17, i64 40, !6, i64 56}
!15 = !{!"_ZTSN3zmq9i_decoderE"}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN3zmq18c_single_allocatorE", !16, i64 0, !6, i64 8}
!18 = !{!"_ZTSN3zmq5msg_tE", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [114 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@__PRETTY_FUNCTION__._ZN3zmq12v1_decoder_t19one_byte_size_readyEPKh = external hidden unnamed_addr constant [66 x i8], align 1

declare noundef i32 @_ZN3zmq5msg_t4initEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #0

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #1

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

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

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

declare void @_ZN3zmq9zmq_abortEPKc(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3zmq14decoder_base_tINS_12v1_decoder_tENS_18c_single_allocatorEE9next_stepEPvmMS1_FiPKhE(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, i64 noundef, i64, i64) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -1, 1) i32 @_ZN3zmq12v1_decoder_t19one_byte_size_readyEPKh(ptr noundef nonnull align 8 dereferenceable(144) %0, ptr nocapture noundef readnone %1) local_unnamed_addr #5 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 64
  %4 = load i8, ptr %3, align 8, !tbaa !5
  switch i8 %4, label %8 [
    i8 -1, label %5
    i8 0, label %6
  ]

5:                                                ; preds = %2
  tail call void @_ZN3zmq14decoder_base_tINS_12v1_decoder_tENS_18c_single_allocatorEE9next_stepEPvmMS1_FiPKhE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull %3, i64 noundef 8, i64 ptrtoint (ptr @_ZN3zmq12v1_decoder_t21eight_byte_size_readyEPKh to i64), i64 0)
  br label %46

6:                                                ; preds = %2
  %7 = tail call ptr @__errno_location() #7
  store i32 71, ptr %7, align 4, !tbaa !8
  br label %46

8:                                                ; preds = %2
  %9 = zext i8 %4 to i64
  %10 = getelementptr inbounds i8, ptr %0, i64 136
  %11 = load i64, ptr %10, align 8, !tbaa !10
  %12 = icmp sgt i64 %11, -1
  %13 = add nsw i64 %9, -1
  %14 = icmp sgt i64 %13, %11
  %or.cond = select i1 %12, i1 %14, i1 false
  br i1 %or.cond, label %15, label %17

15:                                               ; preds = %8
  %16 = tail call ptr @__errno_location() #7
  store i32 90, ptr %16, align 4, !tbaa !8
  br label %46

17:                                               ; preds = %8
  %18 = getelementptr inbounds i8, ptr %0, i64 72
  %19 = tail call noundef i32 @_ZN3zmq5msg_t5closeEv(ptr noundef nonnull align 8 dereferenceable(64) %18)
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 80, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3zmq12v1_decoder_t19one_byte_size_readyEPKh) #8
  unreachable

22:                                               ; preds = %17
  %23 = load i8, ptr %3, align 8, !tbaa !5
  %24 = zext i8 %23 to i64
  %25 = add nsw i64 %24, -1
  %26 = tail call noundef i32 @_ZN3zmq5msg_t9init_sizeEm(ptr noundef nonnull align 8 dereferenceable(64) %18, i64 noundef %25)
  %.not13.not = icmp eq i32 %26, 0
  br i1 %.not13.not, label %.thread, label %27

27:                                               ; preds = %22
  %28 = tail call ptr @__errno_location() #7
  %29 = load i32, ptr %28, align 4, !tbaa !8
  %.not14 = icmp eq i32 %29, 12
  br i1 %.not14, label %36, label %30, !prof !18

30:                                               ; preds = %27
  %31 = tail call ptr @strerror(i32 noundef %29) #9
  %32 = load ptr, ptr @stderr, align 8, !tbaa !19
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str, ptr noundef %31, ptr noundef nonnull @.str.1, i32 noundef 83) #10
  %34 = load ptr, ptr @stderr, align 8, !tbaa !19
  %35 = tail call i32 @fflush(ptr noundef %34)
  tail call void @_ZN3zmq9zmq_abortEPKc(ptr noundef %31)
  br label %36

36:                                               ; preds = %30, %27
  %37 = tail call noundef i32 @_ZN3zmq5msg_t4initEv(ptr noundef nonnull align 8 dereferenceable(64) %18)
  %.not15 = icmp eq i32 %37, 0
  br i1 %.not15, label %45, label %38, !prof !18

38:                                               ; preds = %36
  %39 = load i32, ptr %28, align 4, !tbaa !8
  %40 = tail call ptr @strerror(i32 noundef %39) #9
  %41 = load ptr, ptr @stderr, align 8, !tbaa !19
  %42 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str, ptr noundef %40, ptr noundef nonnull @.str.1, i32 noundef 85) #10
  %43 = load ptr, ptr @stderr, align 8, !tbaa !19
  %44 = tail call i32 @fflush(ptr noundef %43)
  tail call void @_ZN3zmq9zmq_abortEPKc(ptr noundef %40)
  br label %45

.thread:                                          ; preds = %22
  tail call void @_ZN3zmq14decoder_base_tINS_12v1_decoder_tENS_18c_single_allocatorEE9next_stepEPvmMS1_FiPKhE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull %3, i64 noundef 1, i64 ptrtoint (ptr @_ZN3zmq12v1_decoder_t11flags_readyEPKh to i64), i64 0)
  br label %46

45:                                               ; preds = %36, %38
  store i32 12, ptr %28, align 4, !tbaa !8
  br label %46

46:                                               ; preds = %5, %.thread, %45, %15, %6
  %.1 = phi i32 [ -1, %15 ], [ -1, %45 ], [ -1, %6 ], [ 0, %.thread ], [ 0, %5 ]
  ret i32 %.1
}

declare noundef i32 @_ZN3zmq5msg_t5closeEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3zmq12v1_decoder_t21eight_byte_size_readyEPKh(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef) #5 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

declare noundef i32 @_ZN3zmq5msg_t9init_sizeEm(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3zmq12v1_decoder_t11flags_readyEPKh(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef) #5 align 2

attributes #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 = { 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 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 #3 = { 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 #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 = { 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 = { noreturn 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 #7 = { nounwind willreturn memory(none) }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { cold nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !15, i64 136}
!11 = !{!"_ZTSN3zmq12v1_decoder_tE", !12, i64 0, !6, i64 64, !17, i64 72, !15, i64 136}
!12 = !{!"_ZTSN3zmq14decoder_base_tINS_12v1_decoder_tENS_18c_single_allocatorEEE", !13, i64 0, !6, i64 8, !14, i64 24, !15, i64 32, !16, i64 40, !14, i64 56}
!13 = !{!"_ZTSN3zmq9i_decoderE"}
!14 = !{!"any pointer", !6, i64 0}
!15 = !{!"long", !6, i64 0}
!16 = !{!"_ZTSN3zmq18c_single_allocatorE", !15, i64 0, !14, i64 8}
!17 = !{!"_ZTSN3zmq5msg_tE", !6, i64 0}
!18 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!19 = !{!14, !14, i64 0}


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