; LLVM IR from kala13x/libxutils :: src/net (sock)

; 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.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.XSocketInfo = type { [128 x i8], [256 x i8], i32, i32, i16 }
%struct.sockaddr = type { i16, [14 x i8] }
%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }
%struct.sockaddr_in6 = type { i16, i16, i32, %struct.in6_addr, i32 }
%struct.in6_addr = type { %union.anon }
%union.anon = type { [4 x i32] }

; 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(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @XSock_NetAddr(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @XSock_AddrInfo(ptr noundef %0, i32 noundef %1, ptr noundef %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %struct.addrinfo, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 -1, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 48, i1 false)
  %14 = getelementptr inbounds %struct.addrinfo, ptr %8, i32 0, i32 2
  store i32 1, ptr %14, align 8, !tbaa !11
  %15 = getelementptr inbounds %struct.addrinfo, ptr %8, i32 0, i32 1
  store i32 0, ptr %15, align 4, !tbaa !13
  %16 = getelementptr inbounds %struct.addrinfo, ptr %8, i32 0, i32 0
  %17 = load i32, ptr %16, align 8, !tbaa !14
  %18 = or i32 %17, 2
  store i32 %18, ptr %16, align 8, !tbaa !14
  %19 = getelementptr inbounds %struct.addrinfo, ptr %8, i32 0, i32 6
  store ptr null, ptr %19, align 8, !tbaa !15
  %20 = getelementptr inbounds %struct.addrinfo, ptr %8, i32 0, i32 5
  store ptr null, ptr %20, align 8, !tbaa !16
  %21 = getelementptr inbounds %struct.addrinfo, ptr %8, i32 0, i32 7
  store ptr null, ptr %21, align 8, !tbaa !17
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = call i32 @getaddrinfo(ptr noundef %22, ptr noundef null, ptr noundef %8, ptr noundef %10)
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %27

25:                                               ; preds = %3
  %26 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %26, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %124

27:                                               ; preds = %3
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.XSocketInfo, ptr %28, i32 0, i32 2
  store i32 0, ptr %29, align 4, !tbaa !18
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %30, ptr %9, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %117, %27
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %121

34:                                               ; preds = %31
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.addrinfo, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !13
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.addrinfo, ptr %38, i32 0, i32 5
  %40 = load ptr, ptr %39, align 8, !tbaa !16
  %41 = getelementptr inbounds %struct.sockaddr, ptr %40, i32 0, i32 1
  %42 = getelementptr inbounds [14 x i8], ptr %41, i64 0, i64 0
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.XSocketInfo, ptr %43, i32 0, i32 0
  %45 = getelementptr inbounds [128 x i8], ptr %44, i64 0, i64 0
  %46 = call ptr @inet_ntop(i32 noundef %37, ptr noundef %42, ptr noundef %45, i32 noundef 128) #5
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.XSocketInfo, ptr %47, i32 0, i32 0
  %49 = getelementptr inbounds [128 x i8], ptr %48, i64 0, i64 0
  %50 = call zeroext i8 @xstrused(ptr noundef %49)
  %51 = icmp ne i8 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %34
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %52, %34
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = icmp eq i32 %54, 4
  br i1 %55, label %56, label %68

56:                                               ; preds = %53
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.addrinfo, ptr %57, i32 0, i32 1
  %59 = load i32, ptr %58, align 4, !tbaa !13
  %60 = icmp eq i32 %59, 2
  br i1 %60, label %61, label %68

61:                                               ; preds = %56
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.addrinfo, ptr %62, i32 0, i32 5
  %64 = load ptr, ptr %63, align 8, !tbaa !16
  %65 = getelementptr inbounds %struct.sockaddr_in, ptr %64, i32 0, i32 2
  store ptr %65, ptr %12, align 8, !tbaa !5
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.XSocketInfo, ptr %66, i32 0, i32 2
  store i32 4, ptr %67, align 4, !tbaa !18
  br label %84

68:                                               ; preds = %56, %53
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = icmp eq i32 %69, 6
  br i1 %70, label %71, label %83

71:                                               ; preds = %68
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.addrinfo, ptr %72, i32 0, i32 1
  %74 = load i32, ptr %73, align 4, !tbaa !13
  %75 = icmp eq i32 %74, 10
  br i1 %75, label %76, label %83

76:                                               ; preds = %71
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.addrinfo, ptr %77, i32 0, i32 5
  %79 = load ptr, ptr %78, align 8, !tbaa !16
  %80 = getelementptr inbounds %struct.sockaddr_in6, ptr %79, i32 0, i32 3
  store ptr %80, ptr %12, align 8, !tbaa !5
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.XSocketInfo, ptr %81, i32 0, i32 2
  store i32 6, ptr %82, align 4, !tbaa !18
  br label %83

83:                                               ; preds = %76, %71, %68
  br label %84

84:                                               ; preds = %83, %61
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %116

87:                                               ; preds = %84
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.addrinfo, ptr %88, i32 0, i32 1
  %90 = load i32, ptr %89, align 4, !tbaa !13
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.XSocketInfo, ptr %92, i32 0, i32 0
  %94 = getelementptr inbounds [128 x i8], ptr %93, i64 0, i64 0
  %95 = call ptr @inet_ntop(i32 noundef %90, ptr noundef %91, ptr noundef %94, i32 noundef 128) #5
  %96 = icmp eq ptr %95, null
  br i1 %96, label %97, label %100

97:                                               ; preds = %87
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %98) #5
  %99 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %99, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %124

100:                                              ; preds = %87
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.XSocketInfo, ptr %101, i32 0, i32 1
  %103 = getelementptr inbounds [256 x i8], ptr %102, i64 0, i64 0
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.addrinfo, ptr %104, i32 0, i32 6
  %106 = load ptr, ptr %105, align 8, !tbaa !15
  %107 = call i64 @xstrncpy(ptr noundef %103, i64 noundef 256, ptr noundef %106)
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.XSocketInfo, ptr %108, i32 0, i32 0
  %110 = getelementptr inbounds [128 x i8], ptr %109, i64 0, i64 0
  %111 = call i32 @XSock_NetAddr(ptr noundef %110)
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.XSocketInfo, ptr %112, i32 0, i32 3
  store i32 %111, ptr %113, align 4, !tbaa !21
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.XSocketInfo, ptr %114, i32 0, i32 4
  store i16 0, ptr %115, align 4, !tbaa !22
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %121

116:                                              ; preds = %84
  br label %117

117:                                              ; preds = %116
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.addrinfo, ptr %118, i32 0, i32 7
  %120 = load ptr, ptr %119, align 8, !tbaa !17
  store ptr %120, ptr %9, align 8, !tbaa !5
  br label %31, !llvm.loop !23

121:                                              ; preds = %100, %31
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %122) #5
  %123 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %123, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %124

124:                                              ; preds = %121, %97, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #5
  %125 = load i32, ptr %4, align 4
  ret i32 %125
}

declare i32 @getaddrinfo(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind
declare ptr @inet_ntop(i32 noundef, ptr noundef, ptr noundef, i32 noundef) #4

declare zeroext i8 @xstrused(ptr noundef) #3

; Function Attrs: nounwind
declare void @freeaddrinfo(ptr noundef) #4

declare i64 @xstrncpy(ptr noundef, i64 noundef, ptr noundef) #3

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

!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, !10, i64 8}
!12 = !{!"addrinfo", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !10, i64 0}
!15 = !{!12, !6, i64 32}
!16 = !{!12, !6, i64 24}
!17 = !{!12, !6, i64 40}
!18 = !{!19, !10, i64 384}
!19 = !{!"XSocketInfo", !7, i64 0, !7, i64 128, !10, i64 384, !10, i64 388, !20, i64 392}
!20 = !{!"short", !7, i64 0}
!21 = !{!19, !10, i64 388}
!22 = !{!19, !20, i64 392}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; 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.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @XSock_NetAddr(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @XSock_AddrInfo(ptr noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.addrinfo, align 8
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store ptr null, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %4, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %6, i8 0, i64 16, i1 false)
  %7 = getelementptr inbounds i8, ptr %4, i64 8
  store i32 1, ptr %7, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 0, ptr %8, align 4, !tbaa !12
  store i32 2, ptr %4, align 8, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %4, i64 24
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %9, i8 0, i64 24, i1 false)
  %10 = call i32 @getaddrinfo(ptr noundef %2, ptr noundef null, ptr noundef nonnull %4, ptr noundef nonnull %5) #5
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %64

11:                                               ; preds = %3
  %12 = getelementptr inbounds i8, ptr %0, i64 384
  store i32 0, ptr %12, align 4, !tbaa !14
  %.02435 = load ptr, ptr %5, align 8, !tbaa !5
  %.not2636 = icmp eq ptr %.02435, null
  br i1 %.not2636, label %.sink.split, label %.lr.ph

.lr.ph:                                           ; preds = %11
  switch i32 %1, label %.lr.ph.split [
    i32 4, label %.lr.ph.split.us
    i32 6, label %.lr.ph.split.us40
  ]

.lr.ph.split.us:                                  ; preds = %.lr.ph, %24
  %.02438.us = phi ptr [ %.024.us, %24 ], [ %.02435, %.lr.ph ]
  %.02237.us = phi i32 [ %spec.select.us, %24 ], [ -1, %.lr.ph ]
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 4
  %15 = load i32, ptr %14, align 4, !tbaa !12
  %16 = getelementptr inbounds i8, ptr %13, i64 24
  %17 = load ptr, ptr %16, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %17, i64 2
  %19 = call ptr @inet_ntop(i32 noundef %15, ptr noundef nonnull %18, ptr noundef %0, i32 noundef 128) #5
  %20 = call zeroext i8 @xstrused(ptr noundef %0) #5
  %.not27.us = icmp eq i8 %20, 0
  %spec.select.us = select i1 %.not27.us, i32 %.02237.us, i32 0
  %21 = getelementptr inbounds i8, ptr %.02438.us, i64 4
  %22 = load i32, ptr %21, align 4, !tbaa !12
  %23 = icmp eq i32 %22, 2
  br i1 %23, label %.split.us, label %24

24:                                               ; preds = %.lr.ph.split.us
  %25 = getelementptr inbounds i8, ptr %.02438.us, i64 40
  %.024.us = load ptr, ptr %25, align 8, !tbaa !5
  %.not26.us = icmp eq ptr %.024.us, null
  br i1 %.not26.us, label %.sink.split, label %.lr.ph.split.us, !llvm.loop !18

.lr.ph.split.us40:                                ; preds = %.lr.ph, %37
  %.02438.us41 = phi ptr [ %.024.us45, %37 ], [ %.02435, %.lr.ph ]
  %.02237.us42 = phi i32 [ %spec.select.us44, %37 ], [ -1, %.lr.ph ]
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !12
  %29 = getelementptr inbounds i8, ptr %26, i64 24
  %30 = load ptr, ptr %29, align 8, !tbaa !17
  %31 = getelementptr inbounds i8, ptr %30, i64 2
  %32 = call ptr @inet_ntop(i32 noundef %28, ptr noundef nonnull %31, ptr noundef %0, i32 noundef 128) #5
  %33 = call zeroext i8 @xstrused(ptr noundef %0) #5
  %.not27.us43 = icmp eq i8 %33, 0
  %spec.select.us44 = select i1 %.not27.us43, i32 %.02237.us42, i32 0
  %34 = getelementptr inbounds i8, ptr %.02438.us41, i64 4
  %35 = load i32, ptr %34, align 4, !tbaa !12
  %36 = icmp eq i32 %35, 10
  br i1 %36, label %.split.us, label %37

37:                                               ; preds = %.lr.ph.split.us40
  %38 = getelementptr inbounds i8, ptr %.02438.us41, i64 40
  %.024.us45 = load ptr, ptr %38, align 8, !tbaa !5
  %.not26.us46 = icmp eq ptr %.024.us45, null
  br i1 %.not26.us46, label %.sink.split, label %.lr.ph.split.us40, !llvm.loop !18

.lr.ph.split:                                     ; preds = %.lr.ph, %.lr.ph.split
  %.02438 = phi ptr [ %.024, %.lr.ph.split ], [ %.02435, %.lr.ph ]
  %.02237 = phi i32 [ %spec.select, %.lr.ph.split ], [ -1, %.lr.ph ]
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 4
  %41 = load i32, ptr %40, align 4, !tbaa !12
  %42 = getelementptr inbounds i8, ptr %39, i64 24
  %43 = load ptr, ptr %42, align 8, !tbaa !17
  %44 = getelementptr inbounds i8, ptr %43, i64 2
  %45 = call ptr @inet_ntop(i32 noundef %41, ptr noundef nonnull %44, ptr noundef %0, i32 noundef 128) #5
  %46 = call zeroext i8 @xstrused(ptr noundef %0) #5
  %.not27 = icmp eq i8 %46, 0
  %spec.select = select i1 %.not27, i32 %.02237, i32 0
  %47 = getelementptr inbounds i8, ptr %.02438, i64 40
  %.024 = load ptr, ptr %47, align 8, !tbaa !5
  %.not26 = icmp eq ptr %.024, null
  br i1 %.not26, label %.sink.split, label %.lr.ph.split, !llvm.loop !18

.split.us:                                        ; preds = %.lr.ph.split.us40, %.lr.ph.split.us
  %.sink60 = phi i64 [ 4, %.lr.ph.split.us ], [ 8, %.lr.ph.split.us40 ]
  %spec.select34 = phi i32 [ %spec.select.us, %.lr.ph.split.us ], [ %spec.select.us44, %.lr.ph.split.us40 ]
  %.sink = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %.sink, i64 24
  %49 = load ptr, ptr %48, align 8, !tbaa !17
  %50 = getelementptr inbounds i8, ptr %49, i64 %.sink60
  store i32 %1, ptr %12, align 4, !tbaa !14
  %51 = getelementptr inbounds i8, ptr %.sink, i64 4
  %52 = load i32, ptr %51, align 4, !tbaa !12
  %53 = call ptr @inet_ntop(i32 noundef %52, ptr noundef nonnull %50, ptr noundef nonnull %0, i32 noundef 128) #5
  %54 = icmp eq ptr %53, null
  br i1 %54, label %.sink.split, label %55

55:                                               ; preds = %.split.us
  %56 = getelementptr inbounds i8, ptr %0, i64 128
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 32
  %59 = load ptr, ptr %58, align 8, !tbaa !20
  %60 = call i64 @xstrncpy(ptr noundef nonnull %56, i64 noundef 256, ptr noundef %59) #5
  %61 = call i32 @XSock_NetAddr(ptr noundef nonnull %0)
  %62 = getelementptr inbounds i8, ptr %0, i64 388
  store i32 %61, ptr %62, align 4, !tbaa !21
  %63 = getelementptr inbounds i8, ptr %0, i64 392
  store i16 0, ptr %63, align 4, !tbaa !22
  br label %.sink.split

.sink.split:                                      ; preds = %37, %24, %.lr.ph.split, %55, %11, %.split.us
  %.025.ph = phi i32 [ %spec.select34, %.split.us ], [ 1, %55 ], [ -1, %11 ], [ %spec.select, %.lr.ph.split ], [ %spec.select.us, %24 ], [ %spec.select.us44, %37 ]
  %.sink62 = load ptr, ptr %5, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %.sink62) #5
  br label %64

64:                                               ; preds = %.sink.split, %3
  %.025 = phi i32 [ -1, %3 ], [ %.025.ph, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  ret i32 %.025
}

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

; Function Attrs: nounwind
declare ptr @inet_ntop(i32 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare zeroext i8 @xstrused(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @freeaddrinfo(ptr noundef) local_unnamed_addr #4

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

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

!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, !11, i64 8}
!10 = !{!"addrinfo", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!10, !11, i64 0}
!14 = !{!15, !11, i64 384}
!15 = !{!"XSocketInfo", !7, i64 0, !7, i64 128, !11, i64 384, !11, i64 388, !16, i64 392}
!16 = !{!"short", !7, i64 0}
!17 = !{!10, !6, i64 24}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!10, !6, i64 32}
!21 = !{!15, !11, i64 388}
!22 = !{!15, !16, i64 392}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass