; LLVM IR from InductiveComputerScience/infracore :: drivers/pu-linux-tcp (pu-linux-tcp-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.ProcessingUnitServerStructureTCP = type { i32, i32, %struct.sockaddr_in, %struct.sockaddr_in, i32, i8, i8, i8, i64, %union.sem_t, %union.sem_t, ptr, i64, i8 }
%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }
%union.sem_t = type { i64, [24 x i8] }

@stderr = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 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 allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @ServerThread(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [20 x i8], align 16
  %7 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 20, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %8, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %9, i32 0, i32 13
  store i8 0, ptr %10, align 8, !tbaa !9
  br label %11

11:                                               ; preds = %146, %1
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %12, i32 0, i32 13
  %14 = load i8, ptr %13, align 8, !tbaa !9, !range !17, !noundef !18
  %15 = trunc i8 %14 to i1
  %16 = xor i1 %15, true
  br i1 %16, label %17, label %147

17:                                               ; preds = %11
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %18, i32 0, i32 5
  %20 = load i8, ptr %19, align 4, !tbaa !19, !range !17, !noundef !18
  %21 = trunc i8 %20 to i1
  br i1 %21, label %53, label %22

22:                                               ; preds = %17
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !20
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %26, i32 0, i32 3
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %28, i32 0, i32 4
  %30 = call i32 @accept(i32 noundef %25, ptr noundef %27, ptr noundef %29)
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %31, i32 0, i32 1
  store i32 %30, ptr %32, align 4, !tbaa !21
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %33, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !21
  %36 = icmp ne i32 %35, -1
  br i1 %36, label %37, label %44

37:                                               ; preds = %22
  store i8 1, ptr %7, align 1, !tbaa !22
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %38, i32 0, i32 5
  store i8 1, ptr %39, align 4, !tbaa !19
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %40, i32 0, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !21
  %43 = call zeroext i1 @EnableKeepalive(i32 noundef %42)
  br label %52

44:                                               ; preds = %22
  store i8 0, ptr %7, align 1, !tbaa !22
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = call ptr @__errno_location() #8
  %47 = load i32, ptr %46, align 4, !tbaa !23
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef @.str.4, i32 noundef %47) #7
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %49, i32 0, i32 5
  store i8 0, ptr %50, align 4, !tbaa !19
  %51 = call i32 @sleep(i32 noundef 1)
  br label %52

52:                                               ; preds = %44, %37
  br label %53

53:                                               ; preds = %52, %17
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %54, i32 0, i32 5
  %56 = load i8, ptr %55, align 4, !tbaa !19, !range !17, !noundef !18
  %57 = trunc i8 %56 to i1
  br i1 %57, label %58, label %146

58:                                               ; preds = %53
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %59, i32 0, i32 13
  %61 = load i8, ptr %60, align 8, !tbaa !9, !range !17, !noundef !18
  %62 = trunc i8 %61 to i1
  br i1 %62, label %146, label %63

63:                                               ; preds = %58
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %64, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !21
  %67 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %68 = call zeroext i1 @recvAll(i32 noundef %66, ptr noundef %67, i64 noundef 15)
  %69 = zext i1 %68 to i8
  store i8 %69, ptr %7, align 1, !tbaa !22
  %70 = load i8, ptr %7, align 1, !tbaa !22, !range !17, !noundef !18
  %71 = trunc i8 %70 to i1
  br i1 %71, label %72, label %145

72:                                               ; preds = %63
  %73 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %74 = call double @atof(ptr noundef %73) #9
  %75 = fptoui double %74 to i64
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %76, i32 0, i32 12
  store i64 %75, ptr %77, align 8, !tbaa !24
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %78, i32 0, i32 12
  %80 = load i64, ptr %79, align 8, !tbaa !24
  %81 = call noalias ptr @malloc(i64 noundef %80) #10
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %82, i32 0, i32 11
  store ptr %81, ptr %83, align 8, !tbaa !25
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !21
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %87, i32 0, i32 11
  %89 = load ptr, ptr %88, align 8, !tbaa !25
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %90, i32 0, i32 12
  %92 = load i64, ptr %91, align 8, !tbaa !24
  %93 = call zeroext i1 @recvAll(i32 noundef %86, ptr noundef %89, i64 noundef %92)
  %94 = zext i1 %93 to i8
  store i8 %94, ptr %7, align 1, !tbaa !22
  %95 = load i8, ptr %7, align 1, !tbaa !22, !range !17, !noundef !18
  %96 = trunc i8 %95 to i1
  br i1 %96, label %97, label %144

97:                                               ; preds = %72
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %98, i32 0, i32 10
  %100 = call i32 @sem_post(ptr noundef %99) #7
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %101, i32 0, i32 9
  %103 = call i32 @sem_wait(ptr noundef %102)
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %104, i32 0, i32 6
  store i8 1, ptr %105, align 1, !tbaa !26
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %106, i32 0, i32 7
  store i8 0, ptr %107, align 2, !tbaa !27
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %108, i32 0, i32 13
  %110 = load i8, ptr %109, align 8, !tbaa !9, !range !17, !noundef !18
  %111 = trunc i8 %110 to i1
  br i1 %111, label %143, label %112

112:                                              ; preds = %97
  %113 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %114, i32 0, i32 12
  %116 = load i64, ptr %115, align 8, !tbaa !24
  %117 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %113, ptr noundef @.str.5, i64 noundef %116) #7
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %118, i32 0, i32 1
  %120 = load i32, ptr %119, align 4, !tbaa !21
  %121 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %122 = call zeroext i1 @sendAll(i32 noundef %120, ptr noundef %121, i64 noundef 15)
  %123 = zext i1 %122 to i8
  store i8 %123, ptr %7, align 1, !tbaa !22
  %124 = load i8, ptr %7, align 1, !tbaa !22, !range !17, !noundef !18
  %125 = trunc i8 %124 to i1
  br i1 %125, label %126, label %138

126:                                              ; preds = %112
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %127, i32 0, i32 1
  %129 = load i32, ptr %128, align 4, !tbaa !21
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %130, i32 0, i32 11
  %132 = load ptr, ptr %131, align 8, !tbaa !25
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %133, i32 0, i32 12
  %135 = load i64, ptr %134, align 8, !tbaa !24
  %136 = call zeroext i1 @sendAll(i32 noundef %129, ptr noundef %132, i64 noundef %135)
  %137 = zext i1 %136 to i8
  store i8 %137, ptr %7, align 1, !tbaa !22
  br label %138

138:                                              ; preds = %126, %112
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %139, i32 0, i32 6
  store i8 0, ptr %140, align 1, !tbaa !26
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %141, i32 0, i32 7
  store i8 1, ptr %142, align 2, !tbaa !27
  br label %143

143:                                              ; preds = %138, %97
  br label %144

144:                                              ; preds = %143, %72
  br label %145

145:                                              ; preds = %144, %63
  br label %146

146:                                              ; preds = %145, %58, %53
  br label %11, !llvm.loop !28

147:                                              ; preds = %11
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %148, i32 0, i32 5
  %150 = load i8, ptr %149, align 4, !tbaa !19, !range !17, !noundef !18
  %151 = trunc i8 %150 to i1
  br i1 %151, label %152, label %159

152:                                              ; preds = %147
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %153, i32 0, i32 1
  %155 = load i32, ptr %154, align 4, !tbaa !21
  %156 = call i32 @close(i32 noundef %155)
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %157, i32 0, i32 5
  store i8 0, ptr %158, align 4, !tbaa !19
  br label %159

159:                                              ; preds = %152, %147
  call void @llvm.lifetime.end.p0(i64 1, 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 8, ptr %4) #7
  %160 = load ptr, ptr %2, align 8
  ret ptr %160
}

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #3

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @EnableKeepalive(i32 noundef) #2

declare i32 @sleep(i32 noundef) #5

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @recvAll(i32 noundef, ptr noundef, i64 noundef) #2

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare double @atof(ptr noundef nonnull) #6

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

declare i32 @sem_wait(ptr noundef) #5

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @sendAll(i32 noundef, ptr noundef, i64 noundef) #2

declare i32 @close(i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nounwind willreturn memory(none) "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 = { "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 = { 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !15, i64 136}
!10 = !{!"ProcessingUnitServerStructureTCP", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 24, !11, i64 40, !15, i64 44, !15, i64 45, !15, i64 46, !16, i64 48, !7, i64 56, !7, i64 88, !6, i64 120, !16, i64 128, !15, i64 136}
!11 = !{!"int", !7, i64 0}
!12 = !{!"sockaddr_in", !13, i64 0, !13, i64 2, !14, i64 4, !7, i64 8}
!13 = !{!"short", !7, i64 0}
!14 = !{!"in_addr", !11, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!10, !15, i64 44}
!20 = !{!10, !11, i64 0}
!21 = !{!10, !11, i64 4}
!22 = !{!15, !15, i64 0}
!23 = !{!11, !11, i64 0}
!24 = !{!10, !16, i64 128}
!25 = !{!10, !6, i64 120}
!26 = !{!10, !15, i64 45}
!27 = !{!10, !15, i64 46}
!28 = distinct !{!28, !29}
!29 = !{!"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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 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: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noalias ptr @ServerThread(ptr noundef %0) local_unnamed_addr #2 {
.lr.ph:
  %1 = alloca [20 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %1) #8
  %2 = getelementptr inbounds i8, ptr %0, i64 136
  store i8 0, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 44
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  %5 = getelementptr inbounds i8, ptr %0, i64 40
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = getelementptr inbounds i8, ptr %0, i64 128
  %8 = getelementptr inbounds i8, ptr %0, i64 120
  %9 = getelementptr inbounds i8, ptr %0, i64 88
  %10 = getelementptr inbounds i8, ptr %0, i64 56
  %11 = getelementptr inbounds i8, ptr %0, i64 45
  %12 = getelementptr inbounds i8, ptr %0, i64 46
  br label %13

13:                                               ; preds = %.lr.ph, %58
  %14 = load i8, ptr %3, align 4, !tbaa !16, !range !17, !noundef !18
  %15 = trunc nuw i8 %14 to i1
  br i1 %15, label %27, label %16

16:                                               ; preds = %13
  %17 = load i32, ptr %0, align 8, !tbaa !19
  %18 = call i32 @accept(i32 noundef %17, ptr noundef nonnull %4, ptr noundef nonnull %5) #8
  store i32 %18, ptr %6, align 4, !tbaa !20
  %.not = icmp eq i32 %18, -1
  br i1 %.not, label %21, label %19

19:                                               ; preds = %16
  store i8 1, ptr %3, align 4, !tbaa !16
  %20 = call zeroext i1 @EnableKeepalive(i32 noundef %18)
  br label %27

21:                                               ; preds = %16
  %22 = load ptr, ptr @stderr, align 8, !tbaa !21
  %23 = tail call ptr @__errno_location() #9
  %24 = load i32, ptr %23, align 4, !tbaa !22
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.4, i32 noundef %24) #10
  store i8 0, ptr %3, align 4, !tbaa !16
  %26 = call i32 @sleep(i32 noundef 1) #8
  br label %27

27:                                               ; preds = %19, %21, %13
  %28 = load i8, ptr %3, align 4, !tbaa !16, !range !17, !noundef !18
  %29 = trunc nuw i8 %28 to i1
  br i1 %29, label %30, label %58

30:                                               ; preds = %27
  %31 = load i8, ptr %2, align 8, !tbaa !5, !range !17, !noundef !18
  %32 = trunc nuw i8 %31 to i1
  br i1 %32, label %58, label %33

33:                                               ; preds = %30
  %34 = load i32, ptr %6, align 4, !tbaa !20
  %35 = call zeroext i1 @recvAll(i32 noundef %34, ptr noundef nonnull %1, i64 noundef 15)
  br i1 %35, label %36, label %58

36:                                               ; preds = %33
  %37 = call double @atof(ptr noundef %1) #11
  %38 = fptoui double %37 to i64
  store i64 %38, ptr %7, align 8, !tbaa !23
  %39 = call noalias ptr @malloc(i64 noundef %38) #12
  store ptr %39, ptr %8, align 8, !tbaa !24
  %40 = load i32, ptr %6, align 4, !tbaa !20
  %41 = call zeroext i1 @recvAll(i32 noundef %40, ptr noundef %39, i64 noundef %38)
  br i1 %41, label %42, label %58

42:                                               ; preds = %36
  %43 = call i32 @sem_post(ptr noundef nonnull %9) #8
  %44 = call i32 @sem_wait(ptr noundef nonnull %10) #8
  store i8 1, ptr %11, align 1, !tbaa !25
  store i8 0, ptr %12, align 2, !tbaa !26
  %45 = load i8, ptr %2, align 8, !tbaa !5, !range !17, !noundef !18
  %46 = trunc nuw i8 %45 to i1
  br i1 %46, label %58, label %47

47:                                               ; preds = %42
  %48 = load i64, ptr %7, align 8, !tbaa !23
  %49 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %48) #8
  %50 = load i32, ptr %6, align 4, !tbaa !20
  %51 = call zeroext i1 @sendAll(i32 noundef %50, ptr noundef nonnull %1, i64 noundef 15)
  br i1 %51, label %52, label %57

52:                                               ; preds = %47
  %53 = load i32, ptr %6, align 4, !tbaa !20
  %54 = load ptr, ptr %8, align 8, !tbaa !24
  %55 = load i64, ptr %7, align 8, !tbaa !23
  %56 = call zeroext i1 @sendAll(i32 noundef %53, ptr noundef %54, i64 noundef %55)
  br label %57

57:                                               ; preds = %52, %47
  store i8 0, ptr %11, align 1, !tbaa !25
  store i8 1, ptr %12, align 2, !tbaa !26
  br label %58

58:                                               ; preds = %33, %42, %57, %36, %30, %27
  %59 = load i8, ptr %2, align 8, !tbaa !5, !range !17, !noundef !18
  %60 = trunc nuw i8 %59 to i1
  br i1 %60, label %._crit_edge, label %13, !llvm.loop !27

._crit_edge:                                      ; preds = %58
  %61 = getelementptr inbounds i8, ptr %0, i64 44
  %62 = load i8, ptr %61, align 4, !tbaa !16, !range !17, !noundef !18
  %63 = trunc nuw i8 %62 to i1
  br i1 %63, label %64, label %68

64:                                               ; preds = %._crit_edge
  %65 = getelementptr inbounds i8, ptr %0, i64 4
  %66 = load i32, ptr %65, align 4, !tbaa !20
  %67 = call i32 @close(i32 noundef %66) #8
  store i8 0, ptr %61, align 4, !tbaa !16
  br label %68

68:                                               ; preds = %64, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %1) #8
  ret ptr undef
}

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #3

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @EnableKeepalive(i32 noundef) local_unnamed_addr #2

declare i32 @sleep(i32 noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @recvAll(i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare double @atof(ptr nocapture noundef nonnull) local_unnamed_addr #6

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

declare i32 @sem_wait(ptr noundef) local_unnamed_addr #5

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @sendAll(i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @close(i32 noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { 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 #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 = { 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 #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 = { nounwind }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { cold nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { 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, !13, i64 136}
!6 = !{!"ProcessingUnitServerStructureTCP", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 24, !7, i64 40, !13, i64 44, !13, i64 45, !13, i64 46, !14, i64 48, !8, i64 56, !8, i64 88, !15, i64 120, !14, i64 128, !13, i64 136}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"sockaddr_in", !11, i64 0, !11, i64 2, !12, i64 4, !8, i64 8}
!11 = !{!"short", !8, i64 0}
!12 = !{!"in_addr", !7, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!6, !13, i64 44}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!6, !7, i64 0}
!20 = !{!6, !7, i64 4}
!21 = !{!15, !15, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!6, !14, i64 128}
!24 = !{!6, !15, i64 120}
!25 = !{!6, !13, i64 45}
!26 = !{!6, !13, i64 46}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass