; LLVM IR from thomasfla/Linux-ESPNOW :: wifiRawEcho/src (main)

; 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.sock_fprog = type { i16, ptr }
%struct.ESPNOW_packet = type { %struct.IEEE80211_radiotap, %struct.IEEE80211_wlan }
%struct.IEEE80211_radiotap = type <{ i8, i8, i16, i32, i8, i8, i16, i16 }>
%struct.IEEE80211_wlan = type <{ i8, i8, i16, [6 x i8], [6 x i8], [6 x i8], i16, %struct.IEEE80211_actionframe, i32 }>
%struct.IEEE80211_actionframe = type { i8, [3 x i8], [4 x i8], %struct.IEEE80211_vendorspecific }
%struct.IEEE80211_vendorspecific = type { i8, i8, [3 x i8], i8, i8, [127 x i8] }

@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@dest_mac = external hidden global [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [23 x i8], align 1
@__const.main.bpf = external hidden unnamed_addr constant %struct.sock_fprog, align 8
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@stdout = external global ptr, align 8
@echo_packet = external dso_local global %struct.ESPNOW_packet, align 1
@src_mac = external hidden global [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [31 x i8], align 1
@raw_bytes = external dso_local global [400 x i8], align 16
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

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

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

; 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) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca [1000 x i8], align 16
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.sock_fprog, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.ESPNOW_packet, align 8
  %15 = 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
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = icmp eq i32 %16, 2
  br i1 %17, label %18, label %19

18:                                               ; preds = %2
  br label %20

19:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 182, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

20:                                               ; preds = %18
  %21 = call i32 @nice(i32 noundef -20) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 1
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  store ptr %24, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1000, ptr %8) #8
  call void @llvm.memset.p0.i64(ptr align 16 %8, i8 0, i64 1000, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 -1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 -1, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 @__const.main.bpf, i64 16, i1 false)
  %25 = load ptr, ptr %6, align 8, !tbaa !9
  %26 = call i32 @create_raw_socket(ptr noundef %25, ptr noundef %11)
  store i32 %26, ptr %9, align 4, !tbaa !5
  %27 = load i32, ptr %9, align 4, !tbaa !5
  %28 = icmp slt i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %20
  call void @perror(ptr noundef @.str.7)
  br label %70

30:                                               ; preds = %20
  %31 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  br label %32

32:                                               ; preds = %30
  %33 = load ptr, ptr @stdout, align 8, !tbaa !9
  %34 = call i32 @fflush(ptr noundef %33)
  %35 = call i32 @sleep(i32 noundef 1)
  call void @init_ESPNOW_packet(ptr noundef @echo_packet)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 getelementptr inbounds (%struct.IEEE80211_wlan, ptr getelementptr inbounds (%struct.ESPNOW_packet, ptr @echo_packet, i32 0, i32 1), i32 0, i32 3), ptr align 1 @dest_mac, i64 6, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 getelementptr inbounds (%struct.IEEE80211_wlan, ptr getelementptr inbounds (%struct.ESPNOW_packet, ptr @echo_packet, i32 0, i32 1), i32 0, i32 4), ptr align 1 @src_mac, i64 6, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 getelementptr inbounds (%struct.IEEE80211_wlan, ptr getelementptr inbounds (%struct.ESPNOW_packet, ptr @echo_packet, i32 0, i32 1), i32 0, i32 5), ptr align 1 @dest_mac, i64 6, i1 false)
  br label %36

36:                                               ; preds = %69, %32
  br label %37

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = getelementptr inbounds [1000 x i8], ptr %8, i64 0, i64 0
  %40 = call i64 @recvfrom(i32 noundef %38, ptr noundef %39, i64 noundef 1000, i32 noundef 32, ptr noundef null, ptr noundef null)
  %41 = trunc i64 %40 to i32
  store i32 %41, ptr %12, align 4, !tbaa !5
  %42 = load i32, ptr %12, align 4, !tbaa !5
  %43 = icmp slt i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %37
  call void @perror(ptr noundef @.str.9)
  store i32 2, ptr %15, align 4
  br label %67

45:                                               ; preds = %37
  %46 = load i32, ptr %12, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 77
  br i1 %47, label %48, label %65

48:                                               ; preds = %45
  %49 = getelementptr inbounds [1000 x i8], ptr %8, i64 0, i64 0
  %50 = getelementptr inbounds i8, ptr %49, i64 77
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 getelementptr inbounds (%struct.IEEE80211_vendorspecific, ptr getelementptr inbounds (%struct.IEEE80211_actionframe, ptr getelementptr inbounds (%struct.IEEE80211_wlan, ptr getelementptr inbounds (%struct.ESPNOW_packet, ptr @echo_packet, i32 0, i32 1), i32 0, i32 7), i32 0, i32 3), i32 0, i32 5), ptr align 1 %50, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 184, ptr %14) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 1 @echo_packet, i64 184, i1 false), !tbaa.struct !11
  %51 = call i32 @packet_to_bytes(ptr noundef @raw_bytes, i32 noundef 400, ptr noundef byval(%struct.ESPNOW_packet) align 8 %14)
  call void @llvm.lifetime.end.p0(i64 184, ptr %14) #8
  store i32 %51, ptr %13, align 4, !tbaa !5
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = load i32, ptr %13, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = call i64 @sendto(i32 noundef %52, ptr noundef @raw_bytes, i64 noundef %54, i32 noundef 0, ptr noundef null, i32 noundef 0)
  %56 = trunc i64 %55 to i32
  store i32 %56, ptr %10, align 4, !tbaa !5
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = icmp eq i32 -1, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %48
  call void @perror(ptr noundef @.str.10)
  store i32 2, ptr %15, align 4
  br label %62

60:                                               ; preds = %48
  br label %61

61:                                               ; preds = %60
  store i32 0, ptr %15, align 4
  br label %62

62:                                               ; preds = %61, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  %63 = load i32, ptr %15, align 4
  switch i32 %63, label %67 [
    i32 0, label %64
  ]

64:                                               ; preds = %62
  br label %65

65:                                               ; preds = %64, %45
  br label %66

66:                                               ; preds = %65
  store i32 0, ptr %15, align 4
  br label %67

67:                                               ; preds = %66, %62, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %68 = load i32, ptr %15, align 4
  switch i32 %68, label %78 [
    i32 0, label %69
    i32 2, label %70
  ]

69:                                               ; preds = %67
  br label %36

70:                                               ; preds = %67, %29
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %73, label %76

73:                                               ; preds = %70
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = call i32 @close(i32 noundef %74)
  br label %76

76:                                               ; preds = %73, %70
  %77 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %78

78:                                               ; preds = %76, %67
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 1000, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  %79 = load i32, ptr %3, align 4
  ret i32 %79
}

; Function Attrs: nounwind
declare i32 @nice(i32 noundef) #5

declare void @perror(ptr noundef) #6

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

declare i32 @fflush(ptr noundef) #6

declare i32 @sleep(i32 noundef) #6

declare void @init_ESPNOW_packet(ptr noundef) #6

declare i64 @recvfrom(i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) #6

declare i32 @packet_to_bytes(ptr noundef, i32 noundef, ptr noundef byval(%struct.ESPNOW_packet) align 8) #6

declare i64 @sendto(i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, i32 noundef) #6

declare i32 @close(i32 noundef) #6

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: write) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = { "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 = { noreturn nounwind }
attributes #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{i64 0, i64 1, !12, i64 1, i64 1, !12, i64 2, i64 2, !13, i64 4, i64 4, !5, i64 8, i64 1, !12, i64 9, i64 1, !12, i64 10, i64 2, !13, i64 12, i64 2, !13, i64 14, i64 1, !12, i64 15, i64 1, !12, i64 16, i64 2, !13, i64 18, i64 6, !12, i64 24, i64 6, !12, i64 30, i64 6, !12, i64 36, i64 2, !13, i64 38, i64 1, !12, i64 39, i64 3, !12, i64 42, i64 4, !12, i64 46, i64 1, !12, i64 47, i64 1, !12, i64 48, i64 3, !12, i64 51, i64 1, !12, i64 52, i64 1, !12, i64 53, i64 127, !12, i64 180, i64 4, !5}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"short", !7, i64 0}


; 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.sock_fprog = type { i16, ptr }
%struct.ESPNOW_packet = type { %struct.IEEE80211_radiotap, %struct.IEEE80211_wlan }
%struct.IEEE80211_radiotap = type <{ i8, i8, i16, i32, i8, i8, i16, i16 }>
%struct.IEEE80211_wlan = type <{ i8, i8, i16, [6 x i8], [6 x i8], [6 x i8], i16, %struct.IEEE80211_actionframe, i32 }>
%struct.IEEE80211_actionframe = type { i8, [3 x i8], [4 x i8], %struct.IEEE80211_vendorspecific }
%struct.IEEE80211_vendorspecific = type { i8, i8, [3 x i8], i8, i8, [127 x i8] }

@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@dest_mac = external hidden local_unnamed_addr global [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [23 x i8], align 1
@__const.main.bpf = external hidden unnamed_addr constant %struct.sock_fprog, align 8
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@echo_packet = external dso_local global %struct.ESPNOW_packet, align 1
@src_mac = external hidden local_unnamed_addr global [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [31 x i8], align 1
@raw_bytes = external dso_local global [400 x i8], align 16
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @create_raw_socket(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress 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) #4

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [1000 x i8], align 16
  %4 = alloca %struct.sock_fprog, align 8
  %5 = alloca %struct.ESPNOW_packet, align 8
  %6 = icmp eq i32 %0, 2
  br i1 %6, label %8, label %7

7:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 182, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

8:                                                ; preds = %2
  %9 = tail call i32 @nice(i32 noundef -20) #9
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %3) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1000) %3, i8 0, i64 1000, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) @__const.main.bpf, i64 16, i1 false)
  %12 = call i32 @create_raw_socket(ptr noundef %11, ptr noundef nonnull %4)
  %13 = icmp slt i32 %12, 0
  br i1 %13, label %.thread21, label %14

.thread21:                                        ; preds = %8
  call void @perror(ptr noundef nonnull @.str.7) #10
  br label %37

14:                                               ; preds = %8
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %16 = load ptr, ptr @stdout, align 8, !tbaa !5
  %17 = call i32 @fflush(ptr noundef %16)
  %18 = call i32 @sleep(i32 noundef 1) #9
  call void @init_ESPNOW_packet(ptr noundef nonnull @echo_packet) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(6) getelementptr inbounds (i8, ptr @echo_packet, i64 18), ptr noundef nonnull align 1 dereferenceable(6) @dest_mac, i64 6, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(6) getelementptr inbounds (i8, ptr @echo_packet, i64 24), ptr noundef nonnull align 1 dereferenceable(6) @src_mac, i64 6, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(6) getelementptr inbounds (i8, ptr @echo_packet, i64 30), ptr noundef nonnull align 1 dereferenceable(6) @dest_mac, i64 6, i1 false)
  %19 = call i64 @recvfrom(i32 noundef %12, ptr noundef nonnull %3, i64 noundef 1000, i32 noundef 32, ptr noundef null, ptr noundef null) #9
  %20 = trunc i64 %19 to i32
  %21 = icmp slt i32 %20, 0
  br i1 %21, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %14
  %22 = getelementptr inbounds i8, ptr %3, i64 77
  br label %23

23:                                               ; preds = %.lr.ph, %31
  %24 = phi i32 [ %20, %.lr.ph ], [ %33, %31 ]
  %25 = icmp ugt i32 %24, 77
  br i1 %25, label %26, label %31

26:                                               ; preds = %23
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) getelementptr inbounds (i8, ptr @echo_packet, i64 53), ptr noundef nonnull align 1 dereferenceable(16) %22, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 184, ptr nonnull %5) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(184) %5, ptr noundef nonnull align 1 dereferenceable(184) @echo_packet, i64 184, i1 false), !tbaa.struct !9
  %27 = call i32 @packet_to_bytes(ptr noundef nonnull @raw_bytes, i32 noundef 400, ptr noundef nonnull byval(%struct.ESPNOW_packet) align 8 %5) #9
  call void @llvm.lifetime.end.p0(i64 184, ptr nonnull %5) #9
  %28 = sext i32 %27 to i64
  %29 = call i64 @sendto(i32 noundef %12, ptr noundef nonnull @raw_bytes, i64 noundef %28, i32 noundef 0, ptr noundef null, i32 noundef 0) #9
  %30 = and i64 %29, 4294967295
  %.not = icmp eq i64 %30, 4294967295
  br i1 %.not, label %._crit_edge, label %31

31:                                               ; preds = %23, %26
  %32 = call i64 @recvfrom(i32 noundef %12, ptr noundef nonnull %3, i64 noundef 1000, i32 noundef 32, ptr noundef null, ptr noundef null) #9
  %33 = trunc i64 %32 to i32
  %34 = icmp slt i32 %33, 0
  br i1 %34, label %._crit_edge, label %23

._crit_edge:                                      ; preds = %26, %31, %14
  %.str.9.sink = phi ptr [ @.str.9, %14 ], [ @.str.9, %31 ], [ @.str.10, %26 ]
  call void @perror(ptr noundef nonnull %.str.9.sink) #10
  %.not22 = icmp eq i32 %12, 0
  br i1 %.not22, label %37, label %35

35:                                               ; preds = %._crit_edge
  %36 = call i32 @close(i32 noundef %12) #9
  br label %37

37:                                               ; preds = %._crit_edge, %35, %.thread21
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %3) #9
  ret i32 0
}

; Function Attrs: nounwind
declare i32 @nice(i32 noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #6

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

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #6

declare i32 @sleep(i32 noundef) local_unnamed_addr #7

declare void @init_ESPNOW_packet(ptr noundef) local_unnamed_addr #7

declare i64 @recvfrom(i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

declare i32 @packet_to_bytes(ptr noundef, i32 noundef, ptr noundef byval(%struct.ESPNOW_packet) align 8) local_unnamed_addr #7

declare i64 @sendto(i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #7

declare i32 @close(i32 noundef) local_unnamed_addr #7

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { cold }

!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 = !{i64 0, i64 1, !10, i64 1, i64 1, !10, i64 2, i64 2, !11, i64 4, i64 4, !13, i64 8, i64 1, !10, i64 9, i64 1, !10, i64 10, i64 2, !11, i64 12, i64 2, !11, i64 14, i64 1, !10, i64 15, i64 1, !10, i64 16, i64 2, !11, i64 18, i64 6, !10, i64 24, i64 6, !10, i64 30, i64 6, !10, i64 36, i64 2, !11, i64 38, i64 1, !10, i64 39, i64 3, !10, i64 42, i64 4, !10, i64 46, i64 1, !10, i64 47, i64 1, !10, i64 48, i64 3, !10, i64 51, i64 1, !10, i64 52, i64 1, !10, i64 53, i64 127, !10, i64 180, i64 4, !13}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}


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