; 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.sigaction = type { %union.anon, %struct.__sigset_t, i32, ptr }
%union.anon = type { ptr }
%struct.__sigset_t = type { [16 x i64] }
%struct.ProcessingUnitServerStructure = type { ptr }
%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] }

@.str = external hidden unnamed_addr constant [31 x i8], align 1
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @signalhandler(i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @CreateLinuxTCPServer(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca %struct.sigaction, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 152, ptr %10) #8
  %12 = getelementptr inbounds %struct.sigaction, ptr %10, i32 0, i32 0
  store ptr @signalhandler, ptr %12, align 8, !tbaa !11
  %13 = getelementptr inbounds %struct.sigaction, ptr %10, i32 0, i32 2
  store i32 0, ptr %13, align 8, !tbaa !12
  %14 = getelementptr inbounds %struct.sigaction, ptr %10, i32 0, i32 1
  %15 = call i32 @sigemptyset(ptr noundef %14) #8
  %16 = call i32 @sigaction(i32 noundef 13, ptr noundef %10, ptr noundef null) #8
  %17 = call noalias ptr @malloc(i64 noundef 8) #9
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %17, ptr %18, align 8, !tbaa !5
  %19 = call noalias ptr @malloc(i64 noundef 144) #9
  store ptr %19, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ProcessingUnitServerStructure, ptr %22, i32 0, i32 0
  store ptr %20, ptr %23, align 8, !tbaa !15
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %24, i32 0, i32 9
  %26 = call i32 @sem_init(ptr noundef %25, i32 noundef 0, i32 noundef 0) #8
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %27, i32 0, i32 10
  %29 = call i32 @sem_init(ptr noundef %28, i32 noundef 0, i32 noundef 0) #8
  %30 = call i32 @socket(i32 noundef 2, i32 noundef 1, i32 noundef 0) #8
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %31, i32 0, i32 0
  store i32 %30, ptr %32, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 1, ptr %11, align 4, !tbaa !9
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !17
  %36 = call i32 @setsockopt(i32 noundef %35, i32 noundef 1, i32 noundef 2, ptr noundef %11, i32 noundef 4) #8
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 8, !tbaa !17
  %40 = icmp ne i32 %39, -1
  br i1 %40, label %41, label %113

41:                                               ; preds = %3
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %42, i32 0, i32 2
  call void @llvm.memset.p0.i64(ptr align 8 %43, i8 0, i64 16, i1 false)
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %44, i32 0, i32 2
  %46 = getelementptr inbounds %struct.sockaddr_in, ptr %45, i32 0, i32 0
  store i16 2, ptr %46, align 8, !tbaa !24
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = call i32 @inet_addr(ptr noundef %47) #8
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %49, i32 0, i32 2
  %51 = getelementptr inbounds %struct.sockaddr_in, ptr %50, i32 0, i32 2
  %52 = getelementptr inbounds %struct.in_addr, ptr %51, i32 0, i32 0
  store i32 %48, ptr %52, align 4, !tbaa !25
  %53 = load i32, ptr %6, align 4, !tbaa !9
  %54 = trunc i32 %53 to i16
  %55 = call zeroext i16 @__bswap_16(i16 noundef zeroext %54)
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %56, i32 0, i32 2
  %58 = getelementptr inbounds %struct.sockaddr_in, ptr %57, i32 0, i32 1
  store i16 %55, ptr %58, align 2, !tbaa !26
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %59, i32 0, i32 4
  store i32 16, ptr %60, align 8, !tbaa !27
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %61, i32 0, i32 5
  store i8 0, ptr %62, align 4, !tbaa !28
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %63, i32 0, i32 6
  store i8 0, ptr %64, align 1, !tbaa !29
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %65, i32 0, i32 7
  store i8 0, ptr %66, align 2, !tbaa !30
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %67, i32 0, i32 0
  %69 = load i32, ptr %68, align 8, !tbaa !17
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %70, i32 0, i32 2
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %72, i32 0, i32 4
  %74 = load i32, ptr %73, align 8, !tbaa !27
  %75 = call i32 @bind(i32 noundef %69, ptr noundef %71, i32 noundef %74) #8
  store i32 %75, ptr %9, align 4, !tbaa !9
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %78, label %107

78:                                               ; preds = %41
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %79, i32 0, i32 0
  %81 = load i32, ptr %80, align 8, !tbaa !17
  %82 = call i32 @listen(i32 noundef %81, i32 noundef 1) #8
  store i32 %82, ptr %9, align 4, !tbaa !9
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %101

85:                                               ; preds = %78
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.ProcessingUnitServerStructureTCP, ptr %86, i32 0, i32 8
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = call i32 @pthread_create(ptr noundef %87, ptr noundef null, ptr noundef @ServerThread, ptr noundef %88) #8
  store i32 %89, ptr %9, align 4, !tbaa !9
  %90 = load i32, ptr %9, align 4, !tbaa !9
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %85
  store i8 1, ptr %8, align 1, !tbaa !31
  br label %100

93:                                               ; preds = %85
  %94 = call ptr @__errno_location() #10
  %95 = load i32, ptr %94, align 4, !tbaa !9
  %96 = call ptr @__errno_location() #10
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = call ptr @strerror(i32 noundef %97) #8
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %95, ptr noundef %98)
  store i8 0, ptr %8, align 1, !tbaa !31
  br label %100

100:                                              ; preds = %93, %92
  store i8 1, ptr %8, align 1, !tbaa !31
  br label %106

101:                                              ; preds = %78
  store i8 0, ptr %8, align 1, !tbaa !31
  %102 = load ptr, ptr @stderr, align 8, !tbaa !5
  %103 = call ptr @__errno_location() #10
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %102, ptr noundef @.str.1, i32 noundef %104) #8
  br label %106

106:                                              ; preds = %101, %100
  br label %112

107:                                              ; preds = %41
  store i8 0, ptr %8, align 1, !tbaa !31
  %108 = load ptr, ptr @stderr, align 8, !tbaa !5
  %109 = call ptr @__errno_location() #10
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef @.str.2, i32 noundef %110) #8
  br label %112

112:                                              ; preds = %107, %106
  br label %120

113:                                              ; preds = %3
  store i8 0, ptr %8, align 1, !tbaa !31
  %114 = call ptr @__errno_location() #10
  %115 = load i32, ptr %114, align 4, !tbaa !9
  %116 = call ptr @__errno_location() #10
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = call ptr @strerror(i32 noundef %117) #8
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %115, ptr noundef %118)
  br label %120

120:                                              ; preds = %113, %112
  %121 = load i8, ptr %8, align 1, !tbaa !31, !range !32, !noundef !33
  %122 = trunc i8 %121 to i1
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 152, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  ret i1 %122
}

; 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 @sigemptyset(ptr noundef) #2

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @ServerThread(ptr noundef) #0

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

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr 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 = { 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #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 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind willreturn memory(none) }

!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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !10, i64 136}
!13 = !{!"sigaction", !7, i64 0, !14, i64 8, !10, i64 136, !6, i64 144}
!14 = !{!"", !7, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"ProcessingUnitServerStructure", !6, i64 0}
!17 = !{!18, !10, i64 0}
!18 = !{!"ProcessingUnitServerStructureTCP", !10, i64 0, !10, i64 4, !19, i64 8, !19, i64 24, !10, i64 40, !22, i64 44, !22, i64 45, !22, i64 46, !23, i64 48, !7, i64 56, !7, i64 88, !6, i64 120, !23, i64 128, !22, i64 136}
!19 = !{!"sockaddr_in", !20, i64 0, !20, i64 2, !21, i64 4, !7, i64 8}
!20 = !{!"short", !7, i64 0}
!21 = !{!"in_addr", !10, i64 0}
!22 = !{!"_Bool", !7, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!18, !20, i64 8}
!25 = !{!18, !10, i64 12}
!26 = !{!18, !20, i64 10}
!27 = !{!18, !10, i64 40}
!28 = !{!18, !22, i64 44}
!29 = !{!18, !22, i64 45}
!30 = !{!18, !22, i64 46}
!31 = !{!22, !22, i64 0}
!32 = !{i8 0, i8 2}
!33 = !{}


; 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.sigaction = type { %union.anon, %struct.__sigset_t, i32, ptr }
%union.anon = type { ptr }
%struct.__sigset_t = type { [16 x i64] }

@.str = external hidden unnamed_addr constant [31 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @signalhandler(i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @CreateLinuxTCPServer(ptr nocapture noundef writeonly %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.sigaction, align 8
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 152, ptr nonnull %4) #8
  store ptr @signalhandler, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %4, i64 136
  store i32 0, ptr %6, align 8, !tbaa !8
  %7 = getelementptr inbounds i8, ptr %4, i64 8
  %8 = call i32 @sigemptyset(ptr noundef nonnull %7) #8
  %9 = call i32 @sigaction(i32 noundef 13, ptr noundef nonnull %4, ptr noundef null) #8
  %10 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #9
  store ptr %10, ptr %0, align 8, !tbaa !13
  %11 = call noalias dereferenceable_or_null(144) ptr @malloc(i64 noundef 144) #9
  store ptr %11, ptr %10, align 8, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %11, i64 56
  %13 = call i32 @sem_init(ptr noundef nonnull %12, i32 noundef 0, i32 noundef 0) #8
  %14 = getelementptr inbounds i8, ptr %11, i64 88
  %15 = call i32 @sem_init(ptr noundef nonnull %14, i32 noundef 0, i32 noundef 0) #8
  %16 = call i32 @socket(i32 noundef 2, i32 noundef 1, i32 noundef 0) #8
  store i32 %16, ptr %11, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store i32 1, ptr %5, align 4, !tbaa !23
  %17 = call i32 @setsockopt(i32 noundef %16, i32 noundef 1, i32 noundef 2, ptr noundef nonnull %5, i32 noundef 4) #8
  %18 = load i32, ptr %11, align 8, !tbaa !16
  %.not = icmp eq i32 %18, -1
  br i1 %.not, label %56, label %19

19:                                               ; preds = %3
  %20 = getelementptr inbounds i8, ptr %11, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %20, i8 0, i64 16, i1 false)
  store i16 2, ptr %20, align 8, !tbaa !24
  %21 = call i32 @inet_addr(ptr noundef %1) #8
  %22 = getelementptr inbounds i8, ptr %11, i64 12
  store i32 %21, ptr %22, align 4, !tbaa !25
  %23 = trunc i32 %2 to i16
  %24 = call zeroext i16 @__bswap_16(i16 noundef zeroext %23)
  %25 = getelementptr inbounds i8, ptr %11, i64 10
  store i16 %24, ptr %25, align 2, !tbaa !26
  %26 = getelementptr inbounds i8, ptr %11, i64 40
  store i32 16, ptr %26, align 8, !tbaa !27
  %27 = getelementptr inbounds i8, ptr %11, i64 44
  store i8 0, ptr %27, align 4, !tbaa !28
  %28 = getelementptr inbounds i8, ptr %11, i64 45
  store i8 0, ptr %28, align 1, !tbaa !29
  %29 = getelementptr inbounds i8, ptr %11, i64 46
  store i8 0, ptr %29, align 2, !tbaa !30
  %30 = load i32, ptr %11, align 8, !tbaa !16
  %31 = call i32 @bind(i32 noundef %30, ptr noundef nonnull %20, i32 noundef 16) #8
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %51

33:                                               ; preds = %19
  %34 = load i32, ptr %11, align 8, !tbaa !16
  %35 = call i32 @listen(i32 noundef %34, i32 noundef 1) #8
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %46

37:                                               ; preds = %33
  %38 = getelementptr inbounds i8, ptr %11, i64 48
  %39 = call i32 @pthread_create(ptr noundef nonnull %38, ptr noundef null, ptr noundef nonnull @ServerThread, ptr noundef nonnull %11) #8
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %61, label %41

41:                                               ; preds = %37
  %42 = tail call ptr @__errno_location() #10
  %43 = load i32, ptr %42, align 4, !tbaa !23
  %44 = call ptr @strerror(i32 noundef %43) #8
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %43, ptr noundef %44)
  br label %61

46:                                               ; preds = %33
  %47 = load ptr, ptr @stderr, align 8, !tbaa !13
  %48 = tail call ptr @__errno_location() #10
  %49 = load i32, ptr %48, align 4, !tbaa !23
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.1, i32 noundef %49) #11
  br label %61

51:                                               ; preds = %19
  %52 = load ptr, ptr @stderr, align 8, !tbaa !13
  %53 = tail call ptr @__errno_location() #10
  %54 = load i32, ptr %53, align 4, !tbaa !23
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.2, i32 noundef %54) #11
  br label %61

56:                                               ; preds = %3
  %57 = tail call ptr @__errno_location() #10
  %58 = load i32, ptr %57, align 4, !tbaa !23
  %59 = call ptr @strerror(i32 noundef %58) #8
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %58, ptr noundef %59)
  br label %61

61:                                               ; preds = %41, %37, %51, %46, %56
  %.0 = phi i1 [ false, %46 ], [ false, %51 ], [ false, %56 ], [ true, %37 ], [ true, %41 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %4) #8
  ret i1 %.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 @sigemptyset(ptr noundef) local_unnamed_addr #2

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @ServerThread(ptr noundef) #0

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass