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

; 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
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [62 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@optarg = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@terminate = external hidden global i32, align 4
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.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 i64, align 8
  %8 = alloca %struct.sockaddr_in, align 4
  %9 = alloca %struct.sockaddr_in, align 4
  %10 = alloca i32, align 4
  %11 = alloca [1024 x i8], align 16
  %12 = alloca [22 x i8], align 16
  %13 = alloca i64, align 8
  %14 = 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 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 @__const.main.local, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 1024, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 22, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %15 = load i32, ptr %4, align 4, !tbaa !5
  switch i32 %15, label %53 [
    i32 3, label %16
    i32 2, label %31
  ]

16:                                               ; preds = %2
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = sub nsw i32 %18, 2
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds ptr, ptr %17, i64 %20
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.sockaddr_in, ptr %8, i32 0, i32 2
  %24 = call i32 @ip_addr_pton(ptr noundef %22, ptr noundef %23)
  %25 = icmp eq i32 %24, -1
  br i1 %25, label %26, label %30

26:                                               ; preds = %16
  %27 = load ptr, ptr @stderr, align 8, !tbaa !9
  %28 = load ptr, ptr @optarg, align 8, !tbaa !9
  %29 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %27, i32 noundef 69, ptr noundef @.str, i32 noundef 99, ptr noundef @__func__.main, ptr noundef @.str.1, ptr noundef %28)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %120

30:                                               ; preds = %16
  br label %31

31:                                               ; preds = %30, %2
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = sub nsw i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds ptr, ptr %32, i64 %35
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = call i64 @strtol(ptr noundef %37, ptr noundef null, i32 noundef 10) #6
  store i64 %38, ptr %7, align 8, !tbaa !11
  %39 = load i64, ptr %7, align 8, !tbaa !11
  %40 = icmp slt i64 %39, 0
  br i1 %40, label %44, label %41

41:                                               ; preds = %31
  %42 = load i64, ptr %7, align 8, !tbaa !11
  %43 = icmp sgt i64 %42, 65535
  br i1 %43, label %44, label %48

44:                                               ; preds = %41, %31
  %45 = load ptr, ptr @stderr, align 8, !tbaa !9
  %46 = load ptr, ptr @optarg, align 8, !tbaa !9
  %47 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %45, i32 noundef 69, ptr noundef @.str, i32 noundef 106, ptr noundef @__func__.main, ptr noundef @.str.2, ptr noundef %46)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %120

48:                                               ; preds = %41
  %49 = load i64, ptr %7, align 8, !tbaa !11
  %50 = trunc i64 %49 to i16
  %51 = call zeroext i16 @hton16(i16 noundef zeroext %50)
  %52 = getelementptr inbounds %struct.sockaddr_in, ptr %8, i32 0, i32 1
  store i16 %51, ptr %52, align 2, !tbaa !13
  br label %59

53:                                               ; preds = %2
  %54 = load ptr, ptr @stderr, align 8, !tbaa !9
  %55 = load ptr, ptr %5, align 8, !tbaa !9
  %56 = getelementptr inbounds ptr, ptr %55, i64 0
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str.3, ptr noundef %57) #6
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %120

59:                                               ; preds = %48
  %60 = call i32 @setup()
  %61 = icmp eq i32 %60, -1
  br i1 %61, label %62, label %65

62:                                               ; preds = %59
  %63 = load ptr, ptr @stderr, align 8, !tbaa !9
  %64 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %63, i32 noundef 69, ptr noundef @.str, i32 noundef 119, ptr noundef @__func__.main, ptr noundef @.str.4)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %120

65:                                               ; preds = %59
  %66 = call i32 @sock_open(i32 noundef 2, i32 noundef 2, i32 noundef 0)
  store i32 %66, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = icmp eq i32 %67, -1
  br i1 %68, label %69, label %72

69:                                               ; preds = %65
  %70 = load ptr, ptr @stderr, align 8, !tbaa !9
  %71 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %70, i32 noundef 69, ptr noundef @.str, i32 noundef 127, ptr noundef @__func__.main, ptr noundef @.str.5)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %120

72:                                               ; preds = %65
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = call i32 @sock_bind(i32 noundef %73, ptr noundef %8, i32 noundef 8)
  %75 = icmp eq i32 %74, -1
  br i1 %75, label %76, label %79

76:                                               ; preds = %72
  %77 = load ptr, ptr @stderr, align 8, !tbaa !9
  %78 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %77, i32 noundef 69, ptr noundef @.str, i32 noundef 131, ptr noundef @__func__.main, ptr noundef @.str.6)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %120

79:                                               ; preds = %72
  br label %80

80:                                               ; preds = %116, %94, %79
  %81 = load volatile i32, ptr @terminate, align 4, !tbaa !5
  %82 = icmp ne i32 %81, 0
  %83 = xor i1 %82, true
  br i1 %83, label %84, label %117

84:                                               ; preds = %80
  store i32 4, ptr %10, align 4, !tbaa !5
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %87 = call i64 @sock_recvfrom(i32 noundef %85, ptr noundef %86, i64 noundef 1024, ptr noundef %9, ptr noundef %10)
  store i64 %87, ptr %13, align 8, !tbaa !11
  %88 = load i64, ptr %13, align 8, !tbaa !11
  %89 = icmp eq i64 %88, -1
  br i1 %89, label %90, label %98

90:                                               ; preds = %84
  %91 = call ptr @__errno_location() #7
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp eq i32 %92, 4
  br i1 %93, label %94, label %95

94:                                               ; preds = %90
  br label %80, !llvm.loop !16

95:                                               ; preds = %90
  %96 = load ptr, ptr @stderr, align 8, !tbaa !9
  %97 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %96, i32 noundef 69, ptr noundef @.str, i32 noundef 141, ptr noundef @__func__.main, ptr noundef @.str.7)
  br label %117

98:                                               ; preds = %84
  %99 = load ptr, ptr @stderr, align 8, !tbaa !9
  %100 = load i64, ptr %13, align 8, !tbaa !11
  %101 = getelementptr inbounds [22 x i8], ptr %12, i64 0, i64 0
  %102 = call ptr @sockaddr_ntop(ptr noundef %9, ptr noundef %101, i64 noundef 22)
  %103 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %99, i32 noundef 73, ptr noundef @.str, i32 noundef 144, ptr noundef @__func__.main, ptr noundef @.str.8, i64 noundef %100, ptr noundef %102)
  %104 = load ptr, ptr @stderr, align 8, !tbaa !9
  %105 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %106 = load i64, ptr %13, align 8, !tbaa !11
  call void @hexdump(ptr noundef %104, ptr noundef %105, i64 noundef %106)
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %109 = load i64, ptr %13, align 8, !tbaa !11
  %110 = load i32, ptr %10, align 4, !tbaa !5
  %111 = call i64 @sock_sendto(i32 noundef %107, ptr noundef %108, i64 noundef %109, ptr noundef %9, i32 noundef %110)
  %112 = icmp eq i64 %111, -1
  br i1 %112, label %113, label %116

113:                                              ; preds = %98
  %114 = load ptr, ptr @stderr, align 8, !tbaa !9
  %115 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %114, i32 noundef 69, ptr noundef @.str, i32 noundef 147, ptr noundef @__func__.main, ptr noundef @.str.9)
  br label %117

116:                                              ; preds = %98
  br label %80, !llvm.loop !16

117:                                              ; preds = %113, %95, %80
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = call i32 @udp_close(i32 noundef %118)
  call void @net_shutdown()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %120

120:                                              ; preds = %117, %76, %69, %62, %53, %44, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 22, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %121 = load i32, ptr %3, align 4
  ret i32 %121
}

; 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

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

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

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

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

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

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

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

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

declare i64 @sock_recvfrom(i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

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

declare ptr @sockaddr_ntop(ptr noundef, ptr noundef, i64 noundef) #3

declare void @hexdump(ptr noundef, ptr noundef, i64 noundef) #3

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

declare i32 @udp_close(i32 noundef) #3

declare void @net_shutdown() #3

; 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { 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"}
!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"}


; 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
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [62 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@terminate = external hidden global i32, align 4
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.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 nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.sockaddr_in, align 8
  %4 = alloca %struct.sockaddr_in, align 4
  %5 = alloca i32, align 4
  %6 = alloca [1024 x i8], align 16
  %7 = alloca [22 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %8 = load i64, ptr @__const.main.local, align 4
  store i64 %8, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 22, ptr nonnull %7) #6
  switch i32 %0, label %35 [
    i32 3, label %9
    i32 2, label %19
  ]

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %3, i64 4
  %13 = call i32 @ip_addr_pton(ptr noundef %11, ptr noundef nonnull %12) #6
  %14 = icmp eq i32 %13, -1
  br i1 %14, label %15, label %19

15:                                               ; preds = %9
  %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, i32 noundef 99, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.1, ptr noundef %17) #6
  br label %77

19:                                               ; preds = %9, %2
  %20 = zext nneg i32 %0 to i64
  %21 = getelementptr ptr, ptr %1, i64 %20
  %22 = getelementptr i8, ptr %21, i64 -8
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  %24 = call i64 @strtol(ptr nocapture noundef %23, ptr noundef null, i32 noundef 10) #6
  %or.cond = icmp ugt i64 %24, 65535
  br i1 %or.cond, label %25, label %29

25:                                               ; preds = %19
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = load ptr, ptr @optarg, align 8, !tbaa !5
  %28 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %26, i32 noundef 69, ptr noundef nonnull @.str, i32 noundef 106, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.2, ptr noundef %27) #6
  br label %77

29:                                               ; preds = %19
  %30 = trunc nuw i64 %24 to i16
  %31 = call zeroext i16 @hton16(i16 noundef zeroext %30) #6
  %32 = getelementptr inbounds i8, ptr %3, i64 2
  store i16 %31, ptr %32, align 2, !tbaa !9
  %33 = call i32 @setup()
  %34 = icmp eq i32 %33, -1
  br i1 %34, label %39, label %42

35:                                               ; preds = %2
  %36 = load ptr, ptr @stderr, align 8, !tbaa !5
  %37 = load ptr, ptr %1, align 8, !tbaa !5
  %38 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.3, ptr noundef %37) #7
  br label %77

39:                                               ; preds = %29
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %40, i32 noundef 69, ptr noundef nonnull @.str, i32 noundef 119, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.4) #6
  br label %77

42:                                               ; preds = %29
  %43 = call i32 @sock_open(i32 noundef 2, i32 noundef 2, i32 noundef 0) #6
  %44 = icmp eq i32 %43, -1
  br i1 %44, label %45, label %48

45:                                               ; preds = %42
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %46, i32 noundef 69, ptr noundef nonnull @.str, i32 noundef 127, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.5) #6
  br label %77

48:                                               ; preds = %42
  %49 = call i32 @sock_bind(i32 noundef %43, ptr noundef nonnull %3, i32 noundef 8) #6
  %50 = icmp eq i32 %49, -1
  br i1 %50, label %52, label %.preheader

.preheader:                                       ; preds = %48
  %51 = load volatile i32, ptr @terminate, align 4, !tbaa !13
  %.not23 = icmp eq i32 %51, 0
  br i1 %.not23, label %.lr.ph, label %.loopexit

52:                                               ; preds = %48
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %53, i32 noundef 69, ptr noundef nonnull @.str, i32 noundef 131, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.6) #6
  br label %77

.lr.ph:                                           ; preds = %.preheader, %.backedge
  store i32 4, ptr %5, align 4, !tbaa !13
  %55 = call i64 @sock_recvfrom(i32 noundef %43, ptr noundef nonnull %6, i64 noundef 1024, ptr noundef nonnull %4, ptr noundef nonnull %5) #6
  %56 = icmp eq i64 %55, -1
  br i1 %56, label %57, label %65

57:                                               ; preds = %.lr.ph
  %58 = tail call ptr @__errno_location() #8
  %59 = load i32, ptr %58, align 4, !tbaa !13
  %60 = icmp eq i32 %59, 4
  br i1 %60, label %.backedge, label %62

.backedge:                                        ; preds = %57, %65
  %61 = load volatile i32, ptr @terminate, align 4, !tbaa !13
  %.not = icmp eq i32 %61, 0
  br i1 %.not, label %.lr.ph, label %.loopexit, !llvm.loop !14

62:                                               ; preds = %57
  %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, i32 noundef 141, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.7) #6
  br label %.loopexit

65:                                               ; preds = %.lr.ph
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = call ptr @sockaddr_ntop(ptr noundef nonnull %4, ptr noundef nonnull %7, i64 noundef 22) #6
  %68 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %66, i32 noundef 73, ptr noundef nonnull @.str, i32 noundef 144, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.8, i64 noundef %55, ptr noundef %67) #6
  %69 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @hexdump(ptr noundef %69, ptr noundef nonnull %6, i64 noundef %55) #6
  %70 = load i32, ptr %5, align 4, !tbaa !13
  %71 = call i64 @sock_sendto(i32 noundef %43, ptr noundef nonnull %6, i64 noundef %55, ptr noundef nonnull %4, i32 noundef %70) #6
  %72 = icmp eq i64 %71, -1
  br i1 %72, label %73, label %.backedge

73:                                               ; preds = %65
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = call i32 (ptr, i32, ptr, i32, ptr, ptr, ...) @lprintf(ptr noundef %74, i32 noundef 69, ptr noundef nonnull @.str, i32 noundef 147, ptr noundef nonnull @__func__.main, ptr noundef nonnull @.str.9) #6
  br label %.loopexit

.loopexit:                                        ; preds = %.backedge, %.preheader, %73, %62
  %76 = call i32 @udp_close(i32 noundef %43) #6
  call void @net_shutdown() #6
  br label %77

77:                                               ; preds = %.loopexit, %52, %45, %39, %35, %25, %15
  %.0 = phi i32 [ -1, %35 ], [ -1, %25 ], [ -1, %39 ], [ -1, %45 ], [ -1, %52 ], [ 0, %.loopexit ], [ -1, %15 ]
  call void @llvm.lifetime.end.p0(i64 22, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  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

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

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

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

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

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

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

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

declare i64 @sock_recvfrom(i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare ptr @sockaddr_ntop(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @hexdump(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

declare i32 @udp_close(i32 noundef) local_unnamed_addr #2

declare void @net_shutdown() local_unnamed_addr #2

; 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 = { "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 "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 = { nounwind }
attributes #7 = { cold 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/C++ TBAA"}
!9 = !{!10, !11, i64 2}
!10 = !{!"sockaddr_in", !11, i64 0, !11, i64 2, !12, i64 4}
!11 = !{!"short", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass