; LLVM IR from nubot-nudt/simatch :: src/robot_code/world_model/rtdb/multicast.ll (Z10openSocketPc)

; 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 }
%struct.ip_mreqn = type { %struct.in_addr, %struct.in_addr, i32 }
%struct.ip_mreq = type { %struct.in_addr, %struct.in_addr }

@destAddress = external dso_local global %struct.sockaddr_in, align 4
@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@__FUNCTION__._Z10openSocketPc = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z14if_NameToIndexPcS_(ptr noundef, ptr noundef) #0

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z10openSocketPc(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %struct.sockaddr_in, align 4
  %5 = alloca %struct.ip_mreqn, align 4
  %6 = alloca %struct.ip_mreq, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [20 x i8], align 16
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 20, ptr %9) #7
  call void @llvm.memset.p0.i64(ptr align 4 %4, i8 0, i64 16, i1 false)
  %11 = getelementptr inbounds %struct.sockaddr_in, ptr %4, i32 0, i32 0
  store i16 2, ptr %11, align 4, !tbaa !9
  %12 = call noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext 5081)
  %13 = getelementptr inbounds %struct.sockaddr_in, ptr %4, i32 0, i32 1
  store i16 %12, ptr %13, align 2, !tbaa !14
  %14 = getelementptr inbounds %struct.sockaddr_in, ptr %4, i32 0, i32 2
  %15 = getelementptr inbounds %struct.in_addr, ptr %14, i32 0, i32 0
  store i32 0, ptr %15, align 4, !tbaa !15
  call void @llvm.memset.p0.i64(ptr align 4 @destAddress, i8 0, i64 16, i1 false)
  store i16 2, ptr @destAddress, align 4, !tbaa !9
  %16 = call noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext 5081)
  store i16 %16, ptr getelementptr inbounds (%struct.sockaddr_in, ptr @destAddress, i32 0, i32 1), align 2, !tbaa !14
  %17 = call i32 @inet_addr(ptr noundef @.str.5) #7
  store i32 %17, ptr getelementptr inbounds (%struct.sockaddr_in, ptr @destAddress, i32 0, i32 2), align 4, !tbaa !15
  %18 = call i32 @socket(i32 noundef 2, i32 noundef 2, i32 noundef 17) #7
  store i32 %18, ptr %7, align 4, !tbaa !16
  %19 = icmp eq i32 %18, -1
  br i1 %19, label %20, label %25

20:                                               ; preds = %1
  %21 = call ptr @__errno_location() #8
  %22 = load i32, ptr %21, align 4, !tbaa !16
  %23 = call ptr @strerror(i32 noundef %22) #7
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__FUNCTION__._Z10openSocketPc, ptr noundef %23)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %83

25:                                               ; preds = %1
  call void @llvm.memset.p0.i64(ptr align 1 %5, i8 0, i64 12, i1 false)
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds [20 x i8], ptr %9, i64 0, i64 0
  %28 = call noundef i32 @_Z14if_NameToIndexPcS_(ptr noundef %26, ptr noundef %27)
  %29 = getelementptr inbounds %struct.ip_mreqn, ptr %5, i32 0, i32 2
  store i32 %28, ptr %29, align 4, !tbaa !17
  %30 = load i32, ptr %7, align 4, !tbaa !16
  %31 = call i32 @setsockopt(i32 noundef %30, i32 noundef 0, i32 noundef 32, ptr noundef %5, i32 noundef 12) #7
  %32 = icmp eq i32 %31, -1
  br i1 %32, label %33, label %38

33:                                               ; preds = %25
  %34 = call ptr @__errno_location() #8
  %35 = load i32, ptr %34, align 4, !tbaa !16
  %36 = call ptr @strerror(i32 noundef %35) #7
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.1, ptr noundef @__FUNCTION__._Z10openSocketPc, ptr noundef %36)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %83

38:                                               ; preds = %25
  store i32 1, ptr %8, align 4, !tbaa !16
  %39 = load i32, ptr %7, align 4, !tbaa !16
  %40 = call i32 @setsockopt(i32 noundef %39, i32 noundef 1, i32 noundef 2, ptr noundef %8, i32 noundef 4) #7
  %41 = icmp eq i32 %40, -1
  br i1 %41, label %42, label %47

42:                                               ; preds = %38
  %43 = call ptr @__errno_location() #8
  %44 = load i32, ptr %43, align 4, !tbaa !16
  %45 = call ptr @strerror(i32 noundef %44) #7
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.1, ptr noundef @__FUNCTION__._Z10openSocketPc, ptr noundef %45)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %83

47:                                               ; preds = %38
  call void @llvm.memset.p0.i64(ptr align 1 %6, i8 0, i64 8, i1 false)
  %48 = call i32 @inet_addr(ptr noundef @.str.5) #7
  %49 = getelementptr inbounds %struct.ip_mreq, ptr %6, i32 0, i32 0
  %50 = getelementptr inbounds %struct.in_addr, ptr %49, i32 0, i32 0
  store i32 %48, ptr %50, align 4, !tbaa !19
  %51 = getelementptr inbounds [20 x i8], ptr %9, i64 0, i64 0
  %52 = call i32 @inet_addr(ptr noundef %51) #7
  %53 = getelementptr inbounds %struct.ip_mreq, ptr %6, i32 0, i32 1
  %54 = getelementptr inbounds %struct.in_addr, ptr %53, i32 0, i32 0
  store i32 %52, ptr %54, align 4, !tbaa !21
  %55 = load i32, ptr %7, align 4, !tbaa !16
  %56 = call i32 @setsockopt(i32 noundef %55, i32 noundef 0, i32 noundef 35, ptr noundef %6, i32 noundef 8) #7
  %57 = icmp eq i32 %56, -1
  br i1 %57, label %58, label %63

58:                                               ; preds = %47
  %59 = call ptr @__errno_location() #8
  %60 = load i32, ptr %59, align 4, !tbaa !16
  %61 = call ptr @strerror(i32 noundef %60) #7
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.1, ptr noundef @__FUNCTION__._Z10openSocketPc, ptr noundef %61)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %83

63:                                               ; preds = %47
  store i32 0, ptr %8, align 4, !tbaa !16
  %64 = load i32, ptr %7, align 4, !tbaa !16
  %65 = call i32 @setsockopt(i32 noundef %64, i32 noundef 0, i32 noundef 34, ptr noundef %8, i32 noundef 4) #7
  %66 = icmp eq i32 %65, -1
  br i1 %66, label %67, label %72

67:                                               ; preds = %63
  %68 = call ptr @__errno_location() #8
  %69 = load i32, ptr %68, align 4, !tbaa !16
  %70 = call ptr @strerror(i32 noundef %69) #7
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.1, ptr noundef @__FUNCTION__._Z10openSocketPc, ptr noundef %70)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %83

72:                                               ; preds = %63
  %73 = load i32, ptr %7, align 4, !tbaa !16
  %74 = call i32 @bind(i32 noundef %73, ptr noundef %4, i32 noundef 16) #7
  %75 = icmp eq i32 %74, -1
  br i1 %75, label %76, label %81

76:                                               ; preds = %72
  %77 = call ptr @__errno_location() #8
  %78 = load i32, ptr %77, align 4, !tbaa !16
  %79 = call ptr @strerror(i32 noundef %78) #7
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.1, ptr noundef @__FUNCTION__._Z10openSocketPc, ptr noundef %79)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %83

81:                                               ; preds = %72
  %82 = load i32, ptr %7, align 4, !tbaa !16
  store i32 %82, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %83

83:                                               ; preds = %81, %76, %67, %58, %42, %33, %20
  call void @llvm.lifetime.end.p0(i64 20, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #7
  %84 = load i32, ptr %2, align 4
  ret i32 %84
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext) #6

; Function Attrs: nounwind
declare i32 @inet_addr(ptr noundef) #3

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

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

attributes #0 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 = { 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 #6 = { inlinehint mustprogress 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 #7 = { nounwind }
attributes #8 = { 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++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS11sockaddr_in", !11, i64 0, !11, i64 2, !12, i64 4, !7, i64 8}
!11 = !{!"short", !7, i64 0}
!12 = !{!"_ZTS7in_addr", !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!10, !11, i64 2}
!15 = !{!10, !13, i64 4}
!16 = !{!13, !13, i64 0}
!17 = !{!18, !13, i64 8}
!18 = !{!"_ZTS8ip_mreqn", !12, i64 0, !12, i64 4, !13, i64 8}
!19 = !{!20, !13, i64 0}
!20 = !{!"_ZTS7ip_mreq", !12, i64 0, !12, i64 4}
!21 = !{!20, !13, i64 4}


; 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 }
%struct.ip_mreqn = type { %struct.in_addr, %struct.in_addr, i32 }
%struct.ip_mreq = type { %struct.in_addr, %struct.in_addr }

@destAddress = external dso_local local_unnamed_addr global %struct.sockaddr_in, align 4
@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@__FUNCTION__._Z10openSocketPc = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z14if_NameToIndexPcS_(ptr noundef, ptr noundef) local_unnamed_addr #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z10openSocketPc(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca %struct.sockaddr_in, align 4
  %3 = alloca %struct.ip_mreqn, align 8
  %4 = alloca %struct.ip_mreq, align 4
  %5 = alloca i32, align 4
  %6 = alloca [20 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %6) #7
  %7 = getelementptr inbounds i8, ptr %2, i64 8
  store i64 0, ptr %7, align 4
  store i16 2, ptr %2, align 4, !tbaa !5
  %8 = tail call noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext 5081)
  %9 = getelementptr inbounds i8, ptr %2, i64 2
  store i16 %8, ptr %9, align 2, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 0, ptr %10, align 4, !tbaa !13
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) @destAddress, i8 0, i64 16, i1 false)
  store i16 2, ptr @destAddress, align 4, !tbaa !5
  %11 = tail call noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext 5081)
  store i16 %11, ptr getelementptr inbounds (i8, ptr @destAddress, i64 2), align 2, !tbaa !12
  %12 = tail call i32 @inet_addr(ptr noundef nonnull @.str.5) #7
  store i32 %12, ptr getelementptr inbounds (i8, ptr @destAddress, i64 4), align 4, !tbaa !13
  %13 = tail call i32 @socket(i32 noundef 2, i32 noundef 2, i32 noundef 17) #7
  %14 = icmp eq i32 %13, -1
  br i1 %14, label %15, label %20

15:                                               ; preds = %1
  %16 = tail call ptr @__errno_location() #8
  %17 = load i32, ptr %16, align 4, !tbaa !14
  %18 = tail call ptr @strerror(i32 noundef %17) #7
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__._Z10openSocketPc, ptr noundef %18)
  br label %65

20:                                               ; preds = %1
  store i64 0, ptr %3, align 8
  %21 = call noundef i32 @_Z14if_NameToIndexPcS_(ptr noundef %0, ptr noundef nonnull %6)
  %22 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 %21, ptr %22, align 8, !tbaa !15
  %23 = call i32 @setsockopt(i32 noundef %13, i32 noundef 0, i32 noundef 32, ptr noundef nonnull %3, i32 noundef 12) #7
  %24 = icmp eq i32 %23, -1
  br i1 %24, label %25, label %30

25:                                               ; preds = %20
  %26 = tail call ptr @__errno_location() #8
  %27 = load i32, ptr %26, align 4, !tbaa !14
  %28 = call ptr @strerror(i32 noundef %27) #7
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__._Z10openSocketPc, ptr noundef %28)
  br label %65

30:                                               ; preds = %20
  store i32 1, ptr %5, align 4, !tbaa !14
  %31 = call i32 @setsockopt(i32 noundef %13, i32 noundef 1, i32 noundef 2, ptr noundef nonnull %5, i32 noundef 4) #7
  %32 = icmp eq i32 %31, -1
  br i1 %32, label %33, label %38

33:                                               ; preds = %30
  %34 = tail call ptr @__errno_location() #8
  %35 = load i32, ptr %34, align 4, !tbaa !14
  %36 = call ptr @strerror(i32 noundef %35) #7
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__._Z10openSocketPc, ptr noundef %36)
  br label %65

38:                                               ; preds = %30
  %39 = call i32 @inet_addr(ptr noundef nonnull @.str.5) #7
  store i32 %39, ptr %4, align 4, !tbaa !17
  %40 = call i32 @inet_addr(ptr noundef nonnull %6) #7
  %41 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 %40, ptr %41, align 4, !tbaa !19
  %42 = call i32 @setsockopt(i32 noundef %13, i32 noundef 0, i32 noundef 35, ptr noundef nonnull %4, i32 noundef 8) #7
  %43 = icmp eq i32 %42, -1
  br i1 %43, label %44, label %49

44:                                               ; preds = %38
  %45 = tail call ptr @__errno_location() #8
  %46 = load i32, ptr %45, align 4, !tbaa !14
  %47 = call ptr @strerror(i32 noundef %46) #7
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__._Z10openSocketPc, ptr noundef %47)
  br label %65

49:                                               ; preds = %38
  store i32 0, ptr %5, align 4, !tbaa !14
  %50 = call i32 @setsockopt(i32 noundef %13, i32 noundef 0, i32 noundef 34, ptr noundef nonnull %5, i32 noundef 4) #7
  %51 = icmp eq i32 %50, -1
  br i1 %51, label %52, label %57

52:                                               ; preds = %49
  %53 = tail call ptr @__errno_location() #8
  %54 = load i32, ptr %53, align 4, !tbaa !14
  %55 = call ptr @strerror(i32 noundef %54) #7
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__._Z10openSocketPc, ptr noundef %55)
  br label %65

57:                                               ; preds = %49
  %58 = call i32 @bind(i32 noundef %13, ptr noundef nonnull %2, i32 noundef 16) #7
  %59 = icmp eq i32 %58, -1
  br i1 %59, label %60, label %65

60:                                               ; preds = %57
  %61 = tail call ptr @__errno_location() #8
  %62 = load i32, ptr %61, align 4, !tbaa !14
  %63 = call ptr @strerror(i32 noundef %62) #7
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__._Z10openSocketPc, ptr noundef %63)
  br label %65

65:                                               ; preds = %57, %60, %52, %44, %33, %25, %15
  %.0 = phi i32 [ -1, %15 ], [ -1, %25 ], [ -1, %33 ], [ -1, %44 ], [ -1, %52 ], [ -1, %60 ], [ %13, %57 ]
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  ret i32 %.0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext) local_unnamed_addr #6

; Function Attrs: nounwind
declare i32 @inet_addr(ptr noundef) local_unnamed_addr #3

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

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

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 = { 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 = { 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 #6 = { inlinehint mustprogress 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 #7 = { nounwind }
attributes #8 = { 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, !7, i64 0}
!6 = !{!"_ZTS11sockaddr_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++ TBAA"}
!10 = !{!"_ZTS7in_addr", !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !7, i64 2}
!13 = !{!6, !11, i64 4}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !11, i64 8}
!16 = !{!"_ZTS8ip_mreqn", !10, i64 0, !10, i64 4, !11, i64 8}
!17 = !{!18, !11, i64 0}
!18 = !{!"_ZTS7ip_mreq", !10, i64 0, !10, i64 4}
!19 = !{!18, !11, i64 4}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass