; LLVM IR from pandax381/microps :: app (udpc)

; 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, i32 }

@__const.main.local = external hidden unnamed_addr constant %struct.sockaddr_in, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@optarg = external global ptr, align 8
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [61 x i8], align 1
@optind = external global i32, align 4
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [20 x i8], align 1
@terminate = external hidden global i32, align 4
@stdin = external global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca %struct.sockaddr_in, align 4
  %10 = alloca %struct.sockaddr_in, align 4
  %11 = alloca [1024 x i8], align 16
  %12 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 @__const.main.local, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 1024, ptr %11) #6
  br label %13

13:                                               ; preds = %53, %2
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = load ptr, ptr %5, align 8, !tbaa !9
  %16 = call i32 @getopt(i32 noundef %14, ptr noundef %15, ptr noundef @.str) #6
  store i32 %16, ptr %6, align 4, !tbaa !5
  %17 = icmp ne i32 %16, -1
  br i1 %17, label %18, label %54

18:                                               ; preds = %13
  %19 = load i32, ptr %6, align 4, !tbaa !5
  switch i32 %19, label %47 [
    i32 115, label %20
    i32 112, label %30
  ]

20:                                               ; preds = %18
  %21 = load ptr, ptr @optarg, align 8, !tbaa !9
  %22 = getelementptr inbounds %struct.sockaddr_in, ptr %9, i32 0, i32 2
  %23 = call i32 @ip_addr_pton(ptr noundef %21, ptr noundef %22)
  %24 = icmp eq i32 %23, -1
  br i1 %24, label %25, label %29

25:                                               ; preds = %20
  %26 = load ptr, ptr @stderr, align 8, !tbaa !9
  %27 = load ptr, ptr @optarg, align 8, !tbaa !9
  %28 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %26, i32 noundef 69, ptr noundef @.str.1, i32 noundef 97, ptr noundef @__func__.main, ptr noundef @.str.2, ptr noundef %27)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %131

29:                                               ; preds = %20
  br label %53

30:                                               ; preds = %18
  %31 = load ptr, ptr @optarg, align 8, !tbaa !9
  %32 = call i64 @strtol(ptr noundef %31, ptr noundef null, i32 noundef 10) #6
  store i64 %32, ptr %8, align 8, !tbaa !11
  %33 = load i64, ptr %8, align 8, !tbaa !11
  %34 = icmp slt i64 %33, 0
  br i1 %34, label %38, label %35

35:                                               ; preds = %30
  %36 = load i64, ptr %8, align 8, !tbaa !11
  %37 = icmp sgt i64 %36, 65535
  br i1 %37, label %38, label %42

38:                                               ; preds = %35, %30
  %39 = load ptr, ptr @stderr, align 8, !tbaa !9
  %40 = load ptr, ptr @optarg, align 8, !tbaa !9
  %41 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %39, i32 noundef 69, ptr noundef @.str.1, i32 noundef 104, ptr noundef @__func__.main, ptr noundef @.str.3, ptr noundef %40)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %131

42:                                               ; preds = %35
  %43 = load i64, ptr %8, align 8, !tbaa !11
  %44 = trunc i64 %43 to i16
  %45 = call zeroext i16 @hton16(i16 noundef zeroext %44)
  %46 = getelementptr inbounds %struct.sockaddr_in, ptr %9, i32 0, i32 1
  store i16 %45, ptr %46, align 2, !tbaa !13
  br label %53

47:                                               ; preds = %18
  %48 = load ptr, ptr @stderr, align 8, !tbaa !9
  %49 = load ptr, ptr %5, align 8, !tbaa !9
  %50 = getelementptr inbounds ptr, ptr %49, i64 0
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str.4, ptr noundef %51) #6
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %131

53:                                               ; preds = %42, %29
  br label %13, !llvm.loop !16

54:                                               ; preds = %13
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = load i32, ptr @optind, align 4, !tbaa !5
  %57 = sub nsw i32 %55, %56
  %58 = icmp ne i32 %57, 1
  br i1 %58, label %59, label %65

59:                                               ; preds = %54
  %60 = load ptr, ptr @stderr, align 8, !tbaa !9
  %61 = load ptr, ptr %5, align 8, !tbaa !9
  %62 = getelementptr inbounds ptr, ptr %61, i64 0
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef @.str.4, ptr noundef %63) #6
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %131

65:                                               ; preds = %54
  %66 = load ptr, ptr %5, align 8, !tbaa !9
  %67 = load i32, ptr @optind, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds ptr, ptr %66, i64 %68
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  %71 = call i32 @sockaddr_pton(ptr noundef %70, ptr noundef %10, i64 noundef 8)
  %72 = icmp eq i32 %71, -1
  br i1 %72, label %73, label %81

73:                                               ; preds = %65
  %74 = load ptr, ptr @stderr, align 8, !tbaa !9
  %75 = load ptr, ptr %5, align 8, !tbaa !9
  %76 = load i32, ptr @optind, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds ptr, ptr %75, i64 %77
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %74, i32 noundef 69, ptr noundef @.str.1, i32 noundef 119, ptr noundef @__func__.main, ptr noundef @.str.5, ptr noundef %79)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %131

81:                                               ; preds = %65
  %82 = call i32 @setup()
  %83 = icmp eq i32 %82, -1
  br i1 %83, label %84, label %87

84:                                               ; preds = %81
  %85 = load ptr, ptr @stderr, align 8, !tbaa !9
  %86 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %85, i32 noundef 69, ptr noundef @.str.1, i32 noundef 126, ptr noundef @__func__.main, ptr noundef @.str.6)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %131

87:                                               ; preds = %81
  %88 = call i32 @sock_open(i32 noundef 2, i32 noundef 2, i32 noundef 0)
  store i32 %88, ptr %7, align 4, !tbaa !5
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = icmp eq i32 %89, -1
  br i1 %90, label %91, label %94

91:                                               ; preds = %87
  %92 = load ptr, ptr @stderr, align 8, !tbaa !9
  %93 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %92, i32 noundef 69, ptr noundef @.str.1, i32 noundef 134, ptr noundef @__func__.main, ptr noundef @.str.7)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %131

94:                                               ; preds = %87
  %95 = getelementptr inbounds %struct.sockaddr_in, ptr %9, i32 0, i32 1
  %96 = load i16, ptr %95, align 2, !tbaa !13
  %97 = icmp ne i16 %96, 0
  br i1 %97, label %98, label %106

98:                                               ; preds = %94
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = call i32 @sock_bind(i32 noundef %99, ptr noundef %9, i32 noundef 8)
  %101 = icmp eq i32 %100, -1
  br i1 %101, label %102, label %105

102:                                              ; preds = %98
  %103 = load ptr, ptr @stderr, align 8, !tbaa !9
  %104 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %103, i32 noundef 69, ptr noundef @.str.1, i32 noundef 139, ptr noundef @__func__.main, ptr noundef @.str.8)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %131

105:                                              ; preds = %98
  br label %106

106:                                              ; preds = %105, %94
  br label %107

107:                                              ; preds = %127, %106
  %108 = load volatile i32, ptr @terminate, align 4, !tbaa !5
  %109 = icmp ne i32 %108, 0
  %110 = xor i1 %109, true
  br i1 %110, label %111, label %128

111:                                              ; preds = %107
  %112 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %113 = load ptr, ptr @stdin, align 8, !tbaa !9
  %114 = call ptr @fgets(ptr noundef %112, i32 noundef 1024, ptr noundef %113)
  %115 = icmp ne ptr %114, null
  br i1 %115, label %117, label %116

116:                                              ; preds = %111
  br label %128

117:                                              ; preds = %111
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %120 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %121 = call i64 @strlen(ptr noundef %120) #7
  %122 = call i64 @sock_sendto(i32 noundef %118, ptr noundef %119, i64 noundef %121, ptr noundef %10, i32 noundef 8)
  %123 = icmp eq i64 %122, -1
  br i1 %123, label %124, label %127

124:                                              ; preds = %117
  %125 = load ptr, ptr @stderr, align 8, !tbaa !9
  %126 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %125, i32 noundef 69, ptr noundef @.str.1, i32 noundef 148, ptr noundef @__func__.main, ptr noundef @.str.9)
  br label %128

127:                                              ; preds = %117
  br label %107, !llvm.loop !18

128:                                              ; preds = %124, %116, %107
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = call i32 @sock_close(i32 noundef %129)
  call void @net_shutdown()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %131

131:                                              ; preds = %128, %102, %91, %84, %73, %59, %47, %38, %25
  call void @llvm.lifetime.end.p0(i64 1024, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %132 = load i32, ptr %3, align 4
  ret i32 %132
}

; 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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

declare i32 @ip_addr_pton(ptr noundef, ptr noundef) #4

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

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

declare zeroext i16 @hton16(i16 noundef zeroext) #4

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

declare i32 @sockaddr_pton(ptr noundef, ptr noundef, i64 noundef) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @setup() #0

declare i32 @sock_open(i32 noundef, i32 noundef, i32 noundef) #4

declare i32 @sock_bind(i32 noundef, ptr noundef, i32 noundef) #4

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #4

declare i64 @sock_sendto(i32 noundef, ptr noundef, i64 noundef, ptr noundef, i32 noundef) #4

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

declare i32 @sock_close(i32 noundef) #4

declare void @net_shutdown() #4

; 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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(read) "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) }

!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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !15, i64 2}
!14 = !{!"sockaddr_in", !15, i64 0, !15, i64 2, !6, i64 4}
!15 = !{!"short", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; 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, i32 }

@__const.main.local = external hidden unnamed_addr constant %struct.sockaddr_in, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [61 x i8], align 1
@optind = external local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [20 x i8], align 1
@terminate = external hidden global i32, align 4
@stdin = external local_unnamed_addr global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.sockaddr_in, align 8
  %4 = alloca %struct.sockaddr_in, align 4
  %5 = alloca [1024 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %6 = load i64, ptr @__const.main.local, align 4
  store i64 %6, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %5) #7
  %7 = getelementptr inbounds i8, ptr %3, i64 2
  %8 = getelementptr inbounds i8, ptr %3, i64 4
  br label %9

9:                                                ; preds = %.backedge, %2
  %10 = call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #7
  switch i32 %10, label %29 [
    i32 -1, label %33
    i32 115, label %11
    i32 112, label %19
  ]

11:                                               ; preds = %9
  %12 = load ptr, ptr @optarg, align 8, !tbaa !5
  %13 = call i32 @ip_addr_pton(ptr noundef %12, ptr noundef nonnull %8) #7
  %14 = icmp eq i32 %13, -1
  br i1 %14, label %15, label %.backedge

.backedge:                                        ; preds = %11, %26
  br label %9, !llvm.loop !9

15:                                               ; preds = %11
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = load ptr, ptr @optarg, align 8, !tbaa !5
  %18 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %16, i32 noundef 69, ptr noundef nonnull @.str.1, i32 noundef 97, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.2, ptr noundef %17) #7
  br label %86

19:                                               ; preds = %9
  %20 = load ptr, ptr @optarg, align 8, !tbaa !5
  %21 = call i64 @strtol(ptr nocapture noundef %20, ptr noundef null, i32 noundef 10) #7
  %or.cond = icmp ugt i64 %21, 65535
  br i1 %or.cond, label %22, label %26

22:                                               ; preds = %19
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = load ptr, ptr @optarg, align 8, !tbaa !5
  %25 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %23, i32 noundef 69, ptr noundef nonnull @.str.1, i32 noundef 104, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.3, ptr noundef %24) #7
  br label %86

26:                                               ; preds = %19
  %27 = trunc nuw i64 %21 to i16
  %28 = call zeroext i16 @hton16(i16 noundef zeroext %27) #7
  store i16 %28, ptr %7, align 2, !tbaa !11
  br label %.backedge

29:                                               ; preds = %9
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = load ptr, ptr %1, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.4, ptr noundef %31) #8
  br label %86

33:                                               ; preds = %9
  %34 = load i32, ptr @optind, align 4, !tbaa !15
  %35 = sub nsw i32 %0, %34
  %.not19 = icmp eq i32 %35, 1
  br i1 %.not19, label %40, label %36

36:                                               ; preds = %33
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = load ptr, ptr %1, align 8, !tbaa !5
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.4, ptr noundef %38) #8
  br label %86

40:                                               ; preds = %33
  %41 = sext i32 %34 to i64
  %42 = getelementptr inbounds ptr, ptr %1, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %44 = call i32 @sockaddr_pton(ptr noundef %43, ptr noundef nonnull %4, i64 noundef 8) #7
  %45 = icmp eq i32 %44, -1
  br i1 %45, label %46, label %53

46:                                               ; preds = %40
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = load i32, ptr @optind, align 4, !tbaa !15
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds ptr, ptr %1, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %47, i32 noundef 69, ptr noundef nonnull @.str.1, i32 noundef 119, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.5, ptr noundef %51) #7
  br label %86

53:                                               ; preds = %40
  %54 = call i32 @setup()
  %55 = icmp eq i32 %54, -1
  br i1 %55, label %56, label %59

56:                                               ; preds = %53
  %57 = load ptr, ptr @stderr, align 8, !tbaa !5
  %58 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %57, i32 noundef 69, ptr noundef nonnull @.str.1, i32 noundef 126, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.6) #7
  br label %86

59:                                               ; preds = %53
  %60 = call i32 @sock_open(i32 noundef 2, i32 noundef 2, i32 noundef 0) #7
  %61 = icmp eq i32 %60, -1
  br i1 %61, label %62, label %65

62:                                               ; preds = %59
  %63 = load ptr, ptr @stderr, align 8, !tbaa !5
  %64 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %63, i32 noundef 69, ptr noundef nonnull @.str.1, i32 noundef 134, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.7) #7
  br label %86

65:                                               ; preds = %59
  %66 = load i16, ptr %7, align 2, !tbaa !11
  %.not20 = icmp eq i16 %66, 0
  br i1 %.not20, label %.preheader, label %67

.preheader:                                       ; preds = %67, %65
  br label %73

67:                                               ; preds = %65
  %68 = call i32 @sock_bind(i32 noundef %60, ptr noundef nonnull %3, i32 noundef 8) #7
  %69 = icmp eq i32 %68, -1
  br i1 %69, label %70, label %.preheader

70:                                               ; preds = %67
  %71 = load ptr, ptr @stderr, align 8, !tbaa !5
  %72 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %71, i32 noundef 69, ptr noundef nonnull @.str.1, i32 noundef 139, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.8) #7
  br label %86

73:                                               ; preds = %.preheader, %78
  %74 = load volatile i32, ptr @terminate, align 4, !tbaa !15
  %.not21 = icmp eq i32 %74, 0
  br i1 %.not21, label %75, label %.loopexit

75:                                               ; preds = %73
  %76 = load ptr, ptr @stdin, align 8, !tbaa !5
  %77 = call ptr @fgets(ptr noundef nonnull %5, i32 noundef 1024, ptr noundef %76)
  %.not22 = icmp eq ptr %77, null
  br i1 %.not22, label %.loopexit, label %78

78:                                               ; preds = %75
  %79 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %5) #9
  %80 = call i64 @sock_sendto(i32 noundef %60, ptr noundef nonnull %5, i64 noundef %79, ptr noundef nonnull %4, i32 noundef 8) #7
  %81 = icmp eq i64 %80, -1
  br i1 %81, label %82, label %73, !llvm.loop !16

82:                                               ; preds = %78
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  %84 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %83, i32 noundef 69, ptr noundef nonnull @.str.1, i32 noundef 148, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.9) #7
  br label %.loopexit

.loopexit:                                        ; preds = %75, %73, %82
  %85 = call i32 @sock_close(i32 noundef %60) #7
  call void @net_shutdown() #7
  br label %86

86:                                               ; preds = %.loopexit, %70, %62, %56, %46, %36, %29, %22, %15
  %.0 = phi i32 [ -1, %29 ], [ -1, %22 ], [ -1, %15 ], [ -1, %36 ], [ -1, %46 ], [ -1, %56 ], [ -1, %62 ], [ -1, %70 ], [ 0, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  ret i32 %.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 @getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @ip_addr_pton(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @lprintf(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4

declare zeroext i16 @hton16(i16 noundef zeroext) local_unnamed_addr #3

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

declare i32 @sockaddr_pton(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @setup() local_unnamed_addr #0

declare i32 @sock_open(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @sock_bind(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #5

declare i64 @sock_sendto(i32 noundef, ptr noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6

declare i32 @sock_close(i32 noundef) local_unnamed_addr #3

declare void @net_shutdown() 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) #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 = { "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 nofree nounwind willreturn "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 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { cold nounwind }
attributes #9 = { nounwind willreturn memory(read) }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !13, i64 2}
!12 = !{!"sockaddr_in", !13, i64 0, !13, i64 2, !14, i64 4}
!13 = !{!"short", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!14, !14, i64 0}
!16 = distinct !{!16, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass