; LLVM IR from godzilla-foundation/godzilla-community :: core/deps/nanomsg-1.1.5/src/protocols/reqrep (xrep)

; 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.nn_chunkref = type { %union.anon }
%union.anon = type { ptr, [24 x i8] }
%struct.nn_xrep = type { %struct.nn_sockbase, i32, %struct.nn_hash, %struct.nn_fq }
%struct.nn_sockbase = type { ptr, ptr }
%struct.nn_hash = type { i32, i32, ptr }
%struct.nn_fq = type { %struct.nn_priolist }
%struct.nn_priolist = type { [16 x %struct.nn_priolist_slot], i32 }
%struct.nn_priolist_slot = type { %struct.nn_list, ptr }
%struct.nn_list = type { ptr, ptr }
%struct.nn_msg = type { %struct.nn_chunkref, %struct.nn_chunkref, %struct.nn_chunkref }
%struct.nn_xrep_data = type { ptr, %struct.nn_hash_item, %struct.nn_fq_data, i32 }
%struct.nn_hash_item = type { i32, %struct.nn_list_item }
%struct.nn_list_item = type { ptr, ptr }
%struct.nn_fq_data = type { %struct.nn_priolist_data }
%struct.nn_priolist_data = type { ptr, i32, %struct.nn_list_item }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [124 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [36 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

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

declare void @nn_backtrace_print() #2

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

declare i32 @fflush(ptr noundef) #2

; Function Attrs: noreturn
declare void @nn_err_abort() #4

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

declare ptr @nn_pipe_getdata(ptr noundef) #2

declare i64 @nn_chunkref_size(ptr noundef) #2

declare void @nn_msg_term(ptr noundef) #2

declare i32 @nn_getl(ptr noundef) #2

declare ptr @nn_chunkref_data(ptr noundef) #2

declare void @nn_chunkref_trim(ptr noundef, i64 noundef) #2

declare ptr @nn_err_strerror(i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @nn_xrep_recv(ptr noundef %0, ptr noundef %1) #5 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca %struct.nn_chunkref, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %18, label %21

18:                                               ; preds = %2
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 0
  br label %22

21:                                               ; preds = %2
  br label %22

22:                                               ; preds = %21, %18
  %23 = phi ptr [ %20, %18 ], [ null, %21 ]
  store ptr %23, ptr %7, align 8, !tbaa !5
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.nn_xrep, ptr %24, i32 0, i32 3
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = call i32 @nn_fq_recv(ptr noundef %25, ptr noundef %26, ptr noundef %8)
  store i32 %27, ptr %6, align 4, !tbaa !9
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 0
  %30 = zext i1 %29 to i32
  %31 = sext i32 %30 to i64
  %32 = call i64 @llvm.expect.i64(i64 %31, i64 0)
  %33 = icmp ne i64 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %22
  %35 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %35, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %166

36:                                               ; preds = %22
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = and i32 %37, 2
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %142, label %40

40:                                               ; preds = %36
  store i64 4, ptr %12, align 8, !tbaa !11
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = call i32 @nn_sockbase_getopt(ptr noundef %41, i32 noundef 17, ptr noundef %10, ptr noundef %12)
  store i32 %42, ptr %6, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %40
  %44 = load i32, ptr %6, align 4, !tbaa !9
  %45 = icmp eq i32 %44, 0
  %46 = xor i1 %45, true
  %47 = zext i1 %46 to i32
  %48 = sext i32 %47 to i64
  %49 = call i64 @llvm.expect.i64(i64 %48, i64 0)
  %50 = icmp ne i64 %49, 0
  br i1 %50, label %51, label %61

51:                                               ; preds = %43
  call void @nn_backtrace_print()
  %52 = load ptr, ptr @stderr, align 8, !tbaa !5
  %53 = load i32, ptr %6, align 4, !tbaa !9
  %54 = sub nsw i32 0, %53
  %55 = call ptr @nn_err_strerror(i32 noundef %54)
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = sub nsw i32 0, %56
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef @.str.5, ptr noundef %55, i32 noundef %57, ptr noundef @.str.2, i32 noundef 213) #7
  %59 = load ptr, ptr @stderr, align 8, !tbaa !5
  %60 = call i32 @fflush(ptr noundef %59)
  call void @nn_err_abort() #8
  unreachable

61:                                               ; preds = %43
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.nn_msg, ptr %64, i32 0, i32 2
  %66 = call ptr @nn_chunkref_data(ptr noundef %65)
  store ptr %66, ptr %11, align 8, !tbaa !5
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.nn_msg, ptr %67, i32 0, i32 2
  %69 = call i64 @nn_chunkref_size(ptr noundef %68)
  store i64 %69, ptr %12, align 8, !tbaa !11
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %93, %63
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = mul i64 %74, 4
  %76 = load i64, ptr %12, align 8, !tbaa !11
  %77 = icmp ugt i64 %75, %76
  %78 = zext i1 %77 to i32
  %79 = sext i32 %78 to i64
  %80 = call i64 @llvm.expect.i64(i64 %79, i64 0)
  %81 = icmp ne i64 %80, 0
  br i1 %81, label %82, label %84

82:                                               ; preds = %71
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  call void @nn_msg_term(ptr noundef %83)
  store i32 -11, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %166

84:                                               ; preds = %71
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = load i32, ptr %9, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr %85, i64 %87
  %89 = call i32 @nn_getl(ptr noundef %88)
  %90 = and i32 %89, -2147483648
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %84
  br label %96

93:                                               ; preds = %84
  %94 = load i32, ptr %9, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %9, align 4, !tbaa !9
  br label %70

96:                                               ; preds = %92
  %97 = load i32, ptr %9, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %9, align 4, !tbaa !9
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = icmp sgt i32 %99, %100
  br i1 %101, label %102, label %104

102:                                              ; preds = %96
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  call void @nn_msg_term(ptr noundef %103)
  store i32 -11, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %166

104:                                              ; preds = %96
  br label %105

105:                                              ; preds = %104
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.nn_msg, ptr %106, i32 0, i32 0
  %108 = call i64 @nn_chunkref_size(ptr noundef %107)
  %109 = icmp eq i64 %108, 0
  %110 = xor i1 %109, true
  %111 = zext i1 %110 to i32
  %112 = sext i32 %111 to i64
  %113 = call i64 @llvm.expect.i64(i64 %112, i64 0)
  %114 = icmp ne i64 %113, 0
  br i1 %114, label %115, label %120

115:                                              ; preds = %105
  call void @nn_backtrace_print()
  %116 = load ptr, ptr @stderr, align 8, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str, ptr noundef @.str.6, ptr noundef @.str.2, i32 noundef 242) #7
  %118 = load ptr, ptr @stderr, align 8, !tbaa !5
  %119 = call i32 @fflush(ptr noundef %118)
  call void @nn_err_abort() #8
  unreachable

120:                                              ; preds = %105
  br label %121

121:                                              ; preds = %120
  br label %122

122:                                              ; preds = %121
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.nn_msg, ptr %123, i32 0, i32 0
  call void @nn_chunkref_term(ptr noundef %124)
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.nn_msg, ptr %125, i32 0, i32 0
  %127 = load i32, ptr %9, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = mul i64 %128, 4
  call void @nn_chunkref_init(ptr noundef %126, i64 noundef %129)
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.nn_msg, ptr %130, i32 0, i32 0
  %132 = call ptr @nn_chunkref_data(ptr noundef %131)
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = load i32, ptr %9, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = mul i64 %135, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %132, ptr align 1 %133, i64 %136, i1 false)
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.nn_msg, ptr %137, i32 0, i32 2
  %139 = load i32, ptr %9, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = mul i64 %140, 4
  call void @nn_chunkref_trim(ptr noundef %138, i64 noundef %141)
  br label %142

142:                                              ; preds = %122, %36
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = call ptr @nn_pipe_getdata(ptr noundef %143)
  store ptr %144, ptr %14, align 8, !tbaa !5
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.nn_msg, ptr %145, i32 0, i32 0
  %147 = call i64 @nn_chunkref_size(ptr noundef %146)
  %148 = add i64 %147, 4
  call void @nn_chunkref_init(ptr noundef %13, i64 noundef %148)
  %149 = call ptr @nn_chunkref_data(ptr noundef %13)
  %150 = load ptr, ptr %14, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.nn_xrep_data, ptr %150, i32 0, i32 1
  %152 = getelementptr inbounds %struct.nn_hash_item, ptr %151, i32 0, i32 0
  %153 = load i32, ptr %152, align 8, !tbaa !13
  call void @nn_putl(ptr noundef %149, i32 noundef %153)
  %154 = call ptr @nn_chunkref_data(ptr noundef %13)
  %155 = getelementptr inbounds i8, ptr %154, i64 4
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.nn_msg, ptr %156, i32 0, i32 0
  %158 = call ptr @nn_chunkref_data(ptr noundef %157)
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.nn_msg, ptr %159, i32 0, i32 0
  %161 = call i64 @nn_chunkref_size(ptr noundef %160)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %155, ptr align 1 %158, i64 %161, i1 false)
  %162 = load ptr, ptr %5, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.nn_msg, ptr %162, i32 0, i32 0
  call void @nn_chunkref_term(ptr noundef %163)
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.nn_msg, ptr %164, i32 0, i32 0
  call void @nn_chunkref_mv(ptr noundef %165, ptr noundef %13)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %166

166:                                              ; preds = %142, %102, %82, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %167 = load i32, ptr %3, align 4
  ret i32 %167
}

declare i32 @nn_fq_recv(ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @nn_sockbase_getopt(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare void @nn_chunkref_term(ptr noundef) #2

declare void @nn_chunkref_init(ptr noundef, i64 noundef) #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) #6

declare void @nn_putl(ptr noundef, i32 noundef) #2

declare void @nn_chunkref_mv(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #2 = { "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 = { noreturn "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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { noreturn }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"nn_xrep_data", !6, i64 0, !15, i64 8, !17, i64 32, !10, i64 64}
!15 = !{!"nn_hash_item", !10, i64 0, !16, i64 8}
!16 = !{!"nn_list_item", !6, i64 0, !6, i64 8}
!17 = !{!"nn_fq_data", !18, i64 0}
!18 = !{!"nn_priolist_data", !6, i64 0, !10, i64 8, !16, i64 16}


; 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.nn_chunkref = type { %union.anon }
%union.anon = type { ptr, [24 x i8] }

@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 [124 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [36 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 void @nn_backtrace_print() 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

; Function Attrs: noreturn
declare void @nn_err_abort() local_unnamed_addr #3

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

declare ptr @nn_pipe_getdata(ptr noundef) local_unnamed_addr #1

declare i64 @nn_chunkref_size(ptr noundef) local_unnamed_addr #1

declare void @nn_msg_term(ptr noundef) local_unnamed_addr #1

declare i32 @nn_getl(ptr noundef) local_unnamed_addr #1

declare ptr @nn_chunkref_data(ptr noundef) local_unnamed_addr #1

declare void @nn_chunkref_trim(ptr noundef, i64 noundef) local_unnamed_addr #1

declare ptr @nn_err_strerror(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -2147483648, 1) i32 @nn_xrep_recv(ptr noundef %0, ptr noundef %1) local_unnamed_addr #4 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca %struct.nn_chunkref, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = call i32 @nn_fq_recv(ptr noundef nonnull %7, ptr noundef %1, ptr noundef nonnull %3) #6
  %9 = icmp slt i32 %8, 0
  br i1 %9, label %58, label %10, !prof !5

10:                                               ; preds = %2
  %11 = and i32 %8, 2
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %12, label %46

12:                                               ; preds = %10
  store i64 4, ptr %5, align 8, !tbaa !6
  %13 = call i32 @nn_sockbase_getopt(ptr noundef %0, i32 noundef 17, ptr noundef nonnull %4, ptr noundef nonnull %5) #6
  %.not39 = icmp eq i32 %13, 0
  br i1 %.not39, label %21, label %14, !prof !10

14:                                               ; preds = %12
  call void @nn_backtrace_print() #6
  %15 = load ptr, ptr @stderr, align 8, !tbaa !11
  %16 = sub nsw i32 0, %13
  %17 = call ptr @nn_err_strerror(i32 noundef %16) #6
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.5, ptr noundef %17, i32 noundef %16, ptr noundef nonnull @.str.2, i32 noundef 213) #7
  %19 = load ptr, ptr @stderr, align 8, !tbaa !11
  %20 = call i32 @fflush(ptr noundef %19)
  call void @nn_err_abort() #8
  unreachable

21:                                               ; preds = %12
  %22 = getelementptr inbounds i8, ptr %1, i64 64
  %23 = call ptr @nn_chunkref_data(ptr noundef nonnull %22) #6
  %24 = call i64 @nn_chunkref_size(ptr noundef nonnull %22) #6
  store i64 %24, ptr %5, align 8, !tbaa !6
  br label %25

25:                                               ; preds = %30, %21
  %indvars.iv = phi i64 [ %indvars.iv.next, %30 ], [ 0, %21 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = shl nuw nsw i64 %indvars.iv.next, 2
  %27 = load i64, ptr %5, align 8, !tbaa !6
  %28 = icmp ugt i64 %26, %27
  br i1 %28, label %29, label %30, !prof !5

29:                                               ; preds = %25
  call void @nn_msg_term(ptr noundef %1) #6
  br label %58

30:                                               ; preds = %25
  %31 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv
  %32 = call i32 @nn_getl(ptr noundef %31) #6
  %.not40 = icmp sgt i32 %32, -1
  br i1 %.not40, label %25, label %33

33:                                               ; preds = %30
  %34 = trunc nuw nsw i64 %indvars.iv to i32
  %35 = load i32, ptr %4, align 4, !tbaa !13
  %.not41 = icmp sgt i32 %35, %34
  br i1 %.not41, label %37, label %36

36:                                               ; preds = %33
  call void @nn_msg_term(ptr noundef %1) #6
  br label %58

37:                                               ; preds = %33
  %38 = call i64 @nn_chunkref_size(ptr noundef %1) #6
  %.not42 = icmp eq i64 %38, 0
  br i1 %.not42, label %44, label %39, !prof !10

39:                                               ; preds = %37
  call void @nn_backtrace_print() #6
  %40 = load ptr, ptr @stderr, align 8, !tbaa !11
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.2, i32 noundef 242) #7
  %42 = load ptr, ptr @stderr, align 8, !tbaa !11
  %43 = call i32 @fflush(ptr noundef %42)
  call void @nn_err_abort() #8
  unreachable

44:                                               ; preds = %37
  call void @nn_chunkref_term(ptr noundef %1) #6
  call void @nn_chunkref_init(ptr noundef %1, i64 noundef %26) #6
  %45 = call ptr @nn_chunkref_data(ptr noundef %1) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %45, ptr noundef nonnull align 1 dereferenceable(1) %23, i64 %26, i1 false)
  call void @nn_chunkref_trim(ptr noundef nonnull %22, i64 noundef %26) #6
  br label %46

46:                                               ; preds = %44, %10
  %47 = load ptr, ptr %3, align 8, !tbaa !11
  %48 = call ptr @nn_pipe_getdata(ptr noundef %47) #6
  %49 = call i64 @nn_chunkref_size(ptr noundef %1) #6
  %50 = add i64 %49, 4
  call void @nn_chunkref_init(ptr noundef nonnull %6, i64 noundef %50) #6
  %51 = call ptr @nn_chunkref_data(ptr noundef nonnull %6) #6
  %52 = getelementptr inbounds i8, ptr %48, i64 8
  %53 = load i32, ptr %52, align 8, !tbaa !15
  call void @nn_putl(ptr noundef %51, i32 noundef %53) #6
  %54 = call ptr @nn_chunkref_data(ptr noundef nonnull %6) #6
  %55 = getelementptr inbounds i8, ptr %54, i64 4
  %56 = call ptr @nn_chunkref_data(ptr noundef %1) #6
  %57 = call i64 @nn_chunkref_size(ptr noundef %1) #6
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %55, ptr align 1 %56, i64 %57, i1 false)
  call void @nn_chunkref_term(ptr noundef %1) #6
  call void @nn_chunkref_mv(ptr noundef %1, ptr noundef nonnull %6) #6
  br label %58

58:                                               ; preds = %2, %46, %36, %29
  %.0 = phi i32 [ 0, %46 ], [ -11, %29 ], [ -11, %36 ], [ %8, %2 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 %.0
}

declare i32 @nn_fq_recv(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @nn_sockbase_getopt(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @nn_chunkref_term(ptr noundef) local_unnamed_addr #1

declare void @nn_chunkref_init(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress 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

declare void @nn_putl(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @nn_chunkref_mv(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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 = { 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 = { noreturn "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 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { cold nounwind }
attributes #8 = { 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 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!6 = !{!7, !7, i64 0}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!16, !14, i64 8}
!16 = !{!"nn_xrep_data", !12, i64 0, !17, i64 8, !19, i64 32, !14, i64 64}
!17 = !{!"nn_hash_item", !14, i64 0, !18, i64 8}
!18 = !{!"nn_list_item", !12, i64 0, !12, i64 8}
!19 = !{!"nn_fq_data", !20, i64 0}
!20 = !{!"nn_priolist_data", !12, i64 0, !14, i64 8, !18, i64 16}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopUnrollPass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass