; LLVM IR from git-akshat/NP-Lab :: A7 (Sliding Window) (ServerSW)

; 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_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [42 x i8], align 1
@stdout = external global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.sockaddr_in, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [20 x i8], align 16
  %7 = alloca [20 x i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %14 = call i32 @socket(i32 noundef 2, i32 noundef 1, i32 noundef 0) #7
  store i32 %14, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #7
  %15 = getelementptr inbounds %struct.sockaddr_in, ptr %3, i32 0, i32 0
  store i16 2, ptr %15, align 4, !tbaa !9
  %16 = getelementptr inbounds %struct.sockaddr_in, ptr %3, i32 0, i32 1
  %17 = call zeroext i16 @__bswap_16(i16 noundef zeroext 1234)
  store i16 %17, ptr %16, align 2, !tbaa !13
  %18 = getelementptr inbounds %struct.sockaddr_in, ptr %3, i32 0, i32 2
  %19 = getelementptr inbounds %struct.in_addr, ptr %18, i32 0, i32 0
  %20 = call i32 @inet_addr(ptr noundef @.str) #7
  store i32 %20, ptr %19, align 4, !tbaa !14
  %21 = getelementptr inbounds %struct.sockaddr_in, ptr %3, i32 0, i32 3
  call void @llvm.memset.p0.i64(ptr align 4 %21, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = call i32 @setsockopt(i32 noundef %22, i32 noundef 1, i32 noundef 2, ptr noundef %4, i32 noundef 4) #7
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = call i32 @bind(i32 noundef %24, ptr noundef %3, i32 noundef 16) #7
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = call i32 @listen(i32 noundef %27, i32 noundef 5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = call i32 @accept(i32 noundef %29, ptr noundef null, ptr noundef null)
  store i32 %30, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 20, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  %31 = call i64 @time(ptr noundef null) #7
  %32 = trunc i64 %31 to i32
  call void @srand(i32 noundef %32) #7
  br label %33

33:                                               ; preds = %105, %0
  br label %34

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 5, ptr %10, align 4, !tbaa !5
  %35 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %35, i8 0, i64 20, i1 false)
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %38 = load i32, ptr %10, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = call i64 @recv(i32 noundef %36, ptr noundef %37, i64 noundef %39, i32 noundef 0)
  %41 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %42 = call i32 @strcmp(ptr noundef %41, ptr noundef @.str.2) #8
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %34
  store i32 3, ptr %11, align 4
  br label %103

45:                                               ; preds = %34
  %46 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %47 = call i64 @strlen(ptr noundef %46) #8
  %48 = load i32, ptr %10, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = icmp ult i64 %47, %49
  br i1 %50, label %51, label %55

51:                                               ; preds = %45
  %52 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %53 = call i64 @strlen(ptr noundef %52) #8
  %54 = trunc i64 %53 to i32
  store i32 %54, ptr %10, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %51, %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %56 = call i32 @rand() #7
  %57 = srem i32 %56, 8
  store i32 %57, ptr %12, align 4, !tbaa !5
  %58 = load i32, ptr %12, align 4, !tbaa !5
  %59 = load i32, ptr %10, align 4, !tbaa !5
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %61, label %69

61:                                               ; preds = %55
  %62 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %62, ptr %10, align 4, !tbaa !5
  %63 = load i32, ptr %12, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 %64
  store i8 120, ptr %65, align 1, !tbaa !15
  %66 = load i32, ptr %12, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  %68 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %67)
  br label %69

69:                                               ; preds = %61, %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %83, %69
  %71 = load i32, ptr %13, align 4, !tbaa !5
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %74, label %86

74:                                               ; preds = %70
  %75 = load i32, ptr %13, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !15
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %9, align 4, !tbaa !5
  %81 = sext i32 %79 to i64
  %82 = getelementptr inbounds [20 x i8], ptr %7, i64 0, i64 %81
  store i8 %78, ptr %82, align 1, !tbaa !15
  br label %83

83:                                               ; preds = %74
  %84 = load i32, ptr %13, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %13, align 4, !tbaa !5
  br label %70, !llvm.loop !16

86:                                               ; preds = %70
  %87 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %88 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %87)
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = load i32, ptr %10, align 4, !tbaa !5
  %92 = sub nsw i32 %90, %91
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %92)
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 1
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %95)
  %97 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %97, ptr %8, align 4, !tbaa !5
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %98)
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = call i64 @send(i32 noundef %100, ptr noundef %8, i64 noundef 4, i32 noundef 0)
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  store i32 0, ptr %11, align 4
  br label %103

103:                                              ; preds = %86, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %104 = load i32, ptr %11, align 4
  switch i32 %104, label %120 [
    i32 0, label %105
    i32 3, label %106
  ]

105:                                              ; preds = %103
  br label %33

106:                                              ; preds = %103
  %107 = load i32, ptr %9, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [20 x i8], ptr %7, i64 0, i64 %108
  store i8 0, ptr %109, align 1, !tbaa !15
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %111 = getelementptr inbounds [20 x i8], ptr %7, i64 0, i64 0
  %112 = load ptr, ptr @stdout, align 8, !tbaa !18
  %113 = call i32 @fputs(ptr noundef %111, ptr noundef %112)
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = call i32 @close(i32 noundef %115)
  %117 = load i32, ptr %2, align 4, !tbaa !5
  %118 = call i32 @close(i32 noundef %117)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 20, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 20, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %119 = load i32, ptr %1, align 4
  ret i32 %119

120:                                              ; preds = %103
  unreachable
}

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @__bswap_16(i16 noundef zeroext) #3

; Function Attrs: nounwind
declare i32 @inet_addr(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) #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 @printf(ptr noundef, ...) #5

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

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) #2

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #2

declare i64 @recv(i32 noundef, ptr noundef, i64 noundef, i32 noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #6

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

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

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

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

declare i32 @fputs(ptr noundef, ptr noundef) #5

declare i32 @close(i32 noundef) #5

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 = { 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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { "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 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"sockaddr_in", !11, i64 0, !11, i64 2, !12, i64 4, !7, i64 8}
!11 = !{!"short", !7, i64 0}
!12 = !{!"in_addr", !6, i64 0}
!13 = !{!10, !11, i64 2}
!14 = !{!12, !6, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !19, i64 0}
!19 = !{!"any pointer", !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.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [42 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.sockaddr_in, align 4
  %2 = alloca i32, align 4
  %3 = alloca [20 x i8], align 16
  %4 = alloca [20 x i8], align 16
  %5 = alloca i32, align 4
  %6 = tail call i32 @socket(i32 noundef 2, i32 noundef 1, i32 noundef 0) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #10
  store i16 2, ptr %1, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %1, i64 2
  %8 = tail call zeroext i16 @__bswap_16(i16 noundef zeroext 1234)
  store i16 %8, ptr %7, align 2, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %1, i64 4
  %10 = tail call i32 @inet_addr(ptr noundef nonnull @.str) #10
  store i32 %10, ptr %9, align 4, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  store i64 0, ptr %11, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #10
  store i32 1, ptr %2, align 4, !tbaa !14
  %12 = call i32 @setsockopt(i32 noundef %6, i32 noundef 1, i32 noundef 2, ptr noundef nonnull %2, i32 noundef 4) #10
  %13 = call i32 @bind(i32 noundef %6, ptr noundef nonnull %1, i32 noundef 16) #10
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %15 = call i32 @listen(i32 noundef %6, i32 noundef 5) #10
  %16 = call i32 @accept(i32 noundef %6, ptr noundef null, ptr noundef null) #10
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #10
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %4) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #10
  %17 = call i64 @time(ptr noundef null) #10
  %18 = trunc i64 %17 to i32
  call void @srand(i32 noundef %18) #10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %3, i8 0, i64 20, i1 false)
  %19 = call i64 @recv(i32 noundef %16, ptr noundef nonnull %3, i64 noundef 5, i32 noundef 0) #10
  %20 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.2) #11
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %._crit_edge43, label %.lr.ph42

.lr.ph42:                                         ; preds = %0, %._crit_edge
  %.02740 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 0, %0 ]
  %22 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #11
  %spec.select37 = call i64 @llvm.umin.i64(i64 %22, i64 5)
  %spec.select = trunc nuw nsw i64 %spec.select37 to i32
  %23 = call i32 @rand() #10
  %24 = srem i32 %23, 8
  %25 = icmp slt i32 %24, %spec.select
  br i1 %25, label %26, label %31

26:                                               ; preds = %.lr.ph42
  %27 = sext i32 %24 to i64
  %28 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 %27
  store i8 120, ptr %28, align 1, !tbaa !15
  %29 = add nsw i32 %24, 1
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %29)
  br label %31

31:                                               ; preds = %26, %.lr.ph42
  %.130 = phi i32 [ %24, %26 ], [ %spec.select, %.lr.ph42 ]
  %32 = icmp sgt i32 %.130, 0
  br i1 %32, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %31
  %33 = sext i32 %.02740 to i64
  %scevgep = getelementptr i8, ptr %4, i64 %33
  %34 = zext nneg i32 %.130 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep, ptr nonnull align 16 %3, i64 %34, i1 false), !tbaa !15
  %35 = add i32 %.02740, %.130
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %31
  %.1.lcssa = phi i32 [ %.02740, %31 ], [ %35, %.lr.ph.preheader ]
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %3)
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %38 = sub nsw i32 %.1.lcssa, %.130
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %38)
  %40 = add nsw i32 %.1.lcssa, -1
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %40)
  store i32 %.1.lcssa, ptr %5, align 4, !tbaa !14
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %.1.lcssa)
  %43 = call i64 @send(i32 noundef %16, ptr noundef nonnull %5, i64 noundef 4, i32 noundef 0) #10
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %3, i8 0, i64 20, i1 false)
  %45 = call i64 @recv(i32 noundef %16, ptr noundef nonnull %3, i64 noundef 5, i32 noundef 0) #10
  %46 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.2) #11
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %._crit_edge43.loopexit, label %.lr.ph42

._crit_edge43.loopexit:                           ; preds = %._crit_edge
  %48 = sext i32 %.1.lcssa to i64
  br label %._crit_edge43

._crit_edge43:                                    ; preds = %._crit_edge43.loopexit, %0
  %.027.lcssa = phi i64 [ 0, %0 ], [ %48, %._crit_edge43.loopexit ]
  %49 = getelementptr inbounds [20 x i8], ptr %4, i64 0, i64 %.027.lcssa
  store i8 0, ptr %49, align 1, !tbaa !15
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %51 = load ptr, ptr @stdout, align 8, !tbaa !16
  %52 = call i32 @fputs(ptr noundef nonnull %4, ptr noundef %51)
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %54 = call i32 @close(i32 noundef %16) #10
  %55 = call i32 @close(i32 noundef %6) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #10
  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: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @__bswap_16(i16 noundef zeroext) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @inet_addr(ptr noundef) 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) #4

; 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

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

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

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fputs(ptr nocapture noundef readonly, ptr nocapture noundef) local_unnamed_addr #5

declare i32 @close(i32 noundef) local_unnamed_addr #6

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

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

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 = { 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 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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #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 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { nounwind }
attributes #11 = { 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, !7, i64 0}
!6 = !{!"sockaddr_in", !7, i64 0, !7, i64 2, !10, i64 4, !8, i64 8}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"in_addr", !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !7, i64 2}
!13 = !{!10, !11, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!8, !8, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass