; LLVM IR from tezc/sc :: socket (sock_test)

; 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.sc_sock = type { %struct.sc_sock_fd, i8, i32, [128 x i8] }
%struct.sc_sock_fd = type { i32, i32, i32 }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [62 x i8], align 1
@__PRETTY_FUNCTION__.test1 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [23 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

declare void @sc_sock_init(ptr noundef, i32 noundef, i1 noundef zeroext, i32 noundef) #2

declare i32 @sc_sock_listen(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

declare i32 @sc_sock_accept(ptr noundef, ptr noundef) #2

declare i32 @sc_sock_recv(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

declare i32 @sc_sock_term(ptr noundef) #2

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

declare ptr @sc_sock_error(ptr noundef) #2

declare i32 @sc_sock_connect(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @sleep(i32 noundef) #2

declare i32 @sc_sock_send(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @test1() #4 {
  %1 = alloca i32, align 4
  %2 = alloca [5 x i8], align 1
  %3 = alloca %struct.sc_sock, align 4
  %4 = alloca %struct.sc_sock, align 4
  %5 = alloca %struct.sc_sock, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 5, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 148, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 148, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 148, ptr %5) #5
  call void @sc_sock_init(ptr noundef %3, i32 noundef 0, i1 noundef zeroext false, i32 noundef 2)
  %6 = call i32 @sc_sock_connect(ptr noundef %3, ptr noundef @.str.40, ptr noundef @.str.41, ptr noundef null, ptr noundef null)
  %7 = icmp ne i32 %6, 0
  br i1 %7, label %8, label %9

8:                                                ; preds = %0
  br label %10

9:                                                ; preds = %0
  call void @__assert_fail(ptr noundef @.str.42, ptr noundef @.str.3, i32 noundef 382, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

10:                                               ; preds = %8
  %11 = call i32 @sc_sock_finish_connect(ptr noundef %3)
  %12 = icmp ne i32 %11, 0
  br i1 %12, label %13, label %14

13:                                               ; preds = %10
  br label %15

14:                                               ; preds = %10
  call void @__assert_fail(ptr noundef @.str.43, ptr noundef @.str.3, i32 noundef 383, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

15:                                               ; preds = %13
  %16 = call i32 @sc_sock_connect(ptr noundef %3, ptr noundef @.str.40, ptr noundef @.str.41, ptr noundef @.str.44, ptr noundef @.str.45)
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %19

18:                                               ; preds = %15
  br label %20

19:                                               ; preds = %15
  call void @__assert_fail(ptr noundef @.str.46, ptr noundef @.str.3, i32 noundef 385, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

20:                                               ; preds = %18
  %21 = call i32 @sc_sock_finish_connect(ptr noundef %3)
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %20
  br label %25

24:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str.43, ptr noundef @.str.3, i32 noundef 386, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

25:                                               ; preds = %23
  %26 = call i32 @sc_sock_send(ptr noundef %3, ptr noundef @.str.8, i32 noundef 5, i32 noundef 0)
  %27 = icmp eq i32 %26, -1
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  br label %30

29:                                               ; preds = %25
  call void @__assert_fail(ptr noundef @.str.47, ptr noundef @.str.3, i32 noundef 387, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

30:                                               ; preds = %28
  %31 = getelementptr inbounds [5 x i8], ptr %2, i64 0, i64 0
  %32 = call i32 @sc_sock_recv(ptr noundef %3, ptr noundef %31, i32 noundef 5, i32 noundef 0)
  %33 = icmp eq i32 %32, -1
  br i1 %33, label %34, label %35

34:                                               ; preds = %30
  br label %36

35:                                               ; preds = %30
  call void @__assert_fail(ptr noundef @.str.48, ptr noundef @.str.3, i32 noundef 388, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

36:                                               ; preds = %34
  %37 = call i32 @sc_sock_connect(ptr noundef %3, ptr noundef @.str.49, ptr noundef @.str.41, ptr noundef @.str.23, ptr noundef @.str.45)
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  br label %41

40:                                               ; preds = %36
  call void @__assert_fail(ptr noundef @.str.50, ptr noundef @.str.3, i32 noundef 389, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

41:                                               ; preds = %39
  %42 = call i32 @sc_sock_finish_connect(ptr noundef %3)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %41
  br label %46

45:                                               ; preds = %41
  call void @__assert_fail(ptr noundef @.str.43, ptr noundef @.str.3, i32 noundef 390, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

46:                                               ; preds = %44
  %47 = call i32 @sc_sock_connect(ptr noundef %3, ptr noundef @.str.51, ptr noundef @.str.41, ptr noundef @.str.52, ptr noundef @.str.45)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %46
  br label %51

50:                                               ; preds = %46
  call void @__assert_fail(ptr noundef @.str.53, ptr noundef @.str.3, i32 noundef 391, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

51:                                               ; preds = %49
  %52 = call i32 @sc_sock_finish_connect(ptr noundef %3)
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %51
  br label %56

55:                                               ; preds = %51
  call void @__assert_fail(ptr noundef @.str.43, ptr noundef @.str.3, i32 noundef 392, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

56:                                               ; preds = %54
  %57 = call i32 @sc_sock_connect(ptr noundef %3, ptr noundef @.str.54, ptr noundef @.str.41, ptr noundef @.str.23, ptr noundef @.str.45)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %56
  br label %61

60:                                               ; preds = %56
  call void @__assert_fail(ptr noundef @.str.55, ptr noundef @.str.3, i32 noundef 393, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

61:                                               ; preds = %59
  %62 = call i32 @sc_sock_connect(ptr noundef %3, ptr noundef @.str.54, ptr noundef @.str.41, ptr noundef null, ptr noundef @.str.45)
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %61
  br label %66

65:                                               ; preds = %61
  call void @__assert_fail(ptr noundef @.str.56, ptr noundef @.str.3, i32 noundef 394, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

66:                                               ; preds = %64
  %67 = call i32 @sc_sock_connect(ptr noundef %3, ptr noundef @.str.54, ptr noundef @.str.41, ptr noundef @.str.57, ptr noundef null)
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %66
  br label %71

70:                                               ; preds = %66
  call void @__assert_fail(ptr noundef @.str.58, ptr noundef @.str.3, i32 noundef 395, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

71:                                               ; preds = %69
  %72 = call i32 @sc_sock_connect(ptr noundef %3, ptr noundef @.str.59, ptr noundef @.str.41, ptr noundef @.str.60, ptr noundef null)
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %75

74:                                               ; preds = %71
  br label %76

75:                                               ; preds = %71
  call void @__assert_fail(ptr noundef @.str.61, ptr noundef @.str.3, i32 noundef 397, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

76:                                               ; preds = %74
  %77 = call i32 @sc_sock_connect(ptr noundef %3, ptr noundef @.str.59, ptr noundef @.str.41, ptr noundef null, ptr noundef @.str.62)
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %76
  br label %81

80:                                               ; preds = %76
  call void @__assert_fail(ptr noundef @.str.63, ptr noundef @.str.3, i32 noundef 398, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

81:                                               ; preds = %79
  %82 = call i32 @sc_sock_term(ptr noundef %3)
  call void @sc_sock_init(ptr noundef %3, i32 noundef 0, i1 noundef zeroext false, i32 noundef 2)
  %83 = call i32 @sc_sock_listen(ptr noundef %3, ptr noundef @.str, ptr noundef @.str.64)
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %81
  br label %87

86:                                               ; preds = %81
  call void @__assert_fail(ptr noundef @.str.65, ptr noundef @.str.3, i32 noundef 402, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

87:                                               ; preds = %85
  call void @sc_sock_init(ptr noundef %4, i32 noundef 0, i1 noundef zeroext false, i32 noundef 2)
  %88 = call i32 @sc_sock_connect(ptr noundef %4, ptr noundef @.str, ptr noundef @.str.64, ptr noundef null, ptr noundef null)
  store i32 %88, ptr %1, align 4, !tbaa !5
  %89 = load i32, ptr %1, align 4, !tbaa !5
  %90 = icmp ne i32 %89, -1
  br i1 %90, label %98, label %91

91:                                               ; preds = %87
  %92 = load i32, ptr %1, align 4, !tbaa !5
  %93 = icmp eq i32 %92, -1
  br i1 %93, label %94, label %99

94:                                               ; preds = %91
  %95 = call ptr @__errno_location() #7
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = icmp eq i32 %96, 11
  br i1 %97, label %98, label %99

98:                                               ; preds = %94, %87
  br label %100

99:                                               ; preds = %94, %91
  call void @__assert_fail(ptr noundef @.str.66, ptr noundef @.str.3, i32 noundef 406, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

100:                                              ; preds = %98
  %101 = call i32 @sleep(i32 noundef 2)
  %102 = call i32 @sc_sock_accept(ptr noundef %3, ptr noundef %5)
  store i32 %102, ptr %1, align 4, !tbaa !5
  %103 = load i32, ptr %1, align 4, !tbaa !5
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %109

105:                                              ; preds = %100
  %106 = load i32, ptr %1, align 4, !tbaa !5
  %107 = call ptr @sc_sock_error(ptr noundef %3)
  %108 = call i32 (ptr, ...) @printf(ptr noundef @.str.67, i32 noundef %106, ptr noundef %107)
  br label %109

109:                                              ; preds = %105, %100
  %110 = call i32 @sc_sock_finish_connect(ptr noundef %4)
  %111 = icmp eq i32 %110, 0
  br i1 %111, label %112, label %113

112:                                              ; preds = %109
  br label %114

113:                                              ; preds = %109
  call void @__assert_fail(ptr noundef @.str.68, ptr noundef @.str.3, i32 noundef 415, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

114:                                              ; preds = %112
  %115 = call i32 @sc_sock_term(ptr noundef %3)
  %116 = icmp eq i32 %115, 0
  br i1 %116, label %117, label %118

117:                                              ; preds = %114
  br label %119

118:                                              ; preds = %114
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.3, i32 noundef 416, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

119:                                              ; preds = %117
  %120 = call i32 @sc_sock_term(ptr noundef %4)
  %121 = icmp eq i32 %120, 0
  br i1 %121, label %122, label %123

122:                                              ; preds = %119
  br label %124

123:                                              ; preds = %119
  call void @__assert_fail(ptr noundef @.str.69, ptr noundef @.str.3, i32 noundef 417, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

124:                                              ; preds = %122
  %125 = call i32 @sc_sock_term(ptr noundef %5)
  %126 = icmp eq i32 %125, 0
  br i1 %126, label %127, label %128

127:                                              ; preds = %124
  br label %129

128:                                              ; preds = %124
  call void @__assert_fail(ptr noundef @.str.70, ptr noundef @.str.3, i32 noundef 418, ptr noundef @__PRETTY_FUNCTION__.test1) #6
  unreachable

129:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 148, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 148, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 148, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 5, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void
}

declare i32 @sc_sock_finish_connect(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { noreturn 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 = { 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 #5 = { nounwind }
attributes #6 = { noreturn nounwind }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; 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.sc_sock = type { %struct.sc_sock_fd, i8, i32, [128 x i8] }
%struct.sc_sock_fd = type { i32, i32, i32 }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [62 x i8], align 1
@__PRETTY_FUNCTION__.test1 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [23 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

declare void @sc_sock_init(ptr noundef, i32 noundef, i1 noundef zeroext, i32 noundef) local_unnamed_addr #2

declare i32 @sc_sock_listen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @sc_sock_accept(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @sc_sock_recv(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @sc_sock_term(ptr noundef) local_unnamed_addr #2

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

declare ptr @sc_sock_error(ptr noundef) local_unnamed_addr #2

declare i32 @sc_sock_connect(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @sleep(i32 noundef) local_unnamed_addr #2

declare i32 @sc_sock_send(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @test1() local_unnamed_addr #5 {
  %1 = alloca [5 x i8], align 1
  %2 = alloca %struct.sc_sock, align 4
  %3 = alloca %struct.sc_sock, align 4
  %4 = alloca %struct.sc_sock, align 4
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 148, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 148, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 148, ptr nonnull %4) #6
  call void @sc_sock_init(ptr noundef nonnull %2, i32 noundef 0, i1 noundef zeroext false, i32 noundef 2) #6
  %5 = call i32 @sc_sock_connect(ptr noundef nonnull %2, ptr noundef nonnull @.str.40, ptr noundef nonnull @.str.41, ptr noundef null, ptr noundef null) #6
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %6, label %7

6:                                                ; preds = %0
  call void @__assert_fail(ptr noundef nonnull @.str.42, ptr noundef nonnull @.str.3, i32 noundef 382, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

7:                                                ; preds = %0
  %8 = call i32 @sc_sock_finish_connect(ptr noundef nonnull %2) #6
  %.not4 = icmp eq i32 %8, 0
  br i1 %.not4, label %9, label %10

9:                                                ; preds = %7
  call void @__assert_fail(ptr noundef nonnull @.str.43, ptr noundef nonnull @.str.3, i32 noundef 383, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

10:                                               ; preds = %7
  %11 = call i32 @sc_sock_connect(ptr noundef nonnull %2, ptr noundef nonnull @.str.40, ptr noundef nonnull @.str.41, ptr noundef nonnull @.str.44, ptr noundef nonnull @.str.45) #6
  %.not5 = icmp eq i32 %11, 0
  br i1 %.not5, label %12, label %13

12:                                               ; preds = %10
  call void @__assert_fail(ptr noundef nonnull @.str.46, ptr noundef nonnull @.str.3, i32 noundef 385, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

13:                                               ; preds = %10
  %14 = call i32 @sc_sock_finish_connect(ptr noundef nonnull %2) #6
  %.not6 = icmp eq i32 %14, 0
  br i1 %.not6, label %15, label %16

15:                                               ; preds = %13
  call void @__assert_fail(ptr noundef nonnull @.str.43, ptr noundef nonnull @.str.3, i32 noundef 386, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

16:                                               ; preds = %13
  %17 = call i32 @sc_sock_send(ptr noundef nonnull %2, ptr noundef nonnull @.str.8, i32 noundef 5, i32 noundef 0) #6
  %18 = icmp eq i32 %17, -1
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  call void @__assert_fail(ptr noundef nonnull @.str.47, ptr noundef nonnull @.str.3, i32 noundef 387, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

20:                                               ; preds = %16
  %21 = call i32 @sc_sock_recv(ptr noundef nonnull %2, ptr noundef nonnull %1, i32 noundef 5, i32 noundef 0) #6
  %22 = icmp eq i32 %21, -1
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  call void @__assert_fail(ptr noundef nonnull @.str.48, ptr noundef nonnull @.str.3, i32 noundef 388, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

24:                                               ; preds = %20
  %25 = call i32 @sc_sock_connect(ptr noundef nonnull %2, ptr noundef nonnull @.str.49, ptr noundef nonnull @.str.41, ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.45) #6
  %.not7 = icmp eq i32 %25, 0
  br i1 %.not7, label %26, label %27

26:                                               ; preds = %24
  call void @__assert_fail(ptr noundef nonnull @.str.50, ptr noundef nonnull @.str.3, i32 noundef 389, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

27:                                               ; preds = %24
  %28 = call i32 @sc_sock_finish_connect(ptr noundef nonnull %2) #6
  %.not8 = icmp eq i32 %28, 0
  br i1 %.not8, label %29, label %30

29:                                               ; preds = %27
  call void @__assert_fail(ptr noundef nonnull @.str.43, ptr noundef nonnull @.str.3, i32 noundef 390, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

30:                                               ; preds = %27
  %31 = call i32 @sc_sock_connect(ptr noundef nonnull %2, ptr noundef nonnull @.str.51, ptr noundef nonnull @.str.41, ptr noundef nonnull @.str.52, ptr noundef nonnull @.str.45) #6
  %.not9 = icmp eq i32 %31, 0
  br i1 %.not9, label %32, label %33

32:                                               ; preds = %30
  call void @__assert_fail(ptr noundef nonnull @.str.53, ptr noundef nonnull @.str.3, i32 noundef 391, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

33:                                               ; preds = %30
  %34 = call i32 @sc_sock_finish_connect(ptr noundef nonnull %2) #6
  %.not10 = icmp eq i32 %34, 0
  br i1 %.not10, label %35, label %36

35:                                               ; preds = %33
  call void @__assert_fail(ptr noundef nonnull @.str.43, ptr noundef nonnull @.str.3, i32 noundef 392, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

36:                                               ; preds = %33
  %37 = call i32 @sc_sock_connect(ptr noundef nonnull %2, ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.41, ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.45) #6
  %.not11 = icmp eq i32 %37, 0
  br i1 %.not11, label %38, label %39

38:                                               ; preds = %36
  call void @__assert_fail(ptr noundef nonnull @.str.55, ptr noundef nonnull @.str.3, i32 noundef 393, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

39:                                               ; preds = %36
  %40 = call i32 @sc_sock_connect(ptr noundef nonnull %2, ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.41, ptr noundef null, ptr noundef nonnull @.str.45) #6
  %.not12 = icmp eq i32 %40, 0
  br i1 %.not12, label %41, label %42

41:                                               ; preds = %39
  call void @__assert_fail(ptr noundef nonnull @.str.56, ptr noundef nonnull @.str.3, i32 noundef 394, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

42:                                               ; preds = %39
  %43 = call i32 @sc_sock_connect(ptr noundef nonnull %2, ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.41, ptr noundef nonnull @.str.57, ptr noundef null) #6
  %.not13 = icmp eq i32 %43, 0
  br i1 %.not13, label %44, label %45

44:                                               ; preds = %42
  call void @__assert_fail(ptr noundef nonnull @.str.58, ptr noundef nonnull @.str.3, i32 noundef 395, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

45:                                               ; preds = %42
  %46 = call i32 @sc_sock_connect(ptr noundef nonnull %2, ptr noundef nonnull @.str.59, ptr noundef nonnull @.str.41, ptr noundef nonnull @.str.60, ptr noundef null) #6
  %.not14 = icmp eq i32 %46, 0
  br i1 %.not14, label %47, label %48

47:                                               ; preds = %45
  call void @__assert_fail(ptr noundef nonnull @.str.61, ptr noundef nonnull @.str.3, i32 noundef 397, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

48:                                               ; preds = %45
  %49 = call i32 @sc_sock_connect(ptr noundef nonnull %2, ptr noundef nonnull @.str.59, ptr noundef nonnull @.str.41, ptr noundef null, ptr noundef nonnull @.str.62) #6
  %.not15 = icmp eq i32 %49, 0
  br i1 %.not15, label %50, label %51

50:                                               ; preds = %48
  call void @__assert_fail(ptr noundef nonnull @.str.63, ptr noundef nonnull @.str.3, i32 noundef 398, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

51:                                               ; preds = %48
  %52 = call i32 @sc_sock_term(ptr noundef nonnull %2) #6
  call void @sc_sock_init(ptr noundef nonnull %2, i32 noundef 0, i1 noundef zeroext false, i32 noundef 2) #6
  %53 = call i32 @sc_sock_listen(ptr noundef nonnull %2, ptr noundef nonnull @.str, ptr noundef nonnull @.str.64) #6
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  call void @__assert_fail(ptr noundef nonnull @.str.65, ptr noundef nonnull @.str.3, i32 noundef 402, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

56:                                               ; preds = %51
  call void @sc_sock_init(ptr noundef nonnull %3, i32 noundef 0, i1 noundef zeroext false, i32 noundef 2) #6
  %57 = call i32 @sc_sock_connect(ptr noundef nonnull %3, ptr noundef nonnull @.str, ptr noundef nonnull @.str.64, ptr noundef null, ptr noundef null) #6
  %.not16 = icmp eq i32 %57, -1
  br i1 %.not16, label %58, label %63

58:                                               ; preds = %56
  %59 = tail call ptr @__errno_location() #8
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp eq i32 %60, 11
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @__assert_fail(ptr noundef nonnull @.str.66, ptr noundef nonnull @.str.3, i32 noundef 406, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

63:                                               ; preds = %56, %58
  %64 = call i32 @sleep(i32 noundef 2) #6
  %65 = call i32 @sc_sock_accept(ptr noundef nonnull %2, ptr noundef nonnull %4) #6
  %.not17 = icmp eq i32 %65, 0
  br i1 %.not17, label %69, label %66

66:                                               ; preds = %63
  %67 = call ptr @sc_sock_error(ptr noundef nonnull %2) #6
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.67, i32 noundef %65, ptr noundef %67)
  br label %69

69:                                               ; preds = %66, %63
  %70 = call i32 @sc_sock_finish_connect(ptr noundef nonnull %3) #6
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %73, label %72

72:                                               ; preds = %69
  call void @__assert_fail(ptr noundef nonnull @.str.68, ptr noundef nonnull @.str.3, i32 noundef 415, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

73:                                               ; preds = %69
  %74 = call i32 @sc_sock_term(ptr noundef nonnull %2) #6
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.3, i32 noundef 416, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

77:                                               ; preds = %73
  %78 = call i32 @sc_sock_term(ptr noundef nonnull %3) #6
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %81, label %80

80:                                               ; preds = %77
  call void @__assert_fail(ptr noundef nonnull @.str.69, ptr noundef nonnull @.str.3, i32 noundef 417, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

81:                                               ; preds = %77
  %82 = call i32 @sc_sock_term(ptr noundef nonnull %4) #6
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %85, label %84

84:                                               ; preds = %81
  call void @__assert_fail(ptr noundef nonnull @.str.70, ptr noundef nonnull @.str.3, i32 noundef 418, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #7
  unreachable

85:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 148, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 148, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 148, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %1) #6
  ret void
}

declare i32 @sc_sock_finish_connect(ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { noreturn 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 = { 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 = { nounwind }
attributes #7 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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