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

; 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.USB_DEVICE_REQUEST = type { i8, i8, i16, i16, i16 }
%struct.USB_DEVICE_DESCRIPTOR = type { i8, i8, i16, i8, i8, i8, i8, i16, i16, i16, i8, i8, i8, i8 }
%struct.NIC_DEVICE = type { i64, ptr, ptr, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, i8, ptr, i16, i8, i8, i8, i8, i64, i64, i16, ptr, ptr, [8 x i8], %struct.EFI_MAC_ADDRESS, i8, ptr, ptr, ptr, ptr, ptr, i64, ptr }
%struct._EFI_SIMPLE_NETWORK_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, 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._EFI_USB_IO_PROTOCOL = type { 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 }

@gBS = external global ptr, align 8

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ax88772UsbCommand(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Ax88772Reset(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.USB_DEVICE_REQUEST, align 1
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.USB_DEVICE_DESCRIPTOR, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 18, ptr %6) #2
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.NIC_DEVICE, ptr %7, i32 0, i32 2
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %9, ptr %5, align 8, !tbaa !5
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct._EFI_USB_IO_PROTOCOL, ptr %10, i32 0, i32 6
  %12 = load ptr, ptr %11, align 8, !tbaa !17
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = call i64 %12(ptr noundef %13, ptr noundef %6)
  store i64 %14, ptr %4, align 8, !tbaa !19
  %15 = load i64, ptr %4, align 8, !tbaa !19
  %16 = icmp slt i64 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %1
  br label %133

18:                                               ; preds = %1
  %19 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 0
  store i8 64, ptr %19, align 1, !tbaa !20
  %20 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 1
  store i8 10, ptr %20, align 1, !tbaa !22
  %21 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 2
  store i16 0, ptr %21, align 1, !tbaa !23
  %22 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 3
  store i16 0, ptr %22, align 1, !tbaa !24
  %23 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 4
  store i16 0, ptr %23, align 1, !tbaa !25
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = call i64 @Ax88772UsbCommand(ptr noundef %24, ptr noundef %3, ptr noundef null)
  store i64 %25, ptr %4, align 8, !tbaa !19
  %26 = load i64, ptr %4, align 8, !tbaa !19
  %27 = icmp slt i64 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %18
  br label %133

29:                                               ; preds = %18
  %30 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 0
  store i8 64, ptr %30, align 1, !tbaa !20
  %31 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 1
  store i8 34, ptr %31, align 1, !tbaa !22
  %32 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 2
  store i16 1, ptr %32, align 1, !tbaa !23
  %33 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 3
  store i16 0, ptr %33, align 1, !tbaa !24
  %34 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 4
  store i16 0, ptr %34, align 1, !tbaa !25
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = call i64 @Ax88772UsbCommand(ptr noundef %35, ptr noundef %3, ptr noundef null)
  store i64 %36, ptr %4, align 8, !tbaa !19
  %37 = load i64, ptr %4, align 8, !tbaa !19
  %38 = icmp slt i64 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %29
  br label %133

40:                                               ; preds = %29
  %41 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 0
  store i8 64, ptr %41, align 1, !tbaa !20
  %42 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 1
  store i8 32, ptr %42, align 1, !tbaa !22
  %43 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 2
  store i16 32, ptr %43, align 1, !tbaa !23
  %44 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 3
  store i16 0, ptr %44, align 1, !tbaa !24
  %45 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 4
  store i16 0, ptr %45, align 1, !tbaa !25
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = call i64 @Ax88772UsbCommand(ptr noundef %46, ptr noundef %3, ptr noundef null)
  store i64 %47, ptr %4, align 8, !tbaa !19
  %48 = load i64, ptr %4, align 8, !tbaa !19
  %49 = icmp slt i64 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %40
  br label %133

51:                                               ; preds = %40
  %52 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 0
  store i8 64, ptr %52, align 1, !tbaa !20
  %53 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 1
  store i8 32, ptr %53, align 1, !tbaa !22
  %54 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 2
  store i16 96, ptr %54, align 1, !tbaa !23
  %55 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 3
  store i16 0, ptr %55, align 1, !tbaa !24
  %56 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 4
  store i16 0, ptr %56, align 1, !tbaa !25
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = call i64 @Ax88772UsbCommand(ptr noundef %57, ptr noundef %3, ptr noundef null)
  store i64 %58, ptr %4, align 8, !tbaa !19
  %59 = load ptr, ptr @gBS, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %59, i32 0, i32 29
  %61 = load ptr, ptr %60, align 8, !tbaa !26
  %62 = call i64 %61(i64 noundef 200000)
  %63 = load i64, ptr %4, align 8, !tbaa !19
  %64 = icmp slt i64 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %51
  br label %133

66:                                               ; preds = %51
  %67 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 0
  store i8 64, ptr %67, align 1, !tbaa !20
  %68 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 1
  store i8 32, ptr %68, align 1, !tbaa !22
  %69 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 2
  store i16 32, ptr %69, align 1, !tbaa !23
  %70 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 3
  store i16 0, ptr %70, align 1, !tbaa !24
  %71 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 4
  store i16 0, ptr %71, align 1, !tbaa !25
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = call i64 @Ax88772UsbCommand(ptr noundef %72, ptr noundef %3, ptr noundef null)
  store i64 %73, ptr %4, align 8, !tbaa !19
  %74 = load ptr, ptr @gBS, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %74, i32 0, i32 29
  %76 = load ptr, ptr %75, align 8, !tbaa !26
  %77 = call i64 %76(i64 noundef 200000)
  %78 = load i64, ptr %4, align 8, !tbaa !19
  %79 = icmp slt i64 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %66
  br label %133

81:                                               ; preds = %66
  %82 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 0
  store i8 64, ptr %82, align 1, !tbaa !20
  %83 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 1
  store i8 32, ptr %83, align 1, !tbaa !22
  %84 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 2
  store i16 0, ptr %84, align 1, !tbaa !23
  %85 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 3
  store i16 0, ptr %85, align 1, !tbaa !24
  %86 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 4
  store i16 0, ptr %86, align 1, !tbaa !25
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = call i64 @Ax88772UsbCommand(ptr noundef %87, ptr noundef %3, ptr noundef null)
  store i64 %88, ptr %4, align 8, !tbaa !19
  %89 = load i64, ptr %4, align 8, !tbaa !19
  %90 = icmp slt i64 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %81
  br label %133

92:                                               ; preds = %81
  %93 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 0
  store i8 64, ptr %93, align 1, !tbaa !20
  %94 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 1
  store i8 34, ptr %94, align 1, !tbaa !22
  %95 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 2
  store i16 1, ptr %95, align 1, !tbaa !23
  %96 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 3
  store i16 0, ptr %96, align 1, !tbaa !24
  %97 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 4
  store i16 0, ptr %97, align 1, !tbaa !25
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = call i64 @Ax88772UsbCommand(ptr noundef %98, ptr noundef %3, ptr noundef null)
  store i64 %99, ptr %4, align 8, !tbaa !19
  %100 = load i64, ptr %4, align 8, !tbaa !19
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %92
  br label %133

103:                                              ; preds = %92
  %104 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 0
  store i8 64, ptr %104, align 1, !tbaa !20
  %105 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 1
  store i8 32, ptr %105, align 1, !tbaa !22
  %106 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 2
  store i16 52, ptr %106, align 1, !tbaa !23
  %107 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 3
  store i16 0, ptr %107, align 1, !tbaa !24
  %108 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 4
  store i16 0, ptr %108, align 1, !tbaa !25
  %109 = load ptr, ptr %2, align 8, !tbaa !5
  %110 = call i64 @Ax88772UsbCommand(ptr noundef %109, ptr noundef %3, ptr noundef null)
  store i64 %110, ptr %4, align 8, !tbaa !19
  %111 = load i64, ptr %4, align 8, !tbaa !19
  %112 = icmp slt i64 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %103
  br label %133

114:                                              ; preds = %103
  %115 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 0
  store i8 64, ptr %115, align 1, !tbaa !20
  %116 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 1
  store i8 16, ptr %116, align 1, !tbaa !22
  %117 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 2
  store i16 0, ptr %117, align 1, !tbaa !23
  %118 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 3
  store i16 0, ptr %118, align 1, !tbaa !24
  %119 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 4
  store i16 0, ptr %119, align 1, !tbaa !25
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  %121 = call i64 @Ax88772UsbCommand(ptr noundef %120, ptr noundef %3, ptr noundef null)
  store i64 %121, ptr %4, align 8, !tbaa !19
  %122 = load i64, ptr %4, align 8, !tbaa !19
  %123 = icmp slt i64 %122, 0
  br i1 %123, label %124, label %125

124:                                              ; preds = %114
  br label %133

125:                                              ; preds = %114
  %126 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 0
  store i8 64, ptr %126, align 1, !tbaa !20
  %127 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 1
  store i8 42, ptr %127, align 1, !tbaa !22
  %128 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 2
  store i16 -32768, ptr %128, align 1, !tbaa !23
  %129 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 3
  store i16 -32767, ptr %129, align 1, !tbaa !24
  %130 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %3, i32 0, i32 4
  store i16 0, ptr %130, align 1, !tbaa !25
  %131 = load ptr, ptr %2, align 8, !tbaa !5
  %132 = call i64 @Ax88772UsbCommand(ptr noundef %131, ptr noundef %3, ptr noundef null)
  store i64 %132, ptr %4, align 8, !tbaa !19
  br label %133

133:                                              ; preds = %125, %124, %113, %102, %91, %80, %65, %50, %39, %28, %17
  %134 = load i64, ptr %4, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 18, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  ret i64 %134
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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, !6, i64 16}
!10 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !12, i64 152, !13, i64 280, !7, i64 936, !6, i64 944, !16, i64 952, !7, i64 954, !7, i64 955, !7, i64 956, !7, i64 957, !11, i64 960, !11, i64 968, !16, i64 976, !6, i64 984, !6, i64 992, !7, i64 1000, !15, i64 1008, !7, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !11, i64 1088, !6, i64 1096}
!11 = !{!"long long", !7, i64 0}
!12 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !11, 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}
!13 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !7, i64 40, !15, i64 552, !15, i64 584, !15, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!14 = !{!"int", !7, i64 0}
!15 = !{!"", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!18, !6, i64 48}
!18 = !{!"_EFI_USB_IO_PROTOCOL", !6, 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}
!19 = !{!11, !11, i64 0}
!20 = !{!21, !7, i64 0}
!21 = !{!"", !7, i64 0, !7, i64 1, !16, i64 2, !16, i64 4, !16, i64 6}
!22 = !{!21, !7, i64 1}
!23 = !{!21, !16, i64 2}
!24 = !{!21, !16, i64 4}
!25 = !{!21, !16, i64 6}
!26 = !{!27, !6, i64 248}
!27 = !{!"", !28, 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}
!28 = !{!"", !11, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}


; 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.USB_DEVICE_REQUEST = type { i8, i8, i16, i16, i16 }
%struct.USB_DEVICE_DESCRIPTOR = type { i8, i8, i16, i8, i8, i8, i8, i16, i16, i16, i8, i8, i8, i8 }

@gBS = external local_unnamed_addr global ptr, align 8

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ax88772UsbCommand(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Ax88772Reset(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca %struct.USB_DEVICE_REQUEST, align 1
  %3 = alloca %struct.USB_DEVICE_DESCRIPTOR, align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #2
  call void @llvm.lifetime.start.p0(i64 18, ptr nonnull %3) #2
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 48
  %7 = load ptr, ptr %6, align 8, !tbaa !16
  %8 = call i64 %7(ptr noundef %5, ptr noundef nonnull %3) #2
  %9 = icmp slt i64 %8, 0
  br i1 %9, label %51, label %10

10:                                               ; preds = %1
  store i8 64, ptr %2, align 1, !tbaa !18
  %11 = getelementptr inbounds i8, ptr %2, i64 1
  store i8 10, ptr %11, align 1, !tbaa !20
  %12 = getelementptr inbounds i8, ptr %2, i64 2
  store i16 0, ptr %12, align 1, !tbaa !21
  %13 = getelementptr inbounds i8, ptr %2, i64 4
  store i16 0, ptr %13, align 1, !tbaa !22
  %14 = getelementptr inbounds i8, ptr %2, i64 6
  store i16 0, ptr %14, align 1, !tbaa !23
  %15 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %2, ptr noundef null)
  %16 = icmp slt i64 %15, 0
  br i1 %16, label %51, label %17

17:                                               ; preds = %10
  store i8 64, ptr %2, align 1, !tbaa !18
  store i8 34, ptr %11, align 1, !tbaa !20
  store i16 1, ptr %12, align 1, !tbaa !21
  store i16 0, ptr %13, align 1, !tbaa !22
  store i16 0, ptr %14, align 1, !tbaa !23
  %18 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %2, ptr noundef null)
  %19 = icmp slt i64 %18, 0
  br i1 %19, label %51, label %20

20:                                               ; preds = %17
  store i8 64, ptr %2, align 1, !tbaa !18
  store i8 32, ptr %11, align 1, !tbaa !20
  store i16 32, ptr %12, align 1, !tbaa !21
  store i16 0, ptr %13, align 1, !tbaa !22
  store i16 0, ptr %14, align 1, !tbaa !23
  %21 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %2, ptr noundef null)
  %22 = icmp slt i64 %21, 0
  br i1 %22, label %51, label %23

23:                                               ; preds = %20
  store i8 64, ptr %2, align 1, !tbaa !18
  store i8 32, ptr %11, align 1, !tbaa !20
  store i16 96, ptr %12, align 1, !tbaa !21
  store i16 0, ptr %13, align 1, !tbaa !22
  store i16 0, ptr %14, align 1, !tbaa !23
  %24 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %2, ptr noundef null)
  %25 = load ptr, ptr @gBS, align 8, !tbaa !24
  %26 = getelementptr inbounds i8, ptr %25, i64 248
  %27 = load ptr, ptr %26, align 8, !tbaa !25
  %28 = call i64 %27(i64 noundef 200000) #2
  %29 = icmp slt i64 %24, 0
  br i1 %29, label %51, label %30

30:                                               ; preds = %23
  store i8 64, ptr %2, align 1, !tbaa !18
  store i8 32, ptr %11, align 1, !tbaa !20
  store i16 32, ptr %12, align 1, !tbaa !21
  store i16 0, ptr %13, align 1, !tbaa !22
  store i16 0, ptr %14, align 1, !tbaa !23
  %31 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %2, ptr noundef null)
  %32 = load ptr, ptr @gBS, align 8, !tbaa !24
  %33 = getelementptr inbounds i8, ptr %32, i64 248
  %34 = load ptr, ptr %33, align 8, !tbaa !25
  %35 = call i64 %34(i64 noundef 200000) #2
  %36 = icmp slt i64 %31, 0
  br i1 %36, label %51, label %37

37:                                               ; preds = %30
  store i8 64, ptr %2, align 1, !tbaa !18
  store i8 32, ptr %11, align 1, !tbaa !20
  store i16 0, ptr %12, align 1, !tbaa !21
  store i16 0, ptr %13, align 1, !tbaa !22
  store i16 0, ptr %14, align 1, !tbaa !23
  %38 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %2, ptr noundef null)
  %39 = icmp slt i64 %38, 0
  br i1 %39, label %51, label %40

40:                                               ; preds = %37
  store i8 64, ptr %2, align 1, !tbaa !18
  store i8 34, ptr %11, align 1, !tbaa !20
  store i16 1, ptr %12, align 1, !tbaa !21
  store i16 0, ptr %13, align 1, !tbaa !22
  store i16 0, ptr %14, align 1, !tbaa !23
  %41 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %2, ptr noundef null)
  %42 = icmp slt i64 %41, 0
  br i1 %42, label %51, label %43

43:                                               ; preds = %40
  store i8 64, ptr %2, align 1, !tbaa !18
  store i8 32, ptr %11, align 1, !tbaa !20
  store i16 52, ptr %12, align 1, !tbaa !21
  store i16 0, ptr %13, align 1, !tbaa !22
  store i16 0, ptr %14, align 1, !tbaa !23
  %44 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %2, ptr noundef null)
  %45 = icmp slt i64 %44, 0
  br i1 %45, label %51, label %46

46:                                               ; preds = %43
  store i8 64, ptr %2, align 1, !tbaa !18
  store i8 16, ptr %11, align 1, !tbaa !20
  store i16 0, ptr %12, align 1, !tbaa !21
  store i16 0, ptr %13, align 1, !tbaa !22
  store i16 0, ptr %14, align 1, !tbaa !23
  %47 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %2, ptr noundef null)
  %48 = icmp slt i64 %47, 0
  br i1 %48, label %51, label %49

49:                                               ; preds = %46
  store i8 64, ptr %2, align 1, !tbaa !18
  store i8 42, ptr %11, align 1, !tbaa !20
  store i16 -32768, ptr %12, align 1, !tbaa !21
  store i16 -32767, ptr %13, align 1, !tbaa !22
  store i16 0, ptr %14, align 1, !tbaa !23
  %50 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %2, ptr noundef null)
  br label %51

51:                                               ; preds = %46, %43, %40, %37, %30, %23, %20, %17, %10, %1, %49
  %.0 = phi i64 [ %8, %1 ], [ %15, %10 ], [ %18, %17 ], [ %21, %20 ], [ %24, %23 ], [ %31, %30 ], [ %38, %37 ], [ %41, %40 ], [ %44, %43 ], [ %47, %46 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 18, ptr nonnull %3) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #2
  ret i64 %.0
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 16}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !11, i64 152, !12, i64 280, !8, i64 936, !10, i64 944, !15, i64 952, !8, i64 954, !8, i64 955, !8, i64 956, !8, i64 957, !7, i64 960, !7, i64 968, !15, i64 976, !10, i64 984, !10, i64 992, !8, i64 1000, !14, i64 1008, !8, i64 1040, !10, i64 1048, !10, i64 1056, !10, i64 1064, !10, i64 1072, !10, i64 1080, !7, i64 1088, !10, i64 1096}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_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}
!12 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !8, i64 40, !14, i64 552, !14, i64 584, !14, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!13 = !{!"int", !8, i64 0}
!14 = !{!"", !8, i64 0}
!15 = !{!"short", !8, i64 0}
!16 = !{!17, !10, i64 48}
!17 = !{!"_EFI_USB_IO_PROTOCOL", !10, 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}
!18 = !{!19, !8, i64 0}
!19 = !{!"", !8, i64 0, !8, i64 1, !15, i64 2, !15, i64 4, !15, i64 6}
!20 = !{!19, !8, i64 1}
!21 = !{!19, !15, i64 2}
!22 = !{!19, !15, i64 4}
!23 = !{!19, !15, i64 6}
!24 = !{!10, !10, i64 0}
!25 = !{!26, !10, i64 248}
!26 = !{!"", !27, 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}
!27 = !{!"", !7, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass