; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/OptionRomPkg/Bus/Usb (Reset)

; 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._EFI_SIMPLE_NETWORK_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct.NIC_DEVICE = type { i64, ptr, ptr, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, i8, ptr, i16, i8, i8, i8, i8, i8, ptr, i64, ptr, ptr, ptr, [2 x i32], ptr }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct._RX_TX_PACKET = type { ptr, i16, i16, [2044 x i8] }

@.str = external hidden unnamed_addr constant [160 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @ReceiveFilterUpdate(ptr noundef) #0

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

declare zeroext i8 @DebugAssertEnabled() #2

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) #2

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

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

declare void @DebugPrint(i64 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @SN_Reset(ptr noundef %0, i8 noundef zeroext %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i8 %1, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = icmp ne ptr null, %11
  br i1 %12, label %13, label %133

13:                                               ; preds = %2
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %14, i32 0, i32 15
  %16 = load ptr, ptr %15, align 8, !tbaa !10
  %17 = icmp ne ptr null, %16
  br i1 %17, label %18, label %133

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %19 = load ptr, ptr @gBS, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %19, i32 0, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  %22 = call i64 %21(i64 noundef 31)
  store i64 %22, ptr %10, align 8, !tbaa !17
  %23 = load ptr, ptr @gBS, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %23, i32 0, i32 2
  %25 = load ptr, ptr %24, align 8, !tbaa !18
  %26 = load i64, ptr %10, align 8, !tbaa !17
  call void %25(i64 noundef %26)
  %27 = load i64, ptr %10, align 8, !tbaa !17
  %28 = icmp ugt i64 %27, 8
  br i1 %28, label %29, label %56

29:                                               ; preds = %18
  br label %30

30:                                               ; preds = %29
  %31 = call zeroext i8 @DebugPrintEnabled()
  %32 = icmp ne i8 %31, 0
  br i1 %32, label %33, label %42

33:                                               ; preds = %30
  br label %34

34:                                               ; preds = %33
  %35 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %36 = icmp ne i8 %35, 0
  br i1 %36, label %37, label %39

37:                                               ; preds = %34
  %38 = load i64, ptr %10, align 8, !tbaa !17
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.2, i64 noundef %38, i32 noundef 8)
  br label %39

39:                                               ; preds = %37, %34
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41, %30
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  %46 = call zeroext i8 @DebugAssertEnabled()
  %47 = icmp ne i8 %46, 0
  br i1 %47, label %48, label %53

48:                                               ; preds = %45
  %49 = load i64, ptr %10, align 8, !tbaa !17
  %50 = icmp ule i64 %49, 8
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  call void @DebugAssert(ptr noundef @.str, i64 noundef 745, ptr noundef @.str.3)
  br label %52

52:                                               ; preds = %51, %48
  br label %53

53:                                               ; preds = %52, %45
  br label %54

54:                                               ; preds = %53
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %57 = load ptr, ptr @gBS, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %57, i32 0, i32 1
  %59 = load ptr, ptr %58, align 8, !tbaa !13
  %60 = call i64 %59(i64 noundef 8)
  store i64 %60, ptr %9, align 8, !tbaa !17
  %61 = call zeroext i8 @DebugAssertEnabled()
  %62 = zext i8 %61 to i32
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %74

64:                                               ; preds = %56
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = ptrtoint ptr %65 to i64
  %67 = sub i64 %66, ptrtoint (ptr getelementptr inbounds (%struct.NIC_DEVICE, ptr null, i32 0, i32 3) to i64)
  %68 = inttoptr i64 %67 to ptr
  %69 = getelementptr inbounds %struct.NIC_DEVICE, ptr %68, i32 0, i32 0
  %70 = load i64, ptr %69, align 8, !tbaa !19
  %71 = icmp ne i64 %70, 943216705
  br i1 %71, label %72, label %74

72:                                               ; preds = %64
  call void @DebugAssert(ptr noundef @.str, i64 noundef 751, ptr noundef @.str.1)
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  br label %79

74:                                               ; preds = %64, %56
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = ptrtoint ptr %75 to i64
  %77 = sub i64 %76, ptrtoint (ptr getelementptr inbounds (%struct.NIC_DEVICE, ptr null, i32 0, i32 3) to i64)
  %78 = inttoptr i64 %77 to ptr
  br label %79

79:                                               ; preds = %74, %72
  %80 = phi ptr [ %73, %72 ], [ %78, %74 ]
  store ptr %80, ptr %6, align 8, !tbaa !5
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.NIC_DEVICE, ptr %81, i32 0, i32 9
  store i8 0, ptr %82, align 1, !tbaa !24
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.NIC_DEVICE, ptr %83, i32 0, i32 11
  store i8 0, ptr %84, align 1, !tbaa !25
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %85, i32 0, i32 15
  %87 = load ptr, ptr %86, align 8, !tbaa !10
  store ptr %87, ptr %5, align 8, !tbaa !5
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %88, i32 0, i32 18
  store i8 0, ptr %89, align 4, !tbaa !26
  br label %90

90:                                               ; preds = %95, %79
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.NIC_DEVICE, ptr %91, i32 0, i32 15
  %93 = load ptr, ptr %92, align 8, !tbaa !27
  %94 = icmp ne ptr null, %93
  br i1 %94, label %95, label %112

95:                                               ; preds = %90
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.NIC_DEVICE, ptr %96, i32 0, i32 15
  %98 = load ptr, ptr %97, align 8, !tbaa !27
  store ptr %98, ptr %7, align 8, !tbaa !5
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %100, align 1, !tbaa !28
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.NIC_DEVICE, ptr %102, i32 0, i32 15
  store ptr %101, ptr %103, align 8, !tbaa !27
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.NIC_DEVICE, ptr %104, i32 0, i32 17
  %106 = load ptr, ptr %105, align 8, !tbaa !30
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %107, i32 0, i32 0
  store ptr %106, ptr %108, align 1, !tbaa !28
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.NIC_DEVICE, ptr %110, i32 0, i32 17
  store ptr %109, ptr %111, align 8, !tbaa !30
  br label %90, !llvm.loop !31

112:                                              ; preds = %90
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.NIC_DEVICE, ptr %113, i32 0, i32 16
  store ptr null, ptr %114, align 8, !tbaa !33
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = call i64 @Ax88772Reset(ptr noundef %115)
  store i64 %116, ptr %8, align 8, !tbaa !17
  %117 = load i64, ptr %8, align 8, !tbaa !17
  %118 = icmp slt i64 %117, 0
  br i1 %118, label %128, label %119

119:                                              ; preds = %112
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = call i64 @ReceiveFilterUpdate(ptr noundef %120)
  store i64 %121, ptr %8, align 8, !tbaa !17
  %122 = load i64, ptr %8, align 8, !tbaa !17
  %123 = icmp slt i64 %122, 0
  br i1 %123, label %127, label %124

124:                                              ; preds = %119
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = call i64 @Ax88772NegotiateLinkStart(ptr noundef %125)
  store i64 %126, ptr %8, align 8, !tbaa !17
  br label %127

127:                                              ; preds = %124, %119
  br label %128

128:                                              ; preds = %127, %112
  %129 = load ptr, ptr @gBS, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %130, align 8, !tbaa !18
  %132 = load i64, ptr %9, align 8, !tbaa !17
  call void %131(i64 noundef %132)
  br label %134

133:                                              ; preds = %13, %2
  store i64 -9223372036854775806, ptr %8, align 8, !tbaa !17
  br label %134

134:                                              ; preds = %133, %128
  %135 = load i64, ptr %8, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret i64 %135
}

declare i64 @Ax88772Reset(ptr noundef) #2

declare i64 @Ax88772NegotiateLinkStart(ptr noundef) #2

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 = { "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 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 120}
!11 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !6, i64 24}
!14 = !{!"", !15, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!15 = !{!"", !12, i64 0, !16, i64 8, !16, i64 12, !16, i64 16, !16, i64 20}
!16 = !{!"int", !7, i64 0}
!17 = !{!12, !12, i64 0}
!18 = !{!14, !6, i64 32}
!19 = !{!20, !12, i64 0}
!20 = !{!"", !12, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !21, i64 152, !7, i64 808, !6, i64 816, !23, i64 824, !7, i64 826, !7, i64 827, !7, i64 828, !7, i64 829, !7, i64 830, !6, i64 832, !12, i64 840, !6, i64 848, !6, i64 856, !6, i64 864, !7, i64 872, !6, i64 880}
!21 = !{!"", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !16, i64 16, !16, i64 20, !16, i64 24, !16, i64 28, !16, i64 32, !16, i64 36, !7, i64 40, !22, i64 552, !22, i64 584, !22, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!22 = !{!"", !7, i64 0}
!23 = !{!"short", !7, i64 0}
!24 = !{!20, !7, i64 827}
!25 = !{!20, !7, i64 829}
!26 = !{!21, !7, i64 652}
!27 = !{!20, !6, i64 848}
!28 = !{!29, !6, i64 0}
!29 = !{!"_RX_TX_PACKET", !6, i64 0, !23, i64 8, !23, i64 10, !7, i64 12}
!30 = !{!20, !6, i64 864}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!20, !6, i64 856}


; 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"

@.str = external hidden unnamed_addr constant [160 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @ReceiveFilterUpdate(ptr noundef) local_unnamed_addr #0

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) local_unnamed_addr #1

declare void @DebugPrint(i64 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @SN_Reset(ptr noundef %0, i8 noundef zeroext %1) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %57, label %3

3:                                                ; preds = %2
  %4 = getelementptr inbounds i8, ptr %0, i64 120
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not34 = icmp eq ptr %5, null
  br i1 %.not34, label %57, label %6

6:                                                ; preds = %3
  %7 = load ptr, ptr @gBS, align 8, !tbaa !11
  %8 = getelementptr inbounds i8, ptr %7, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  %10 = tail call i64 %9(i64 noundef 31) #2
  %11 = load ptr, ptr @gBS, align 8, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %11, i64 32
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  tail call void %13(i64 noundef %10) #2
  %14 = icmp ugt i64 %10, 8
  br i1 %14, label %15, label %24

15:                                               ; preds = %6
  %16 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not35 = icmp eq i8 %16, 0
  br i1 %.not35, label %20, label %17

17:                                               ; preds = %15
  %18 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #2
  %.not36 = icmp eq i8 %18, 0
  br i1 %.not36, label %20, label %19

19:                                               ; preds = %17
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.2, i64 noundef %10, i32 noundef 8) #2
  br label %20

20:                                               ; preds = %15, %19, %17
  %21 = tail call zeroext i8 @DebugAssertEnabled() #2
  %22 = icmp eq i8 %21, 0
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 745, ptr noundef nonnull @.str.3) #2
  br label %24

24:                                               ; preds = %20, %23, %6
  %25 = load ptr, ptr @gBS, align 8, !tbaa !11
  %26 = getelementptr inbounds i8, ptr %25, i64 24
  %27 = load ptr, ptr %26, align 8, !tbaa !12
  %28 = tail call i64 %27(i64 noundef 8) #2
  %29 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not37 = icmp eq i8 %29, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre45 = add i64 %.pre, -24
  %.pre47 = inttoptr i64 %.pre45 to ptr
  br i1 %.not37, label %._crit_edge44, label %30

30:                                               ; preds = %24
  %31 = load i64, ptr %.pre47, align 8, !tbaa !17
  %.not38 = icmp eq i64 %31, 943216705
  br i1 %.not38, label %._crit_edge44, label %32

32:                                               ; preds = %30
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 751, ptr noundef nonnull @.str.1) #2
  br label %._crit_edge44

._crit_edge44:                                    ; preds = %24, %30, %32
  %33 = phi ptr [ %0, %32 ], [ %.pre47, %30 ], [ %.pre47, %24 ]
  %34 = getelementptr inbounds i8, ptr %33, i64 827
  store i8 0, ptr %34, align 1, !tbaa !22
  %35 = getelementptr inbounds i8, ptr %33, i64 829
  store i8 0, ptr %35, align 1, !tbaa !23
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %36, i64 652
  store i8 0, ptr %37, align 4, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %33, i64 848
  %.promoted = load ptr, ptr %38, align 8, !tbaa !25
  %.not3940 = icmp eq ptr %.promoted, null
  br i1 %.not3940, label %44, label %.lr.ph

.lr.ph:                                           ; preds = %._crit_edge44
  %39 = getelementptr inbounds i8, ptr %33, i64 864
  %.promoted41 = load ptr, ptr %39, align 8, !tbaa !26
  br label %40

40:                                               ; preds = %.lr.ph, %40
  %41 = phi ptr [ %.promoted41, %.lr.ph ], [ %42, %40 ]
  %42 = phi ptr [ %.promoted, %.lr.ph ], [ %43, %40 ]
  %43 = load ptr, ptr %42, align 1, !tbaa !27
  store ptr %41, ptr %42, align 1, !tbaa !27
  %.not39 = icmp eq ptr %43, null
  br i1 %.not39, label %._crit_edge, label %40, !llvm.loop !29

._crit_edge:                                      ; preds = %40
  store ptr null, ptr %38, align 8, !tbaa !25
  store ptr %42, ptr %39, align 8, !tbaa !26
  br label %44

44:                                               ; preds = %._crit_edge, %._crit_edge44
  %45 = getelementptr inbounds i8, ptr %33, i64 856
  store ptr null, ptr %45, align 8, !tbaa !31
  %46 = tail call i64 @Ax88772Reset(ptr noundef nonnull %33) #2
  %47 = icmp slt i64 %46, 0
  br i1 %47, label %53, label %48

48:                                               ; preds = %44
  %49 = tail call i64 @ReceiveFilterUpdate(ptr noundef nonnull %0)
  %50 = icmp slt i64 %49, 0
  br i1 %50, label %53, label %51

51:                                               ; preds = %48
  %52 = tail call i64 @Ax88772NegotiateLinkStart(ptr noundef nonnull %33) #2
  br label %53

53:                                               ; preds = %48, %51, %44
  %.0 = phi i64 [ %46, %44 ], [ %49, %48 ], [ %52, %51 ]
  %54 = load ptr, ptr @gBS, align 8, !tbaa !11
  %55 = getelementptr inbounds i8, ptr %54, i64 32
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  tail call void %56(i64 noundef %28) #2
  br label %57

57:                                               ; preds = %2, %3, %53
  %.1 = phi i64 [ %.0, %53 ], [ -9223372036854775806, %3 ], [ -9223372036854775806, %2 ]
  ret i64 %.1
}

declare i64 @Ax88772Reset(ptr noundef) local_unnamed_addr #1

declare i64 @Ax88772NegotiateLinkStart(ptr noundef) local_unnamed_addr #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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, !10, i64 120}
!6 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !10, i64 24}
!13 = !{!"", !14, i64 0, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368}
!14 = !{!"", !7, i64 0, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!15 = !{!"int", !8, i64 0}
!16 = !{!13, !10, i64 32}
!17 = !{!18, !7, i64 0}
!18 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !19, i64 152, !8, i64 808, !10, i64 816, !21, i64 824, !8, i64 826, !8, i64 827, !8, i64 828, !8, i64 829, !8, i64 830, !10, i64 832, !7, i64 840, !10, i64 848, !10, i64 856, !10, i64 864, !8, i64 872, !10, i64 880}
!19 = !{!"", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !8, i64 40, !20, i64 552, !20, i64 584, !20, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!20 = !{!"", !8, i64 0}
!21 = !{!"short", !8, i64 0}
!22 = !{!18, !8, i64 827}
!23 = !{!18, !8, i64 829}
!24 = !{!19, !8, i64 652}
!25 = !{!18, !10, i64 848}
!26 = !{!18, !10, i64 864}
!27 = !{!28, !10, i64 0}
!28 = !{!"_RX_TX_PACKET", !10, i64 0, !21, i64 8, !21, i64 10, !8, i64 12}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!18, !10, i64 856}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass