; LLVM IR from goldsborough/ipc-bench :: source/tcp/other (server)

; 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.sockaddr_storage = type { i16, [118 x i8], i64 }

@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [44 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: nounwind uwtable
declare dso_local ptr @get_in_addr(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @print_address(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.addrinfo, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.sockaddr_storage, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca [46 x i8], align 16
  %15 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 1, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 46, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 48, i1 false)
  %16 = getelementptr inbounds %struct.addrinfo, ptr %8, i32 0, i32 1
  store i32 0, ptr %16, align 4, !tbaa !11
  %17 = getelementptr inbounds %struct.addrinfo, ptr %8, i32 0, i32 2
  store i32 1, ptr %17, align 8, !tbaa !13
  %18 = getelementptr inbounds %struct.addrinfo, ptr %8, i32 0, i32 0
  store i32 1, ptr %18, align 8, !tbaa !14
  %19 = call i32 @getaddrinfo(ptr noundef null, ptr noundef @.str.3, ptr noundef %8, ptr noundef %9)
  store i32 %19, ptr %15, align 4, !tbaa !5
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %26

21:                                               ; preds = %2
  %22 = load ptr, ptr @stderr, align 8, !tbaa !9
  %23 = load i32, ptr %15, align 4, !tbaa !5
  %24 = call ptr @gai_strerror(i32 noundef %23) #6
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef @.str.4, ptr noundef %24) #6
  call void @exit(i32 noundef 1) #7
  unreachable

26:                                               ; preds = %2
  %27 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %27, ptr %10, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %64, %26
  %29 = load ptr, ptr %10, align 8, !tbaa !9
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %68

31:                                               ; preds = %28
  %32 = load ptr, ptr %10, align 8, !tbaa !9
  call void @print_address(ptr noundef %32)
  %33 = load ptr, ptr %10, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.addrinfo, ptr %33, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !11
  %36 = load ptr, ptr %10, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.addrinfo, ptr %36, i32 0, i32 2
  %38 = load i32, ptr %37, align 8, !tbaa !13
  %39 = load ptr, ptr %10, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.addrinfo, ptr %39, i32 0, i32 3
  %41 = load i32, ptr %40, align 4, !tbaa !15
  %42 = call i32 @socket(i32 noundef %35, i32 noundef %38, i32 noundef %41) #6
  store i32 %42, ptr %6, align 4, !tbaa !5
  %43 = icmp eq i32 %42, -1
  br i1 %43, label %44, label %45

44:                                               ; preds = %31
  call void @perror(ptr noundef @.str.5)
  br label %64

45:                                               ; preds = %31
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = call i32 @setsockopt(i32 noundef %46, i32 noundef 1, i32 noundef 2, ptr noundef %13, i32 noundef 4) #6
  %48 = icmp eq i32 %47, -1
  br i1 %48, label %49, label %50

49:                                               ; preds = %45
  call void @perror(ptr noundef @.str.6)
  call void @exit(i32 noundef 1) #7
  unreachable

50:                                               ; preds = %45
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = load ptr, ptr %10, align 8, !tbaa !9
  %53 = getelementptr inbounds %struct.addrinfo, ptr %52, i32 0, i32 5
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = load ptr, ptr %10, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.addrinfo, ptr %55, i32 0, i32 4
  %57 = load i32, ptr %56, align 8, !tbaa !17
  %58 = call i32 @bind(i32 noundef %51, ptr noundef %54, i32 noundef %57) #6
  %59 = icmp eq i32 %58, 1
  br i1 %59, label %60, label %63

60:                                               ; preds = %50
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = call i32 @close(i32 noundef %61)
  call void @perror(ptr noundef @.str.7)
  br label %63

63:                                               ; preds = %60, %50
  br label %68

64:                                               ; preds = %44
  %65 = load ptr, ptr %10, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.addrinfo, ptr %65, i32 0, i32 7
  %67 = load ptr, ptr %66, align 8, !tbaa !18
  store ptr %67, ptr %10, align 8, !tbaa !9
  br label %28, !llvm.loop !19

68:                                               ; preds = %63, %28
  %69 = load ptr, ptr %9, align 8, !tbaa !9
  call void @freeaddrinfo(ptr noundef %69) #6
  %70 = load ptr, ptr %10, align 8, !tbaa !9
  %71 = icmp eq ptr %70, null
  br i1 %71, label %72, label %73

72:                                               ; preds = %68
  call void @perror(ptr noundef @.str.8)
  call void @exit(i32 noundef 1) #7
  unreachable

73:                                               ; preds = %68
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = call i32 @listen(i32 noundef %74, i32 noundef 10) #6
  %76 = icmp eq i32 %75, 1
  br i1 %76, label %77, label %78

77:                                               ; preds = %73
  call void @perror(ptr noundef @.str.9)
  call void @exit(i32 noundef 1) #7
  unreachable

78:                                               ; preds = %73
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  br label %80

80:                                               ; preds = %107, %78
  br label %81

81:                                               ; preds = %80
  store i32 128, ptr %12, align 4, !tbaa !5
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = call i32 @accept(i32 noundef %82, ptr noundef %11, ptr noundef %12)
  store i32 %83, ptr %7, align 4, !tbaa !5
  %84 = icmp eq i32 %83, -1
  br i1 %84, label %85, label %86

85:                                               ; preds = %81
  call void @perror(ptr noundef @.str.11)
  call void @exit(i32 noundef 1) #7
  unreachable

86:                                               ; preds = %81
  %87 = getelementptr inbounds %struct.sockaddr_storage, ptr %11, i32 0, i32 0
  %88 = load i16, ptr %87, align 8, !tbaa !21
  %89 = zext i16 %88 to i32
  %90 = call ptr @get_in_addr(ptr noundef %11)
  %91 = getelementptr inbounds [46 x i8], ptr %14, i64 0, i64 0
  %92 = call ptr @inet_ntop(i32 noundef %89, ptr noundef %90, ptr noundef %91, i32 noundef 46) #6
  %93 = getelementptr inbounds [46 x i8], ptr %14, i64 0, i64 0
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, ptr noundef %93)
  %95 = call i32 @fork() #6
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %97, label %107

97:                                               ; preds = %86
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = call i32 @close(i32 noundef %98)
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = call i64 @send(i32 noundef %100, ptr noundef @.str.13, i64 noundef 13, i32 noundef 0)
  %102 = icmp eq i64 %101, -1
  br i1 %102, label %103, label %104

103:                                              ; preds = %97
  call void @perror(ptr noundef @.str.14)
  call void @exit(i32 noundef 1) #7
  unreachable

104:                                              ; preds = %97
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = call i32 @close(i32 noundef %105)
  call void @exit(i32 noundef 0) #7
  unreachable

107:                                              ; preds = %86
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = call i32 @close(i32 noundef %108)
  br label %80
}

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

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

; Function Attrs: nounwind
declare ptr @gai_strerror(i32 noundef) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) #2

declare void @perror(ptr noundef) #4

; Function Attrs: nounwind
declare i32 @setsockopt(i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind
declare i32 @bind(i32 noundef, ptr noundef, i32 noundef) #2

declare i32 @close(i32 noundef) #4

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

; Function Attrs: nounwind
declare i32 @listen(i32 noundef, i32 noundef) #2

declare i32 @printf(ptr noundef, ...) #4

declare i32 @accept(i32 noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare i32 @fork() #2

declare i64 @send(i32 noundef, ptr noundef, i64 noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"addrinfo", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!13 = !{!12, !6, i64 8}
!14 = !{!12, !6, i64 0}
!15 = !{!12, !6, i64 12}
!16 = !{!12, !10, i64 24}
!17 = !{!12, !6, i64 16}
!18 = !{!12, !10, i64 40}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !23, i64 0}
!22 = !{!"sockaddr_storage", !23, i64 0, !7, i64 2, !24, i64 120}
!23 = !{!"short", !7, i64 0}
!24 = !{!"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"

%struct.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.sockaddr_storage = type { i16, [118 x i8], i64 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [44 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

; Function Attrs: nounwind uwtable
declare dso_local ptr @get_in_addr(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @print_address(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare ptr @inet_ntop(i32 noundef, ptr noundef, ptr noundef, i32 noundef) 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: noreturn nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #4 {
  %3 = alloca %struct.addrinfo, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.sockaddr_storage, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [46 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 46, ptr nonnull %8) #8
  %9 = getelementptr inbounds i8, ptr %3, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %3, i8 0, i64 48, i1 false)
  store i32 1, ptr %9, align 8, !tbaa !9
  store i32 1, ptr %3, align 8, !tbaa !12
  %10 = call i32 @getaddrinfo(ptr noundef null, ptr noundef nonnull @.str.3, ptr noundef nonnull %3, ptr noundef nonnull %4) #8
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %.preheader, label %11

.preheader:                                       ; preds = %2
  %.01828 = load ptr, ptr %4, align 8, !tbaa !13
  %.not2329 = icmp eq ptr %.01828, null
  br i1 %.not2329, label %._crit_edge, label %.lr.ph

11:                                               ; preds = %2
  %12 = load ptr, ptr @stderr, align 8, !tbaa !13
  %13 = call ptr @gai_strerror(i32 noundef %10) #8
  %14 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str.4, ptr noundef %13) #9
  call void @exit(i32 noundef 1) #10
  unreachable

.lr.ph:                                           ; preds = %.preheader, %23
  %.01830 = phi ptr [ %.018, %23 ], [ %.01828, %.preheader ]
  call void @print_address(ptr noundef nonnull %.01830)
  %15 = getelementptr inbounds i8, ptr %.01830, i64 4
  %16 = load i32, ptr %15, align 4, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %.01830, i64 8
  %18 = load i32, ptr %17, align 8, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %.01830, i64 12
  %20 = load i32, ptr %19, align 4, !tbaa !15
  %21 = call i32 @socket(i32 noundef %16, i32 noundef %18, i32 noundef %20) #8
  %22 = icmp eq i32 %21, -1
  br i1 %22, label %23, label %25

23:                                               ; preds = %.lr.ph
  call void @perror(ptr noundef nonnull @.str.5) #11
  %24 = getelementptr inbounds i8, ptr %.01830, i64 40
  %.018 = load ptr, ptr %24, align 8, !tbaa !13
  %.not23 = icmp eq ptr %.018, null
  br i1 %.not23, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !16

25:                                               ; preds = %.lr.ph
  %26 = call i32 @setsockopt(i32 noundef %21, i32 noundef 1, i32 noundef 2, ptr noundef nonnull %7, i32 noundef 4) #8
  %27 = icmp eq i32 %26, -1
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  call void @perror(ptr noundef nonnull @.str.6) #11
  call void @exit(i32 noundef 1) #10
  unreachable

29:                                               ; preds = %25
  %30 = getelementptr inbounds i8, ptr %.01830, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !18
  %32 = getelementptr inbounds i8, ptr %.01830, i64 16
  %33 = load i32, ptr %32, align 8, !tbaa !19
  %34 = call i32 @bind(i32 noundef %21, ptr noundef %31, i32 noundef %33) #8
  %35 = icmp eq i32 %34, 1
  br i1 %35, label %36, label %39

36:                                               ; preds = %29
  %37 = call i32 @close(i32 noundef %21) #8
  call void @perror(ptr noundef nonnull @.str.7) #11
  br label %39

._crit_edge.loopexit:                             ; preds = %23
  %.pre = load ptr, ptr %4, align 8, !tbaa !13
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %38 = phi ptr [ %.pre, %._crit_edge.loopexit ], [ null, %.preheader ]
  call void @freeaddrinfo(ptr noundef %38) #8
  call void @perror(ptr noundef nonnull @.str.8) #11
  call void @exit(i32 noundef 1) #10
  unreachable

39:                                               ; preds = %29, %36
  %40 = load ptr, ptr %4, align 8, !tbaa !13
  call void @freeaddrinfo(ptr noundef %40) #8
  %41 = call i32 @listen(i32 noundef %21, i32 noundef 10) #8
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  call void @perror(ptr noundef nonnull @.str.9) #11
  call void @exit(i32 noundef 1) #10
  unreachable

44:                                               ; preds = %39
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  store i32 128, ptr %6, align 4, !tbaa !5
  %46 = call i32 @accept(i32 noundef %21, ptr noundef nonnull %5, ptr noundef nonnull %6) #8
  %47 = icmp eq i32 %46, -1
  br i1 %47, label %._crit_edge33, label %.lr.ph32

._crit_edge33:                                    ; preds = %63, %44
  call void @perror(ptr noundef nonnull @.str.11) #11
  call void @exit(i32 noundef 1) #10
  unreachable

.lr.ph32:                                         ; preds = %44, %63
  %48 = phi i32 [ %65, %63 ], [ %46, %44 ]
  %49 = load i16, ptr %5, align 8, !tbaa !20
  %50 = zext i16 %49 to i32
  %51 = call ptr @get_in_addr(ptr noundef nonnull %5)
  %52 = call ptr @inet_ntop(i32 noundef %50, ptr noundef %51, ptr noundef nonnull %8, i32 noundef 46) #8
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef nonnull %8)
  %54 = call i32 @fork() #8
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %63

56:                                               ; preds = %.lr.ph32
  %57 = call i32 @close(i32 noundef %21) #8
  %58 = call i64 @send(i32 noundef %48, ptr noundef nonnull @.str.13, i64 noundef 13, i32 noundef 0) #8
  %59 = icmp eq i64 %58, -1
  br i1 %59, label %60, label %61

60:                                               ; preds = %56
  call void @perror(ptr noundef nonnull @.str.14) #11
  call void @exit(i32 noundef 1) #10
  unreachable

61:                                               ; preds = %56
  %62 = call i32 @close(i32 noundef %48) #8
  call void @exit(i32 noundef 0) #10
  unreachable

63:                                               ; preds = %.lr.ph32
  %64 = call i32 @close(i32 noundef %48) #8
  store i32 128, ptr %6, align 4, !tbaa !5
  %65 = call i32 @accept(i32 noundef %21, ptr noundef nonnull %5, ptr noundef nonnull %6) #8
  %66 = icmp eq i32 %65, -1
  br i1 %66, label %._crit_edge33, label %.lr.ph32
}

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

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

; Function Attrs: nounwind
declare ptr @gai_strerror(i32 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #7

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @setsockopt(i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @bind(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @close(i32 noundef) local_unnamed_addr #6

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

; Function Attrs: nounwind
declare i32 @listen(i32 noundef, i32 noundef) local_unnamed_addr #2

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

declare i32 @accept(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare i32 @fork() local_unnamed_addr #3

declare i64 @send(i32 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { 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 = { noreturn 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: write) }
attributes #6 = { "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 }
attributes #9 = { cold nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { cold }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"addrinfo", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !11, i64 24, !11, i64 32, !11, i64 40}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 4}
!15 = !{!10, !6, i64 12}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!10, !11, i64 24}
!19 = !{!10, !6, i64 16}
!20 = !{!21, !22, i64 0}
!21 = !{!"sockaddr_storage", !22, i64 0, !7, i64 2, !23, i64 120}
!22 = !{!"short", !7, i64 0}
!23 = !{!"long", !7, i64 0}


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