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

; 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.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] }

; Function Attrs: nounwind uwtable
define dso_local void @init_ESPNOW_packet(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.ESPNOW_packet, ptr %4, i32 0, i32 0
  %6 = getelementptr inbounds %struct.IEEE80211_radiotap, ptr %5, i32 0, i32 0
  store i8 0, ptr %6, align 1, !tbaa !9
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.ESPNOW_packet, ptr %7, i32 0, i32 0
  %9 = getelementptr inbounds %struct.IEEE80211_radiotap, ptr %8, i32 0, i32 1
  store i8 0, ptr %9, align 1, !tbaa !17
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.ESPNOW_packet, ptr %10, i32 0, i32 0
  %12 = getelementptr inbounds %struct.IEEE80211_radiotap, ptr %11, i32 0, i32 3
  store i32 14, ptr %12, align 1, !tbaa !18
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.ESPNOW_packet, ptr %13, i32 0, i32 0
  %15 = getelementptr inbounds %struct.IEEE80211_radiotap, ptr %14, i32 0, i32 4
  store i8 16, ptr %15, align 1, !tbaa !19
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.ESPNOW_packet, ptr %16, i32 0, i32 0
  %18 = getelementptr inbounds %struct.IEEE80211_radiotap, ptr %17, i32 0, i32 5
  store i8 108, ptr %18, align 1, !tbaa !20
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.ESPNOW_packet, ptr %19, i32 0, i32 0
  %21 = getelementptr inbounds %struct.IEEE80211_radiotap, ptr %20, i32 0, i32 6
  store i16 2412, ptr %21, align 1, !tbaa !21
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ESPNOW_packet, ptr %22, i32 0, i32 0
  %24 = getelementptr inbounds %struct.IEEE80211_radiotap, ptr %23, i32 0, i32 7
  store i16 192, ptr %24, align 1, !tbaa !22
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ESPNOW_packet, ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds %struct.IEEE80211_radiotap, ptr %26, i32 0, i32 2
  store i16 14, ptr %27, align 1, !tbaa !23
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ESPNOW_packet, ptr %28, i32 0, i32 1
  %30 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %29, i32 0, i32 0
  store i8 -48, ptr %30, align 1, !tbaa !24
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ESPNOW_packet, ptr %31, i32 0, i32 1
  %33 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %32, i32 0, i32 1
  store i8 0, ptr %33, align 1, !tbaa !25
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ESPNOW_packet, ptr %34, i32 0, i32 1
  %36 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %35, i32 0, i32 2
  store i16 14849, ptr %36, align 1, !tbaa !26
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ESPNOW_packet, ptr %37, i32 0, i32 1
  %39 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %38, i32 0, i32 6
  store i16 640, ptr %39, align 1, !tbaa !27
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.ESPNOW_packet, ptr %40, i32 0, i32 1
  %42 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %41, i32 0, i32 7
  %43 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %42, i32 0, i32 0
  store i8 127, ptr %43, align 1, !tbaa !28
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ESPNOW_packet, ptr %44, i32 0, i32 1
  %46 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %45, i32 0, i32 7
  %47 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %46, i32 0, i32 1
  %48 = getelementptr inbounds [3 x i8], ptr %47, i64 0, i64 0
  store i8 24, ptr %48, align 1, !tbaa !29
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ESPNOW_packet, ptr %49, i32 0, i32 1
  %51 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %50, i32 0, i32 7
  %52 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %51, i32 0, i32 1
  %53 = getelementptr inbounds [3 x i8], ptr %52, i64 0, i64 1
  store i8 -2, ptr %53, align 1, !tbaa !29
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ESPNOW_packet, ptr %54, i32 0, i32 1
  %56 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %55, i32 0, i32 7
  %57 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %56, i32 0, i32 1
  %58 = getelementptr inbounds [3 x i8], ptr %57, i64 0, i64 2
  store i8 52, ptr %58, align 1, !tbaa !29
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ESPNOW_packet, ptr %59, i32 0, i32 1
  %61 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %60, i32 0, i32 7
  %62 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %61, i32 0, i32 3
  %63 = getelementptr inbounds %struct.IEEE80211_vendorspecific, ptr %62, i32 0, i32 0
  store i8 -35, ptr %63, align 1, !tbaa !30
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ESPNOW_packet, ptr %64, i32 0, i32 1
  %66 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %65, i32 0, i32 7
  %67 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %66, i32 0, i32 3
  %68 = getelementptr inbounds %struct.IEEE80211_vendorspecific, ptr %67, i32 0, i32 1
  store i8 -128, ptr %68, align 1, !tbaa !31
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ESPNOW_packet, ptr %69, i32 0, i32 1
  %71 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %70, i32 0, i32 7
  %72 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %71, i32 0, i32 3
  %73 = getelementptr inbounds %struct.IEEE80211_vendorspecific, ptr %72, i32 0, i32 2
  %74 = getelementptr inbounds [3 x i8], ptr %73, i64 0, i64 0
  store i8 24, ptr %74, align 1, !tbaa !29
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ESPNOW_packet, ptr %75, i32 0, i32 1
  %77 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %76, i32 0, i32 7
  %78 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %77, i32 0, i32 3
  %79 = getelementptr inbounds %struct.IEEE80211_vendorspecific, ptr %78, i32 0, i32 2
  %80 = getelementptr inbounds [3 x i8], ptr %79, i64 0, i64 1
  store i8 -2, ptr %80, align 1, !tbaa !29
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.ESPNOW_packet, ptr %81, i32 0, i32 1
  %83 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %82, i32 0, i32 7
  %84 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %83, i32 0, i32 3
  %85 = getelementptr inbounds %struct.IEEE80211_vendorspecific, ptr %84, i32 0, i32 2
  %86 = getelementptr inbounds [3 x i8], ptr %85, i64 0, i64 2
  store i8 52, ptr %86, align 1, !tbaa !29
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.ESPNOW_packet, ptr %87, i32 0, i32 1
  %89 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %88, i32 0, i32 7
  %90 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %89, i32 0, i32 3
  %91 = getelementptr inbounds %struct.IEEE80211_vendorspecific, ptr %90, i32 0, i32 3
  store i8 4, ptr %91, align 1, !tbaa !32
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.ESPNOW_packet, ptr %92, i32 0, i32 1
  %94 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %93, i32 0, i32 7
  %95 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %94, i32 0, i32 3
  %96 = getelementptr inbounds %struct.IEEE80211_vendorspecific, ptr %95, i32 0, i32 4
  store i8 1, ptr %96, align 1, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  store i32 0, ptr %3, align 4, !tbaa !34
  br label %97

97:                                               ; preds = %110, %1
  %98 = load i32, ptr %3, align 4, !tbaa !34
  %99 = icmp slt i32 %98, 127
  br i1 %99, label %101, label %100

100:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  br label %113

101:                                              ; preds = %97
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.ESPNOW_packet, ptr %102, i32 0, i32 1
  %104 = getelementptr inbounds %struct.IEEE80211_wlan, ptr %103, i32 0, i32 7
  %105 = getelementptr inbounds %struct.IEEE80211_actionframe, ptr %104, i32 0, i32 3
  %106 = getelementptr inbounds %struct.IEEE80211_vendorspecific, ptr %105, i32 0, i32 5
  %107 = load i32, ptr %3, align 4, !tbaa !34
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [127 x i8], ptr %106, i64 0, i64 %108
  store i8 19, ptr %109, align 1, !tbaa !29
  br label %110

110:                                              ; preds = %101
  %111 = load i32, ptr %3, align 4, !tbaa !34
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %3, align 4, !tbaa !34
  br label %97, !llvm.loop !35

113:                                              ; preds = %100
  ret void
}

; 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 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !7, i64 0}
!10 = !{!"", !11, i64 0, !14, i64 14}
!11 = !{!"IEEE80211_radiotap", !7, i64 0, !7, i64 1, !12, i64 2, !13, i64 4, !7, i64 8, !7, i64 9, !12, i64 10, !12, i64 12}
!12 = !{!"short", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"IEEE80211_wlan", !7, i64 0, !7, i64 1, !12, i64 2, !7, i64 4, !7, i64 10, !7, i64 16, !12, i64 22, !15, i64 24, !13, i64 166}
!15 = !{!"IEEE80211_actionframe", !7, i64 0, !7, i64 1, !7, i64 4, !16, i64 8}
!16 = !{!"IEEE80211_vendorspecific", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 5, !7, i64 6, !7, i64 7}
!17 = !{!10, !7, i64 1}
!18 = !{!10, !13, i64 4}
!19 = !{!10, !7, i64 8}
!20 = !{!10, !7, i64 9}
!21 = !{!10, !12, i64 10}
!22 = !{!10, !12, i64 12}
!23 = !{!10, !12, i64 2}
!24 = !{!10, !7, i64 14}
!25 = !{!10, !7, i64 15}
!26 = !{!10, !12, i64 16}
!27 = !{!10, !12, i64 36}
!28 = !{!10, !7, i64 38}
!29 = !{!7, !7, i64 0}
!30 = !{!10, !7, i64 46}
!31 = !{!10, !7, i64 47}
!32 = !{!10, !7, i64 51}
!33 = !{!10, !7, i64 52}
!34 = !{!13, !13, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"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"

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @init_ESPNOW_packet(ptr nocapture noundef writeonly %0) local_unnamed_addr #0 {
  store i8 0, ptr %0, align 1, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 1
  store i8 0, ptr %2, align 1, !tbaa !15
  %3 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 14, ptr %3, align 1, !tbaa !16
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  store i8 16, ptr %4, align 1, !tbaa !17
  %5 = getelementptr inbounds i8, ptr %0, i64 9
  store i8 108, ptr %5, align 1, !tbaa !18
  %6 = getelementptr inbounds i8, ptr %0, i64 10
  store i16 2412, ptr %6, align 1, !tbaa !19
  %7 = getelementptr inbounds i8, ptr %0, i64 12
  store i16 192, ptr %7, align 1, !tbaa !20
  %8 = getelementptr inbounds i8, ptr %0, i64 2
  store i16 14, ptr %8, align 1, !tbaa !21
  %9 = getelementptr inbounds i8, ptr %0, i64 14
  store i8 -48, ptr %9, align 1, !tbaa !22
  %10 = getelementptr inbounds i8, ptr %0, i64 15
  store i8 0, ptr %10, align 1, !tbaa !23
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  store i16 14849, ptr %11, align 1, !tbaa !24
  %12 = getelementptr inbounds i8, ptr %0, i64 36
  store i16 640, ptr %12, align 1, !tbaa !25
  %13 = getelementptr inbounds i8, ptr %0, i64 38
  store <4 x i8> <i8 127, i8 24, i8 -2, i8 52>, ptr %13, align 1, !tbaa !26
  %14 = getelementptr inbounds i8, ptr %0, i64 46
  store <4 x i8> <i8 -35, i8 -128, i8 24, i8 -2>, ptr %14, align 1, !tbaa !26
  %15 = getelementptr inbounds i8, ptr %0, i64 50
  store i8 52, ptr %15, align 1, !tbaa !26
  %16 = getelementptr inbounds i8, ptr %0, i64 51
  store i8 4, ptr %16, align 1, !tbaa !27
  %17 = getelementptr inbounds i8, ptr %0, i64 52
  store i8 1, ptr %17, align 1, !tbaa !28
  %18 = getelementptr inbounds i8, ptr %0, i64 53
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(127) %18, i8 19, i64 127, i1 false), !tbaa !26
  ret void
}

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

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) 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 nounwind willreturn memory(argmem: write) }

!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, !8, i64 0}
!6 = !{!"", !7, i64 0, !12, i64 14}
!7 = !{!"IEEE80211_radiotap", !8, i64 0, !8, i64 1, !10, i64 2, !11, i64 4, !8, i64 8, !8, i64 9, !10, i64 10, !10, i64 12}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"IEEE80211_wlan", !8, i64 0, !8, i64 1, !10, i64 2, !8, i64 4, !8, i64 10, !8, i64 16, !10, i64 22, !13, i64 24, !11, i64 166}
!13 = !{!"IEEE80211_actionframe", !8, i64 0, !8, i64 1, !8, i64 4, !14, i64 8}
!14 = !{!"IEEE80211_vendorspecific", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 5, !8, i64 6, !8, i64 7}
!15 = !{!6, !8, i64 1}
!16 = !{!6, !11, i64 4}
!17 = !{!6, !8, i64 8}
!18 = !{!6, !8, i64 9}
!19 = !{!6, !10, i64 10}
!20 = !{!6, !10, i64 12}
!21 = !{!6, !10, i64 2}
!22 = !{!6, !8, i64 14}
!23 = !{!6, !8, i64 15}
!24 = !{!6, !10, i64 16}
!25 = !{!6, !10, i64 36}
!26 = !{!8, !8, i64 0}
!27 = !{!6, !8, i64 51}
!28 = !{!6, !8, i64 52}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass