; LLVM IR from erwincoumans/tiny-differentiable-simulator :: third_party/zeromq/src (tcp_address)

; 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::tcp_address_mask_t" = type { %"union.zmq::ip_addr_t", i32 }
%"union.zmq::ip_addr_t" = type { %struct.sockaddr_in6 }
%struct.sockaddr_in6 = type { i16, i16, i32, %struct.in6_addr, i32 }
%struct.in6_addr = type { %union.anon }
%union.anon = type { [4 x i32] }

@__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv6_prefix = external hidden unnamed_addr constant [2 x i8], align 1
@__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv6_suffix = external hidden unnamed_addr constant [3 x i8], align 1
@__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv4_suffix = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; 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) #0

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

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

declare noundef i32 @_ZNK3zmq9ip_addr_t6familyEv(ptr noundef nonnull align 4 dereferenceable(28)) #2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

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

declare noundef ptr @_ZNK3zmq9ip_addr_t11as_sockaddrEv(ptr noundef nonnull align 4 dereferenceable(28)) #2

declare noundef i32 @_ZNK3zmq9ip_addr_t12sockaddr_lenEv(ptr noundef nonnull align 4 dereferenceable(28)) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignEPKcm(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 4 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #4 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [1025 x i8], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca [2 x i8], align 1
  %11 = alloca [3 x i8], align 1
  %12 = alloca [2 x i8], align 1
  %13 = alloca [1034 x i8], align 16
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  %17 = getelementptr inbounds %"class.zmq::tcp_address_mask_t", ptr %16, i32 0, i32 0
  %18 = call noundef i32 @_ZNK3zmq9ip_addr_t6familyEv(ptr noundef nonnull align 4 dereferenceable(28) %17)
  %19 = icmp ne i32 %18, 2
  br i1 %19, label %20, label %26

20:                                               ; preds = %2
  %21 = getelementptr inbounds %"class.zmq::tcp_address_mask_t", ptr %16, i32 0, i32 0
  %22 = call noundef i32 @_ZNK3zmq9ip_addr_t6familyEv(ptr noundef nonnull align 4 dereferenceable(28) %21)
  %23 = icmp ne i32 %22, 10
  br i1 %23, label %24, label %26

24:                                               ; preds = %20
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %25) #7
  store i32 -1, ptr %3, align 4
  br label %93

26:                                               ; preds = %20, %2
  %27 = getelementptr inbounds %"class.zmq::tcp_address_mask_t", ptr %16, i32 0, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !9
  %29 = icmp eq i32 %28, -1
  br i1 %29, label %30, label %32

30:                                               ; preds = %26
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %31) #7
  store i32 -1, ptr %3, align 4
  br label %93

32:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 1025, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %33 = getelementptr inbounds %"class.zmq::tcp_address_mask_t", ptr %16, i32 0, i32 0
  %34 = call noundef ptr @_ZNK3zmq9ip_addr_t11as_sockaddrEv(ptr noundef nonnull align 4 dereferenceable(28) %33)
  %35 = getelementptr inbounds %"class.zmq::tcp_address_mask_t", ptr %16, i32 0, i32 0
  %36 = call noundef i32 @_ZNK3zmq9ip_addr_t12sockaddr_lenEv(ptr noundef nonnull align 4 dereferenceable(28) %35)
  %37 = getelementptr inbounds [1025 x i8], ptr %6, i64 0, i64 0
  %38 = call i32 @getnameinfo(ptr noundef %34, i32 noundef %36, ptr noundef %37, i32 noundef 1025, ptr noundef null, i32 noundef 0, i32 noundef 1)
  store i32 %38, ptr %7, align 4, !tbaa !12
  %39 = load i32, ptr %7, align 4, !tbaa !12
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %32
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %42) #7
  %43 = load i32, ptr %7, align 4, !tbaa !12
  store i32 %43, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %92

44:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 4, ptr %9, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %10, ptr align 1 @__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv6_prefix, i64 2, i1 false)
  call void @llvm.lifetime.start.p0(i64 3, ptr %11) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %11, ptr align 1 @__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv6_suffix, i64 3, i1 false)
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %12, ptr align 1 @__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv4_suffix, i64 2, i1 false)
  call void @llvm.lifetime.start.p0(i64 1034, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %45 = getelementptr inbounds [1034 x i8], ptr %13, i64 0, i64 0
  store ptr %45, ptr %14, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.zmq::tcp_address_mask_t", ptr %16, i32 0, i32 0
  %47 = call noundef i32 @_ZNK3zmq9ip_addr_t6familyEv(ptr noundef nonnull align 4 dereferenceable(28) %46)
  %48 = icmp eq i32 %47, 10
  br i1 %48, label %49, label %54

49:                                               ; preds = %44
  %50 = load ptr, ptr %14, align 8, !tbaa !5
  %51 = getelementptr inbounds [2 x i8], ptr %10, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %50, ptr align 1 %51, i64 1, i1 false)
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 1
  store ptr %53, ptr %14, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %49, %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %55 = getelementptr inbounds [1025 x i8], ptr %6, i64 0, i64 0
  %56 = call i64 @strlen(ptr noundef %55) #8
  store i64 %56, ptr %15, align 8, !tbaa !13
  %57 = load ptr, ptr %14, align 8, !tbaa !5
  %58 = getelementptr inbounds [1025 x i8], ptr %6, i64 0, i64 0
  %59 = load i64, ptr %15, align 8, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %57, ptr align 16 %58, i64 %59, i1 false)
  %60 = load i64, ptr %15, align 8, !tbaa !13
  %61 = load ptr, ptr %14, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 %60
  store ptr %62, ptr %14, align 8, !tbaa !5
  %63 = getelementptr inbounds %"class.zmq::tcp_address_mask_t", ptr %16, i32 0, i32 0
  %64 = call noundef i32 @_ZNK3zmq9ip_addr_t6familyEv(ptr noundef nonnull align 4 dereferenceable(28) %63)
  %65 = icmp eq i32 %64, 10
  br i1 %65, label %66, label %71

66:                                               ; preds = %54
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = getelementptr inbounds [3 x i8], ptr %11, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %67, ptr align 1 %68, i64 2, i1 false)
  %69 = load ptr, ptr %14, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 2
  store ptr %70, ptr %14, align 8, !tbaa !5
  br label %76

71:                                               ; preds = %54
  %72 = load ptr, ptr %14, align 8, !tbaa !5
  %73 = getelementptr inbounds [2 x i8], ptr %12, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %72, ptr align 1 %73, i64 1, i1 false)
  %74 = load ptr, ptr %14, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %74, i64 1
  store ptr %75, ptr %14, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %71, %66
  %77 = load ptr, ptr %14, align 8, !tbaa !5
  %78 = getelementptr inbounds %"class.zmq::tcp_address_mask_t", ptr %16, i32 0, i32 1
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %77, ptr noundef @.str.4, i32 noundef %79) #7
  %81 = load ptr, ptr %14, align 8, !tbaa !5
  %82 = sext i32 %80 to i64
  %83 = getelementptr inbounds i8, ptr %81, i64 %82
  store ptr %83, ptr %14, align 8, !tbaa !5
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds [1034 x i8], ptr %13, i64 0, i64 0
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = getelementptr inbounds [1034 x i8], ptr %13, i64 0, i64 0
  %88 = ptrtoint ptr %86 to i64
  %89 = ptrtoint ptr %87 to i64
  %90 = sub i64 %88, %89
  %91 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %84, ptr noundef %85, i64 noundef %90)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 1034, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 3, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %92

92:                                               ; preds = %76, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 1025, ptr %6) #7
  br label %93

93:                                               ; preds = %92, %30, %24
  %94 = load i32, ptr %3, align 4
  ret i32 %94
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #6

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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 28}
!10 = !{!"_ZTSN3zmq18tcp_address_mask_tE", !7, i64 0, !11, i64 28}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !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"

@__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv6_prefix = external hidden unnamed_addr constant [2 x i8], align 1
@__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv6_suffix = external hidden unnamed_addr constant [3 x i8], align 1
@__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv4_suffix = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 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) #0

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

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

declare noundef i32 @_ZNK3zmq9ip_addr_t6familyEv(ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

declare i32 @getnameinfo(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare noundef ptr @_ZNK3zmq9ip_addr_t11as_sockaddrEv(ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #2

declare noundef i32 @_ZNK3zmq9ip_addr_t12sockaddr_lenEv(ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignEPKcm(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 4 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #4 align 2 {
  %3 = alloca [1025 x i8], align 16
  %4 = alloca [1034 x i8], align 16
  %5 = tail call noundef i32 @_ZNK3zmq9ip_addr_t6familyEv(ptr noundef nonnull align 4 dereferenceable(28) %0)
  %.not = icmp eq i32 %5, 2
  br i1 %.not, label %9, label %6

6:                                                ; preds = %2
  %7 = tail call noundef i32 @_ZNK3zmq9ip_addr_t6familyEv(ptr noundef nonnull align 4 dereferenceable(28) %0)
  %.not24 = icmp eq i32 %7, 10
  br i1 %.not24, label %9, label %8

8:                                                ; preds = %6
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  br label %43

9:                                                ; preds = %6, %2
  %10 = getelementptr inbounds i8, ptr %0, i64 28
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = icmp eq i32 %11, -1
  br i1 %12, label %13, label %14

13:                                               ; preds = %9
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  br label %43

14:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 1025, ptr nonnull %3) #7
  %15 = tail call noundef ptr @_ZNK3zmq9ip_addr_t11as_sockaddrEv(ptr noundef nonnull align 4 dereferenceable(28) %0)
  %16 = tail call noundef i32 @_ZNK3zmq9ip_addr_t12sockaddr_lenEv(ptr noundef nonnull align 4 dereferenceable(28) %0)
  %17 = call i32 @getnameinfo(ptr noundef %15, i32 noundef %16, ptr noundef nonnull %3, i32 noundef 1025, ptr noundef null, i32 noundef 0, i32 noundef 1)
  %.not25 = icmp eq i32 %17, 0
  br i1 %.not25, label %19, label %18

18:                                               ; preds = %14
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  br label %42

19:                                               ; preds = %14
  %.sroa.012.0.copyload = load i16, ptr @__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv6_prefix, align 1
  %.sroa.0.0.copyload = load i16, ptr @__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv4_suffix, align 1
  call void @llvm.lifetime.start.p0(i64 1034, ptr nonnull %4) #7
  %20 = call noundef i32 @_ZNK3zmq9ip_addr_t6familyEv(ptr noundef nonnull align 4 dereferenceable(28) %0)
  %21 = icmp eq i32 %20, 10
  br i1 %21, label %22, label %24

22:                                               ; preds = %19
  %.sroa.012.0.extract.trunc = trunc i16 %.sroa.012.0.copyload to i8
  store i8 %.sroa.012.0.extract.trunc, ptr %4, align 16
  %23 = getelementptr inbounds i8, ptr %4, i64 1
  br label %24

24:                                               ; preds = %22, %19
  %.021 = phi ptr [ %23, %22 ], [ %4, %19 ]
  %25 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #8
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %.021, ptr nonnull align 16 %3, i64 %25, i1 false)
  %26 = getelementptr inbounds i8, ptr %.021, i64 %25
  %27 = call noundef i32 @_ZNK3zmq9ip_addr_t6familyEv(ptr noundef nonnull align 4 dereferenceable(28) %0)
  %28 = icmp eq i32 %27, 10
  br i1 %28, label %29, label %31

29:                                               ; preds = %24
  %30 = load i16, ptr @__const._ZNK3zmq18tcp_address_mask_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.ipv6_suffix, align 1
  store i16 %30, ptr %26, align 1
  br label %32

31:                                               ; preds = %24
  %.sroa.0.0.extract.trunc = trunc i16 %.sroa.0.0.copyload to i8
  store i8 %.sroa.0.0.extract.trunc, ptr %26, align 1
  br label %32

32:                                               ; preds = %31, %29
  %.sink = phi i64 [ 1, %31 ], [ 2, %29 ]
  %33 = getelementptr inbounds i8, ptr %26, i64 %.sink
  %34 = load i32, ptr %10, align 4, !tbaa !5
  %35 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %33, ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %34) #7
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds i8, ptr %33, i64 %36
  %38 = ptrtoint ptr %37 to i64
  %39 = ptrtoint ptr %4 to i64
  %40 = sub i64 %38, %39
  %41 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %4, i64 noundef %40)
  call void @llvm.lifetime.end.p0(i64 1034, ptr nonnull %4) #7
  br label %42

42:                                               ; preds = %32, %18
  call void @llvm.lifetime.end.p0(i64 1025, ptr nonnull %3) #7
  br label %43

43:                                               ; preds = %42, %13, %8
  %.1 = phi i32 [ -1, %8 ], [ -1, %13 ], [ %17, %42 ]
  ret i32 %.1
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #6

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

!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, !9, i64 28}
!6 = !{!"_ZTSN3zmq18tcp_address_mask_tE", !7, i64 0, !9, i64 28}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"int", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass