; LLVM IR from rigtorp/ipc-bench :: src (tcp_local_lat)

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

@.str = external hidden unnamed_addr constant [72 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@stderr = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.sockaddr_storage, align 8
  %15 = alloca i32, align 4
  %16 = alloca %struct.addrinfo, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = 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) #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 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 128, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = icmp ne i32 %21, 5
  br i1 %22, label %23, label %25

23:                                               ; preds = %2
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %141

25:                                               ; preds = %2
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  %27 = getelementptr inbounds ptr, ptr %26, i64 3
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call i32 @atoi(ptr noundef %28) #8
  store i32 %29, ptr %6, align 4, !tbaa !5
  %30 = load ptr, ptr %5, align 8, !tbaa !9
  %31 = getelementptr inbounds ptr, ptr %30, i64 4
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = call i64 @atol(ptr noundef %32) #8
  store i64 %33, ptr %8, align 8, !tbaa !11
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = call noalias ptr @malloc(i64 noundef %35) #9
  store ptr %36, ptr %7, align 8, !tbaa !9
  %37 = load ptr, ptr %7, align 8, !tbaa !9
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %25
  call void @perror(ptr noundef @.str.1)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %141

40:                                               ; preds = %25
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %41)
  %43 = load i64, ptr %8, align 8, !tbaa !11
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %43)
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 48, i1 false)
  %45 = getelementptr inbounds %struct.addrinfo, ptr %16, i32 0, i32 1
  store i32 0, ptr %45, align 4, !tbaa !13
  %46 = getelementptr inbounds %struct.addrinfo, ptr %16, i32 0, i32 2
  store i32 1, ptr %46, align 8, !tbaa !15
  %47 = getelementptr inbounds %struct.addrinfo, ptr %16, i32 0, i32 0
  store i32 1, ptr %47, align 8, !tbaa !16
  %48 = load ptr, ptr %5, align 8, !tbaa !9
  %49 = getelementptr inbounds ptr, ptr %48, i64 1
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  %51 = load ptr, ptr %5, align 8, !tbaa !9
  %52 = getelementptr inbounds ptr, ptr %51, i64 2
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = call i32 @getaddrinfo(ptr noundef %50, ptr noundef %53, ptr noundef %16, ptr noundef %17)
  store i32 %54, ptr %13, align 4, !tbaa !5
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %61

56:                                               ; preds = %40
  %57 = load ptr, ptr @stderr, align 8, !tbaa !9
  %58 = load i32, ptr %13, align 4, !tbaa !5
  %59 = call ptr @gai_strerror(i32 noundef %58) #7
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef @.str.4, ptr noundef %59) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %141

61:                                               ; preds = %40
  %62 = load ptr, ptr %17, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.addrinfo, ptr %62, i32 0, i32 1
  %64 = load i32, ptr %63, align 4, !tbaa !13
  %65 = load ptr, ptr %17, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.addrinfo, ptr %65, i32 0, i32 2
  %67 = load i32, ptr %66, align 8, !tbaa !15
  %68 = load ptr, ptr %17, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.addrinfo, ptr %68, i32 0, i32 3
  %70 = load i32, ptr %69, align 4, !tbaa !17
  %71 = call i32 @socket(i32 noundef %64, i32 noundef %67, i32 noundef %70) #7
  store i32 %71, ptr %18, align 4, !tbaa !5
  %72 = icmp eq i32 %71, -1
  br i1 %72, label %73, label %74

73:                                               ; preds = %61
  call void @perror(ptr noundef @.str.5)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %141

74:                                               ; preds = %61
  %75 = load i32, ptr %18, align 4, !tbaa !5
  %76 = call i32 @setsockopt(i32 noundef %75, i32 noundef 1, i32 noundef 2, ptr noundef %12, i32 noundef 4) #7
  %77 = icmp eq i32 %76, -1
  br i1 %77, label %78, label %79

78:                                               ; preds = %74
  call void @perror(ptr noundef @.str.6)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %141

79:                                               ; preds = %74
  %80 = load i32, ptr %18, align 4, !tbaa !5
  %81 = load ptr, ptr %17, align 8, !tbaa !9
  %82 = getelementptr inbounds %struct.addrinfo, ptr %81, i32 0, i32 5
  %83 = load ptr, ptr %82, align 8, !tbaa !18
  %84 = load ptr, ptr %17, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct.addrinfo, ptr %84, i32 0, i32 4
  %86 = load i32, ptr %85, align 8, !tbaa !19
  %87 = call i32 @bind(i32 noundef %80, ptr noundef %83, i32 noundef %86) #7
  %88 = icmp eq i32 %87, -1
  br i1 %88, label %89, label %90

89:                                               ; preds = %79
  call void @perror(ptr noundef @.str.7)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %141

90:                                               ; preds = %79
  %91 = load i32, ptr %18, align 4, !tbaa !5
  %92 = call i32 @listen(i32 noundef %91, i32 noundef 1) #7
  %93 = icmp eq i32 %92, -1
  br i1 %93, label %94, label %95

94:                                               ; preds = %90
  call void @perror(ptr noundef @.str.8)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %141

95:                                               ; preds = %90
  store i32 128, ptr %15, align 4, !tbaa !5
  %96 = load i32, ptr %18, align 4, !tbaa !5
  %97 = call i32 @accept(i32 noundef %96, ptr noundef %14, ptr noundef %15)
  store i32 %97, ptr %19, align 4, !tbaa !5
  %98 = icmp eq i32 %97, -1
  br i1 %98, label %99, label %100

99:                                               ; preds = %95
  call void @perror(ptr noundef @.str.9)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %141

100:                                              ; preds = %95
  store i64 0, ptr %9, align 8, !tbaa !11
  br label %101

101:                                              ; preds = %137, %100
  %102 = load i64, ptr %9, align 8, !tbaa !11
  %103 = load i64, ptr %8, align 8, !tbaa !11
  %104 = icmp slt i64 %102, %103
  br i1 %104, label %105, label %140

105:                                              ; preds = %101
  store i64 0, ptr %11, align 8, !tbaa !11
  br label %106

106:                                              ; preds = %122, %105
  %107 = load i64, ptr %11, align 8, !tbaa !11
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = icmp ult i64 %107, %109
  br i1 %110, label %111, label %126

111:                                              ; preds = %106
  %112 = load i32, ptr %19, align 4, !tbaa !5
  %113 = load ptr, ptr %7, align 8, !tbaa !9
  %114 = load i32, ptr %6, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = load i64, ptr %11, align 8, !tbaa !11
  %117 = sub i64 %115, %116
  %118 = call i64 @read(i32 noundef %112, ptr noundef %113, i64 noundef %117)
  store i64 %118, ptr %10, align 8, !tbaa !11
  %119 = load i64, ptr %10, align 8, !tbaa !11
  %120 = icmp eq i64 %119, -1
  br i1 %120, label %121, label %122

121:                                              ; preds = %111
  call void @perror(ptr noundef @.str.10)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %141

122:                                              ; preds = %111
  %123 = load i64, ptr %10, align 8, !tbaa !11
  %124 = load i64, ptr %11, align 8, !tbaa !11
  %125 = add i64 %124, %123
  store i64 %125, ptr %11, align 8, !tbaa !11
  br label %106, !llvm.loop !20

126:                                              ; preds = %106
  %127 = load i32, ptr %19, align 4, !tbaa !5
  %128 = load ptr, ptr %7, align 8, !tbaa !9
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = call i64 @write(i32 noundef %127, ptr noundef %128, i64 noundef %130)
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = icmp ne i64 %131, %133
  br i1 %134, label %135, label %136

135:                                              ; preds = %126
  call void @perror(ptr noundef @.str.11)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %141

136:                                              ; preds = %126
  br label %137

137:                                              ; preds = %136
  %138 = load i64, ptr %9, align 8, !tbaa !11
  %139 = add nsw i64 %138, 1
  store i64 %139, ptr %9, align 8, !tbaa !11
  br label %101, !llvm.loop !22

140:                                              ; preds = %101
  store i32 0, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %141

141:                                              ; preds = %140, %135, %121, %99, %94, %89, %78, %73, %56, %39, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, 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
  %142 = load i32, ptr %3, align 4
  ret i32 %142
}

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

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #3

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i64 @atol(ptr noundef nonnull) #3

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

declare void @perror(ptr noundef) #2

; Function Attrs: 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) #2

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

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

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

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

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

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

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

declare i64 @read(i32 noundef, ptr noundef, i64 noundef) #2

declare i64 @write(i32 noundef, ptr noundef, i64 noundef) #2

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

attributes #0 = { 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 #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 = { inlinehint nounwind willreturn memory(read) 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 = { nounwind allocsize(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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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) }
attributes #9 = { nounwind allocsize(0) }

!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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 4}
!14 = !{!"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}
!15 = !{!14, !6, i64 8}
!16 = !{!14, !6, i64 0}
!17 = !{!14, !6, i64 12}
!18 = !{!14, !10, i64 24}
!19 = !{!14, !6, i64 16}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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

@.str = external hidden unnamed_addr constant [72 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca %struct.sockaddr_storage, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.addrinfo, align 8
  %7 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  store i32 1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  %.not = icmp eq i32 %0, 5
  br i1 %.not, label %10, label %8

8:                                                ; preds = %2
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %.loopexit

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %1, i64 24
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = tail call i32 @atoi(ptr nocapture noundef %12) #10
  %14 = getelementptr inbounds i8, ptr %1, i64 32
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = tail call i64 @atol(ptr nocapture noundef %15) #10
  %17 = sext i32 %13 to i64
  %18 = tail call noalias ptr @malloc(i64 noundef %17) #11
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %10
  tail call void @perror(ptr noundef nonnull @.str.1) #12
  br label %.loopexit

21:                                               ; preds = %10
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13)
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %16)
  %24 = getelementptr inbounds i8, ptr %6, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %6, i8 0, i64 48, i1 false)
  store i32 1, ptr %24, align 8, !tbaa !11
  store i32 1, ptr %6, align 8, !tbaa !13
  %25 = getelementptr inbounds i8, ptr %1, i64 8
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %1, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call i32 @getaddrinfo(ptr noundef %26, ptr noundef %28, ptr noundef nonnull %6, ptr noundef nonnull %7) #9
  %.not38 = icmp eq i32 %29, 0
  br i1 %.not38, label %34, label %30

30:                                               ; preds = %21
  %31 = load ptr, ptr @stderr, align 8, !tbaa !9
  %32 = call ptr @gai_strerror(i32 noundef %29) #9
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.4, ptr noundef %32) #13
  br label %.loopexit

34:                                               ; preds = %21
  %35 = load ptr, ptr %7, align 8, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %35, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !14
  %38 = getelementptr inbounds i8, ptr %35, i64 8
  %39 = load i32, ptr %38, align 8, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %35, i64 12
  %41 = load i32, ptr %40, align 4, !tbaa !15
  %42 = call i32 @socket(i32 noundef %37, i32 noundef %39, i32 noundef %41) #9
  %43 = icmp eq i32 %42, -1
  br i1 %43, label %44, label %45

44:                                               ; preds = %34
  call void @perror(ptr noundef nonnull @.str.5) #12
  br label %.loopexit

45:                                               ; preds = %34
  %46 = call i32 @setsockopt(i32 noundef %42, i32 noundef 1, i32 noundef 2, ptr noundef nonnull %3, i32 noundef 4) #9
  %47 = icmp eq i32 %46, -1
  br i1 %47, label %48, label %49

48:                                               ; preds = %45
  call void @perror(ptr noundef nonnull @.str.6) #12
  br label %.loopexit

49:                                               ; preds = %45
  %50 = load ptr, ptr %7, align 8, !tbaa !9
  %51 = getelementptr inbounds i8, ptr %50, i64 24
  %52 = load ptr, ptr %51, align 8, !tbaa !16
  %53 = getelementptr inbounds i8, ptr %50, i64 16
  %54 = load i32, ptr %53, align 8, !tbaa !17
  %55 = call i32 @bind(i32 noundef %42, ptr noundef %52, i32 noundef %54) #9
  %56 = icmp eq i32 %55, -1
  br i1 %56, label %57, label %58

57:                                               ; preds = %49
  call void @perror(ptr noundef nonnull @.str.7) #12
  br label %.loopexit

58:                                               ; preds = %49
  %59 = call i32 @listen(i32 noundef %42, i32 noundef 1) #9
  %60 = icmp eq i32 %59, -1
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  call void @perror(ptr noundef nonnull @.str.8) #12
  br label %.loopexit

62:                                               ; preds = %58
  store i32 128, ptr %5, align 4, !tbaa !5
  %63 = call i32 @accept(i32 noundef %42, ptr noundef nonnull %4, ptr noundef nonnull %5) #9
  %64 = icmp eq i32 %63, -1
  br i1 %64, label %76, label %.preheader40

.preheader40:                                     ; preds = %62
  %65 = icmp sgt i64 %16, 0
  br i1 %65, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %.preheader40
  %.not45 = icmp eq i32 %13, 0
  br i1 %.not45, label %.preheader, label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.lr.ph, %73
  %.03042.us = phi i64 [ %74, %73 ], [ 0, %.preheader.lr.ph ]
  br label %69

66:                                               ; preds = %69
  %67 = add i64 %71, %.03141.us
  %68 = icmp ult i64 %67, %17
  br i1 %68, label %69, label %._crit_edge.us, !llvm.loop !18

69:                                               ; preds = %.preheader.us, %66
  %.03141.us = phi i64 [ 0, %.preheader.us ], [ %67, %66 ]
  %70 = sub i64 %17, %.03141.us
  %71 = call i64 @read(i32 noundef %63, ptr noundef nonnull %18, i64 noundef %70) #9
  %72 = icmp eq i64 %71, -1
  br i1 %72, label %.split44.us, label %66

73:                                               ; preds = %._crit_edge.us
  %74 = add nuw nsw i64 %.03042.us, 1
  %exitcond.not = icmp eq i64 %74, %16
  br i1 %exitcond.not, label %.loopexit, label %.preheader.us, !llvm.loop !20

._crit_edge.us:                                   ; preds = %66
  %75 = call i64 @write(i32 noundef %63, ptr noundef nonnull %18, i64 noundef %17) #9
  %.not39.us = icmp eq i64 %75, %17
  br i1 %.not39.us, label %73, label %.split.us

76:                                               ; preds = %62
  call void @perror(ptr noundef nonnull @.str.9) #12
  br label %.loopexit

77:                                               ; preds = %.preheader
  %78 = add nuw nsw i64 %.03042, 1
  %exitcond48.not = icmp eq i64 %78, %16
  br i1 %exitcond48.not, label %.loopexit, label %.preheader, !llvm.loop !20

.preheader:                                       ; preds = %.preheader.lr.ph, %77
  %.03042 = phi i64 [ %78, %77 ], [ 0, %.preheader.lr.ph ]
  %79 = call i64 @write(i32 noundef %63, ptr noundef nonnull %18, i64 noundef %17) #9
  %.not39 = icmp eq i64 %79, %17
  br i1 %.not39, label %77, label %.split.us

.split44.us:                                      ; preds = %69
  call void @perror(ptr noundef nonnull @.str.10) #12
  br label %.loopexit

.split.us:                                        ; preds = %._crit_edge.us, %.preheader
  call void @perror(ptr noundef nonnull @.str.11) #12
  br label %.loopexit

.loopexit:                                        ; preds = %73, %77, %.preheader40, %.split.us, %.split44.us, %76, %61, %57, %48, %44, %30, %20, %8
  %.0 = phi i32 [ 1, %8 ], [ 1, %20 ], [ 1, %30 ], [ 1, %44 ], [ 1, %48 ], [ 1, %57 ], [ 1, %61 ], [ 1, %76 ], [ 1, %.split44.us ], [ 1, %.split.us ], [ 0, %.preheader40 ], [ 0, %77 ], [ 0, %73 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  ret i32 %.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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i64 @atol(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

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

; 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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

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

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

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

; Function Attrs: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #8

; Function Attrs: nofree
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #8

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 = { nofree "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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { nounwind allocsize(0) }
attributes #12 = { cold }
attributes #13 = { cold nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 8}
!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 0}
!14 = !{!12, !6, i64 4}
!15 = !{!12, !6, i64 12}
!16 = !{!12, !10, i64 24}
!17 = !{!12, !6, i64 16}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass