; LLVM IR from InductiveComputerScience/infracore :: drivers/pu-linux-tcp (pu-linux-tcp-client)

; 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.ProcessingUnitStructureTCP = type { i32, %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] }

@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = 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 @ClientThread(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) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 20, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  %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.ProcessingUnitStructureTCP, ptr %9, i32 0, i32 11
  store i8 0, ptr %10, align 8, !tbaa !9
  br label %11

11:                                               ; preds = %136, %1
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %12, i32 0, i32 11
  %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 %137

17:                                               ; preds = %11
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %18, i32 0, i32 4
  store i8 0, ptr %19, align 1, !tbaa !19
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %20, i32 0, i32 5
  store i8 0, ptr %21, align 2, !tbaa !20
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %22, i32 0, i32 3
  %24 = load i8, ptr %23, align 8, !tbaa !21, !range !17, !noundef !18
  %25 = trunc i8 %24 to i1
  br i1 %25, label %47, label %26

26:                                               ; preds = %17
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !22
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %30, i32 0, i32 1
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %32, i32 0, i32 2
  %34 = load i32, ptr %33, align 4, !tbaa !23
  %35 = call i32 @connect(i32 noundef %29, ptr noundef %31, i32 noundef %34)
  store i32 %35, ptr %5, align 4, !tbaa !24
  %36 = load i32, ptr %5, align 4, !tbaa !24
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %41

38:                                               ; preds = %26
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %39, i32 0, i32 3
  store i8 1, ptr %40, align 8, !tbaa !21
  br label %46

41:                                               ; preds = %26
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %43, i32 0, i32 3
  store i8 0, ptr %44, align 8, !tbaa !21
  %45 = call i32 @sleep(i32 noundef 1)
  br label %46

46:                                               ; preds = %41, %38
  br label %47

47:                                               ; preds = %46, %17
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %48, i32 0, i32 3
  %50 = load i8, ptr %49, align 8, !tbaa !21, !range !17, !noundef !18
  %51 = trunc i8 %50 to i1
  br i1 %51, label %52, label %136

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

57:                                               ; preds = %52
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %58, i32 0, i32 7
  %60 = call i32 @sem_wait(ptr noundef %59)
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %61, i32 0, i32 11
  %63 = load i8, ptr %62, align 8, !tbaa !9, !range !17, !noundef !18
  %64 = trunc i8 %63 to i1
  br i1 %64, label %135, label %65

65:                                               ; preds = %57
  %66 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %67, i32 0, i32 10
  %69 = load i64, ptr %68, align 8, !tbaa !25
  %70 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %66, ptr noundef @.str.3, i64 noundef %69) #6
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 8, !tbaa !22
  %74 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %75 = call zeroext i1 @sendAll(i32 noundef %73, ptr noundef %74, i64 noundef 15)
  %76 = zext i1 %75 to i8
  store i8 %76, ptr %7, align 1, !tbaa !26
  %77 = load i8, ptr %7, align 1, !tbaa !26, !range !17, !noundef !18
  %78 = trunc i8 %77 to i1
  br i1 %78, label %79, label %91

79:                                               ; preds = %65
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %80, i32 0, i32 0
  %82 = load i32, ptr %81, align 8, !tbaa !22
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %83, i32 0, i32 9
  %85 = load ptr, ptr %84, align 8, !tbaa !27
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %86, i32 0, i32 10
  %88 = load i64, ptr %87, align 8, !tbaa !25
  %89 = call zeroext i1 @sendAll(i32 noundef %82, ptr noundef %85, i64 noundef %88)
  %90 = zext i1 %89 to i8
  store i8 %90, ptr %7, align 1, !tbaa !26
  br label %91

91:                                               ; preds = %79, %65
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %92, i32 0, i32 5
  store i8 1, ptr %93, align 2, !tbaa !20
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %94, i32 0, i32 4
  store i8 0, ptr %95, align 1, !tbaa !19
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 8, !tbaa !22
  %99 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %100 = call zeroext i1 @recvAll(i32 noundef %98, ptr noundef %99, i64 noundef 15)
  %101 = zext i1 %100 to i8
  store i8 %101, ptr %7, align 1, !tbaa !26
  %102 = load i8, ptr %7, align 1, !tbaa !26, !range !17, !noundef !18
  %103 = trunc i8 %102 to i1
  br i1 %103, label %104, label %134

104:                                              ; preds = %91
  %105 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %106 = call double @atof(ptr noundef %105) #7
  %107 = fptoui double %106 to i64
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %108, i32 0, i32 10
  store i64 %107, ptr %109, align 8, !tbaa !25
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %110, i32 0, i32 10
  %112 = load i64, ptr %111, align 8, !tbaa !25
  %113 = call noalias ptr @malloc(i64 noundef %112) #8
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %114, i32 0, i32 9
  store ptr %113, ptr %115, align 8, !tbaa !27
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 8, !tbaa !22
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %119, i32 0, i32 9
  %121 = load ptr, ptr %120, align 8, !tbaa !27
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %122, i32 0, i32 10
  %124 = load i64, ptr %123, align 8, !tbaa !25
  %125 = call zeroext i1 @recvAll(i32 noundef %118, ptr noundef %121, i64 noundef %124)
  %126 = zext i1 %125 to i8
  store i8 %126, ptr %7, align 1, !tbaa !26
  %127 = load i8, ptr %7, align 1, !tbaa !26, !range !17, !noundef !18
  %128 = trunc i8 %127 to i1
  br i1 %128, label %129, label %133

129:                                              ; preds = %104
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.ProcessingUnitStructureTCP, ptr %130, i32 0, i32 8
  %132 = call i32 @sem_post(ptr noundef %131) #6
  br label %133

133:                                              ; preds = %129, %104
  br label %134

134:                                              ; preds = %133, %91
  br label %135

135:                                              ; preds = %134, %57
  br label %136

136:                                              ; preds = %135, %52, %47
  br label %11, !llvm.loop !28

137:                                              ; preds = %11
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 20, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %138 = load ptr, ptr %2, align 8
  ret ptr %138
}

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

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

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

declare i32 @sleep(i32 noundef) #3

declare i32 @sem_wait(ptr noundef) #3

; 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

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

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

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 = { "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 = { 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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 120}
!10 = !{!"ProcessingUnitStructureTCP", !11, i64 0, !12, i64 4, !11, i64 20, !15, i64 24, !15, i64 25, !15, i64 26, !16, i64 32, !7, i64 40, !7, i64 72, !6, i64 104, !16, i64 112, !15, i64 120}
!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 25}
!20 = !{!10, !15, i64 26}
!21 = !{!10, !15, i64 24}
!22 = !{!10, !11, i64 0}
!23 = !{!10, !11, i64 20}
!24 = !{!11, !11, i64 0}
!25 = !{!10, !16, i64 112}
!26 = !{!15, !15, i64 0}
!27 = !{!10, !6, i64 104}
!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"

@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = 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 @ClientThread(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) #7
  %2 = getelementptr inbounds i8, ptr %0, i64 120
  store i8 0, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 25
  %4 = getelementptr inbounds i8, ptr %0, i64 26
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = getelementptr inbounds i8, ptr %0, i64 20
  %8 = getelementptr inbounds i8, ptr %0, i64 40
  %9 = getelementptr inbounds i8, ptr %0, i64 112
  %10 = getelementptr inbounds i8, ptr %0, i64 104
  %11 = getelementptr inbounds i8, ptr %0, i64 72
  br label %12

12:                                               ; preds = %.lr.ph, %54
  store i8 0, ptr %3, align 1, !tbaa !16
  store i8 0, ptr %4, align 2, !tbaa !17
  %13 = load i8, ptr %5, align 8, !tbaa !18, !range !19, !noundef !20
  %14 = trunc nuw i8 %13 to i1
  br i1 %14, label %23, label %15

15:                                               ; preds = %12
  %16 = load i32, ptr %0, align 8, !tbaa !21
  %17 = load i32, ptr %7, align 4, !tbaa !22
  %18 = call i32 @connect(i32 noundef %16, ptr noundef nonnull %6, i32 noundef %17) #7
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %.thread, label %20

.thread:                                          ; preds = %15
  store i8 1, ptr %5, align 8, !tbaa !18
  br label %26

20:                                               ; preds = %15
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  store i8 0, ptr %5, align 8, !tbaa !18
  %22 = call i32 @sleep(i32 noundef 1) #7
  %.pre = load i8, ptr %5, align 8, !tbaa !18, !range !19
  br label %23

23:                                               ; preds = %20, %12
  %24 = phi i8 [ %.pre, %20 ], [ %13, %12 ]
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %26, label %54

26:                                               ; preds = %.thread, %23
  %27 = load i8, ptr %2, align 8, !tbaa !5, !range !19, !noundef !20
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %54, label %29

29:                                               ; preds = %26
  %30 = call i32 @sem_wait(ptr noundef nonnull %8) #7
  %31 = load i8, ptr %2, align 8, !tbaa !5, !range !19, !noundef !20
  %32 = trunc nuw i8 %31 to i1
  br i1 %32, label %54, label %33

33:                                               ; preds = %29
  %34 = load i64, ptr %9, align 8, !tbaa !23
  %35 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %34) #7
  %36 = load i32, ptr %0, align 8, !tbaa !21
  %37 = call zeroext i1 @sendAll(i32 noundef %36, ptr noundef nonnull %1, i64 noundef 15)
  br i1 %37, label %38, label %43

38:                                               ; preds = %33
  %39 = load i32, ptr %0, align 8, !tbaa !21
  %40 = load ptr, ptr %10, align 8, !tbaa !24
  %41 = load i64, ptr %9, align 8, !tbaa !23
  %42 = call zeroext i1 @sendAll(i32 noundef %39, ptr noundef %40, i64 noundef %41)
  br label %43

43:                                               ; preds = %38, %33
  store i8 1, ptr %4, align 2, !tbaa !17
  store i8 0, ptr %3, align 1, !tbaa !16
  %44 = load i32, ptr %0, align 8, !tbaa !21
  %45 = call zeroext i1 @recvAll(i32 noundef %44, ptr noundef nonnull %1, i64 noundef 15)
  br i1 %45, label %46, label %54

46:                                               ; preds = %43
  %47 = call double @atof(ptr noundef %1) #8
  %48 = fptoui double %47 to i64
  store i64 %48, ptr %9, align 8, !tbaa !23
  %49 = call noalias ptr @malloc(i64 noundef %48) #9
  store ptr %49, ptr %10, align 8, !tbaa !24
  %50 = load i32, ptr %0, align 8, !tbaa !21
  %51 = call zeroext i1 @recvAll(i32 noundef %50, ptr noundef %49, i64 noundef %48)
  br i1 %51, label %52, label %54

52:                                               ; preds = %46
  %53 = call i32 @sem_post(ptr noundef nonnull %11) #7
  br label %54

54:                                               ; preds = %29, %46, %52, %43, %26, %23
  %55 = load i8, ptr %2, align 8, !tbaa !5, !range !19, !noundef !20
  %56 = trunc nuw i8 %55 to i1
  br i1 %56, label %._crit_edge, label %12, !llvm.loop !25

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

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

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

declare i32 @connect(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @sleep(i32 noundef) local_unnamed_addr #4

declare i32 @sem_wait(ptr noundef) local_unnamed_addr #4

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

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

; 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 #5

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

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 = { 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 = { "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 = { 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 #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, !13, i64 120}
!6 = !{!"ProcessingUnitStructureTCP", !7, i64 0, !10, i64 4, !7, i64 20, !13, i64 24, !13, i64 25, !13, i64 26, !14, i64 32, !8, i64 40, !8, i64 72, !15, i64 104, !14, i64 112, !13, i64 120}
!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 25}
!17 = !{!6, !13, i64 26}
!18 = !{!6, !13, i64 24}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!6, !7, i64 0}
!22 = !{!6, !7, i64 20}
!23 = !{!6, !14, i64 112}
!24 = !{!6, !15, i64 104}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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