; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/IntelFrameworkModulePkg (Undi16SimpleNetworkLoadUndi)

; 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.PCI_TYPE00 = type { %struct.PCI_DEVICE_INDEPENDENT_REGION, %struct.PCI_DEVICE_HEADER_TYPE_REGION }
%struct.PCI_DEVICE_INDEPENDENT_REGION = type { i16, i16, i16, i16, i8, [3 x i8], i8, i8, i8, i8 }
%struct.PCI_DEVICE_HEADER_TYPE_REGION = type { [6 x i32], i32, i16, i16, i32, i8, [3 x i8], i32, i8, i8, i8, i8 }
%struct.EFI_SIMPLE_NETWORK_DEV = type { i64, ptr, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, %struct._EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL, ptr, ptr, ptr, i8, ptr, ptr, i16, i16, %struct.EFI_SIMPLE_NETWORK_DEV_FIFO, ptr, ptr, %struct.PXENV_UNDI_GET_INFORMATION_T, %struct.PXENV_UNDI_GET_NIC_TYPE_T, %struct.PXENV_UNDI_GET_NDIS_INFO_T, i8, %struct.PXENV_UNDI_ISR_T, ptr, ptr, ptr, ptr, i8, i64, i64, i64, i64, ptr, ptr, ptr, 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_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL = type { i64, i64, i64, i32, [4 x i8], i8, i8, i8, i8, i16 }
%struct.EFI_SIMPLE_NETWORK_DEV_FIFO = type { i32, i32, [64 x ptr] }
%struct.PXENV_UNDI_GET_INFORMATION_T = type { i16, i16, i16, i16, i16, i16, [16 x i8], [16 x i8], i16, i16, i16 }
%struct.PXENV_UNDI_GET_NIC_TYPE_T = type <{ i16, i8, %union.PCI_PNP_INFO_T }>
%union.PCI_PNP_INFO_T = type { %struct.PCI_INFO_T }
%struct.PCI_INFO_T = type { i16, i16, i8, i8, i8, i8, i16, i16, i16 }
%struct.PXENV_UNDI_GET_NDIS_INFO_T = type <{ i16, [16 x i8], i32, i32, [4 x i32] }>
%struct.PXENV_UNDI_ISR_T = type { i16, i16, i16, i16, i16, i16, i16, i8, i8 }
%struct._EFI_PCI_IO_PROTOCOL = type { ptr, ptr, %struct.EFI_PCI_IO_PROTOCOL_ACCESS, %struct.EFI_PCI_IO_PROTOCOL_ACCESS, %struct.EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr }
%struct.EFI_PCI_IO_PROTOCOL_ACCESS = type { ptr, ptr }
%struct.EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS = type { ptr, ptr }
%struct.PCI_EXPANSION_ROM_HEADER = type { i16, [22 x i8], i16 }
%struct.PCI_DATA_STRUCTURE = type { i32, i16, i16, i16, i16, i8, [3 x i8], i16, i16, i8, i8, i16 }

@mCachedInt1A = external dso_local global i8, align 1
@.str.31 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [57 x i8], align 1

; 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
define dso_local i64 @Undi16SimpleNetworkLoadUndi(ptr noundef %0) #1 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.PCI_TYPE00, align 1
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  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 64, ptr %9) #3
  %11 = load i8, ptr @mCachedInt1A, align 1, !tbaa !9
  %12 = icmp ne i8 %11, 0
  br i1 %12, label %19, label %13

13:                                               ; preds = %1
  %14 = call i64 @CacheVectorAddress(i8 noundef zeroext 26)
  store i64 %14, ptr %4, align 8, !tbaa !10
  %15 = load i64, ptr %4, align 8, !tbaa !10
  %16 = icmp slt i64 %15, 0
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  store i8 1, ptr @mCachedInt1A, align 1, !tbaa !9
  br label %18

18:                                               ; preds = %17, %13
  br label %19

19:                                               ; preds = %18, %1
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %20, i32 0, i32 6
  %22 = load ptr, ptr %21, align 8, !tbaa !12
  store ptr %22, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._EFI_PCI_IO_PROTOCOL, ptr %23, i32 0, i32 4
  %25 = getelementptr inbounds %struct.EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !25
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = call i64 %26(ptr noundef %27, i32 noundef 2, i32 noundef 0, i64 noundef 16, ptr noundef %9)
  store i64 786432, ptr %6, align 8, !tbaa !10
  br label %29

29:                                               ; preds = %160, %19
  %30 = load i64, ptr %6, align 8, !tbaa !10
  %31 = icmp ult i64 %30, 1048575
  br i1 %31, label %32, label %163

32:                                               ; preds = %29
  %33 = load i64, ptr %6, align 8, !tbaa !10
  %34 = inttoptr i64 %33 to ptr
  store ptr %34, ptr %7, align 8, !tbaa !5
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.PCI_EXPANSION_ROM_HEADER, ptr %35, i32 0, i32 0
  %37 = load i16, ptr %36, align 1, !tbaa !28
  %38 = zext i16 %37 to i32
  %39 = icmp ne i32 %38, 43605
  br i1 %39, label %40, label %41

40:                                               ; preds = %32
  br label %160

41:                                               ; preds = %32
  br label %42

42:                                               ; preds = %41
  %43 = call zeroext i8 @DebugPrintEnabled()
  %44 = icmp ne i8 %43, 0
  br i1 %44, label %45, label %54

45:                                               ; preds = %42
  br label %46

46:                                               ; preds = %45
  %47 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1)
  %48 = icmp ne i8 %47, 0
  br i1 %48, label %49, label %51

49:                                               ; preds = %46
  %50 = load i64, ptr %6, align 8, !tbaa !10
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef @.str.31, i64 noundef %50)
  br label %51

51:                                               ; preds = %49, %46
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53, %42
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.PCI_EXPANSION_ROM_HEADER, ptr %57, i32 0, i32 2
  %59 = load i16, ptr %58, align 1, !tbaa !30
  %60 = zext i16 %59 to i32
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %78, label %62

62:                                               ; preds = %56
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.PCI_EXPANSION_ROM_HEADER, ptr %63, i32 0, i32 2
  %65 = load i16, ptr %64, align 1, !tbaa !30
  %66 = zext i16 %65 to i32
  %67 = and i32 %66, 3
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %78, label %69

69:                                               ; preds = %62
  %70 = load i64, ptr %6, align 8, !tbaa !10
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.PCI_EXPANSION_ROM_HEADER, ptr %71, i32 0, i32 2
  %73 = load i16, ptr %72, align 1, !tbaa !30
  %74 = zext i16 %73 to i64
  %75 = add i64 %70, %74
  %76 = add i64 %75, 24
  %77 = icmp ugt i64 %76, 1048576
  br i1 %77, label %78, label %79

78:                                               ; preds = %69, %62, %56
  br label %163

79:                                               ; preds = %69
  %80 = load i64, ptr %6, align 8, !tbaa !10
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.PCI_EXPANSION_ROM_HEADER, ptr %81, i32 0, i32 2
  %83 = load i16, ptr %82, align 1, !tbaa !30
  %84 = zext i16 %83 to i64
  %85 = add i64 %80, %84
  %86 = inttoptr i64 %85 to ptr
  store ptr %86, ptr %8, align 8, !tbaa !5
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.PCI_DATA_STRUCTURE, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 1, !tbaa !31
  %90 = icmp ne i32 %89, 1380533072
  br i1 %90, label %91, label %92

91:                                               ; preds = %79
  br label %160

92:                                               ; preds = %79
  br label %93

93:                                               ; preds = %92
  %94 = call zeroext i8 @DebugPrintEnabled()
  %95 = icmp ne i8 %94, 0
  br i1 %95, label %96, label %105

96:                                               ; preds = %93
  br label %97

97:                                               ; preds = %96
  %98 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1)
  %99 = icmp ne i8 %98, 0
  br i1 %99, label %100, label %102

100:                                              ; preds = %97
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef @.str.32, ptr noundef %101)
  br label %102

102:                                              ; preds = %100, %97
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104, %93
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.PCI_DATA_STRUCTURE, ptr %108, i32 0, i32 1
  %110 = load i16, ptr %109, align 1, !tbaa !33
  %111 = zext i16 %110 to i32
  %112 = getelementptr inbounds %struct.PCI_TYPE00, ptr %9, i32 0, i32 0
  %113 = getelementptr inbounds %struct.PCI_DEVICE_INDEPENDENT_REGION, ptr %112, i32 0, i32 0
  %114 = load i16, ptr %113, align 1, !tbaa !34
  %115 = zext i16 %114 to i32
  %116 = icmp ne i32 %111, %115
  br i1 %116, label %127, label %117

117:                                              ; preds = %107
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.PCI_DATA_STRUCTURE, ptr %118, i32 0, i32 2
  %120 = load i16, ptr %119, align 1, !tbaa !38
  %121 = zext i16 %120 to i32
  %122 = getelementptr inbounds %struct.PCI_TYPE00, ptr %9, i32 0, i32 0
  %123 = getelementptr inbounds %struct.PCI_DEVICE_INDEPENDENT_REGION, ptr %122, i32 0, i32 1
  %124 = load i16, ptr %123, align 1, !tbaa !39
  %125 = zext i16 %124 to i32
  %126 = icmp ne i32 %121, %125
  br i1 %126, label %127, label %128

127:                                              ; preds = %117, %107
  br label %160

128:                                              ; preds = %117
  br label %129

129:                                              ; preds = %128
  %130 = call zeroext i8 @DebugPrintEnabled()
  %131 = icmp ne i8 %130, 0
  br i1 %131, label %132, label %148

132:                                              ; preds = %129
  br label %133

133:                                              ; preds = %132
  %134 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1)
  %135 = icmp ne i8 %134, 0
  br i1 %135, label %136, label %145

136:                                              ; preds = %133
  %137 = load ptr, ptr %8, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.PCI_DATA_STRUCTURE, ptr %137, i32 0, i32 1
  %139 = load i16, ptr %138, align 1, !tbaa !33
  %140 = zext i16 %139 to i64
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.PCI_DATA_STRUCTURE, ptr %141, i32 0, i32 2
  %143 = load i16, ptr %142, align 1, !tbaa !38
  %144 = zext i16 %143 to i64
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef @.str.33, i64 noundef %140, i64 noundef %144)
  br label %145

145:                                              ; preds = %136, %133
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147, %129
  br label %149

149:                                              ; preds = %148
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = load i64, ptr %6, align 8, !tbaa !10
  %153 = call i64 @LaunchBaseCode(ptr noundef %151, i64 noundef %152)
  store i64 %153, ptr %4, align 8, !tbaa !10
  %154 = load i64, ptr %4, align 8, !tbaa !10
  %155 = icmp slt i64 %154, 0
  br i1 %155, label %157, label %156

156:                                              ; preds = %150
  store i64 0, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %164

157:                                              ; preds = %150
  %158 = load ptr, ptr %3, align 8, !tbaa !5
  %159 = call i64 @Undi16SimpleNetworkUnloadUndi(ptr noundef %158)
  br label %160

160:                                              ; preds = %157, %127, %91, %40
  %161 = load i64, ptr %6, align 8, !tbaa !10
  %162 = add i64 %161, 2048
  store i64 %162, ptr %6, align 8, !tbaa !10
  br label %29, !llvm.loop !40

163:                                              ; preds = %78, %29
  store i64 -9223372036854775794, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %164

164:                                              ; preds = %163, %156
  call void @llvm.lifetime.end.p0(i64 64, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %165 = load i64, ptr %2, align 8
  ret i64 %165
}

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

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

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

declare i64 @CacheVectorAddress(i8 noundef zeroext) #2

declare i64 @LaunchBaseCode(ptr noundef, i64 noundef) #2

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 = { "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, !11, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = !{!13, !6, i64 848}
!13 = !{!"", !11, i64 0, !6, i64 8, !14, i64 16, !15, i64 144, !18, i64 800, !6, i64 840, !6, i64 848, !6, i64 856, !7, i64 864, !6, i64 872, !6, i64 880, !19, i64 888, !19, i64 890, !20, i64 896, !6, i64 1416, !6, i64 1424, !21, i64 1432, !22, i64 1482, !23, i64 1499, !7, i64 1541, !24, i64 1542, !6, i64 1560, !6, i64 1568, !6, i64 1576, !6, i64 1584, !7, i64 1592, !11, i64 1600, !11, i64 1608, !11, i64 1616, !11, i64 1624, !6, i64 1632, !6, i64 1640, !6, i64 1648, !6, i64 1656}
!14 = !{!"_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}
!15 = !{!"", !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, !17, i64 552, !17, i64 584, !17, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!16 = !{!"int", !7, i64 0}
!17 = !{!"", !7, i64 0}
!18 = !{!"_EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !16, i64 24, !7, i64 28, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !19, i64 36}
!19 = !{!"short", !7, i64 0}
!20 = !{!"", !16, i64 0, !16, i64 4, !7, i64 8}
!21 = !{!"", !19, i64 0, !19, i64 2, !19, i64 4, !19, i64 6, !19, i64 8, !19, i64 10, !7, i64 12, !7, i64 28, !19, i64 44, !19, i64 46, !19, i64 48}
!22 = !{!"", !19, i64 0, !7, i64 2, !7, i64 3}
!23 = !{!"", !19, i64 0, !7, i64 2, !16, i64 18, !16, i64 22, !7, i64 26}
!24 = !{!"", !19, i64 0, !19, i64 2, !19, i64 4, !19, i64 6, !19, i64 8, !19, i64 10, !19, i64 12, !7, i64 14, !7, i64 15}
!25 = !{!26, !6, i64 48}
!26 = !{!"_EFI_PCI_IO_PROTOCOL", !6, i64 0, !6, i64 8, !27, i64 16, !27, i64 32, !27, i64 48, !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, !11, i64 144, !6, i64 152}
!27 = !{!"", !6, i64 0, !6, i64 8}
!28 = !{!29, !19, i64 0}
!29 = !{!"", !19, i64 0, !7, i64 2, !19, i64 24}
!30 = !{!29, !19, i64 24}
!31 = !{!32, !16, i64 0}
!32 = !{!"", !16, i64 0, !19, i64 4, !19, i64 6, !19, i64 8, !19, i64 10, !7, i64 12, !7, i64 13, !19, i64 16, !19, i64 18, !7, i64 20, !7, i64 21, !19, i64 22}
!33 = !{!32, !19, i64 4}
!34 = !{!35, !19, i64 0}
!35 = !{!"", !36, i64 0, !37, i64 16}
!36 = !{!"", !19, i64 0, !19, i64 2, !19, i64 4, !19, i64 6, !7, i64 8, !7, i64 9, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15}
!37 = !{!"", !7, i64 0, !16, i64 24, !19, i64 28, !19, i64 30, !16, i64 32, !7, i64 36, !7, i64 37, !16, i64 40, !7, i64 44, !7, i64 45, !7, i64 46, !7, i64 47}
!38 = !{!32, !19, i64 6}
!39 = !{!35, !19, i64 2}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.PCI_TYPE00 = type { %struct.PCI_DEVICE_INDEPENDENT_REGION, %struct.PCI_DEVICE_HEADER_TYPE_REGION }
%struct.PCI_DEVICE_INDEPENDENT_REGION = type { i16, i16, i16, i16, i8, [3 x i8], i8, i8, i8, i8 }
%struct.PCI_DEVICE_HEADER_TYPE_REGION = type { [6 x i32], i32, i16, i16, i32, i8, [3 x i8], i32, i8, i8, i8, i8 }

@mCachedInt1A = external dso_local local_unnamed_addr global i8, align 1
@.str.31 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [57 x i8], align 1

; 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
define dso_local range(i64 -9223372036854775794, 1) i64 @Undi16SimpleNetworkLoadUndi(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca %struct.PCI_TYPE00, align 2
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #3
  %3 = load i8, ptr @mCachedInt1A, align 1, !tbaa !5
  %.not = icmp eq i8 %3, 0
  br i1 %.not, label %4, label %8

4:                                                ; preds = %1
  %5 = tail call i64 @CacheVectorAddress(i8 noundef zeroext 26) #3
  %6 = icmp slt i64 %5, 0
  br i1 %6, label %8, label %7

7:                                                ; preds = %4
  store i8 1, ptr @mCachedInt1A, align 1, !tbaa !5
  br label %8

8:                                                ; preds = %4, %7, %1
  %9 = getelementptr inbounds i8, ptr %0, i64 848
  %10 = load ptr, ptr %9, align 8, !tbaa !8
  %11 = getelementptr inbounds i8, ptr %10, i64 48
  %12 = load ptr, ptr %11, align 8, !tbaa !23
  %13 = call i64 %12(ptr noundef %10, i32 noundef 2, i32 noundef 0, i64 noundef 16, ptr noundef nonnull %2) #3
  %14 = getelementptr inbounds i8, ptr %2, i64 2
  br label %15

15:                                               ; preds = %8, %62
  %.02538 = phi i64 [ 786432, %8 ], [ %63, %62 ]
  %16 = inttoptr i64 %.02538 to ptr
  %17 = load i16, ptr %16, align 2048, !tbaa !26
  %.not27 = icmp eq i16 %17, -21931
  br i1 %.not27, label %18, label %62

18:                                               ; preds = %15
  %19 = call zeroext i8 @DebugPrintEnabled() #3
  %.not28 = icmp eq i8 %19, 0
  br i1 %.not28, label %23, label %20

20:                                               ; preds = %18
  %21 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1) #3
  %.not29 = icmp eq i8 %21, 0
  br i1 %.not29, label %23, label %22

22:                                               ; preds = %20
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef nonnull @.str.31, i64 noundef %.02538) #3
  br label %23

23:                                               ; preds = %20, %22, %18
  %24 = getelementptr inbounds i8, ptr %16, i64 24
  %25 = load i16, ptr %24, align 8, !tbaa !28
  %26 = icmp ne i16 %25, 0
  %27 = and i16 %25, 3
  %.not30 = icmp eq i16 %27, 0
  %or.cond = and i1 %26, %.not30
  br i1 %or.cond, label %28, label %65

28:                                               ; preds = %23
  %29 = zext i16 %25 to i64
  %30 = add nuw nsw i64 %.02538, %29
  %31 = icmp ugt i64 %30, 1048552
  br i1 %31, label %65, label %32

32:                                               ; preds = %28
  %33 = inttoptr i64 %30 to ptr
  %34 = load i32, ptr %33, align 1, !tbaa !29
  %.not31 = icmp eq i32 %34, 1380533072
  br i1 %.not31, label %35, label %62

35:                                               ; preds = %32
  %36 = call zeroext i8 @DebugPrintEnabled() #3
  %.not32 = icmp eq i8 %36, 0
  br i1 %.not32, label %40, label %37

37:                                               ; preds = %35
  %38 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1) #3
  %.not33 = icmp eq i8 %38, 0
  br i1 %.not33, label %40, label %39

39:                                               ; preds = %37
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef nonnull @.str.32, ptr noundef nonnull %33) #3
  br label %40

40:                                               ; preds = %37, %39, %35
  %41 = getelementptr inbounds i8, ptr %33, i64 4
  %42 = load i16, ptr %41, align 1, !tbaa !31
  %43 = load i16, ptr %2, align 2, !tbaa !32
  %.not34 = icmp eq i16 %42, %43
  br i1 %.not34, label %44, label %62

44:                                               ; preds = %40
  %45 = getelementptr inbounds i8, ptr %33, i64 6
  %46 = load i16, ptr %45, align 1, !tbaa !36
  %47 = load i16, ptr %14, align 2, !tbaa !37
  %.not35 = icmp eq i16 %46, %47
  br i1 %.not35, label %48, label %62

48:                                               ; preds = %44
  %49 = call zeroext i8 @DebugPrintEnabled() #3
  %.not36 = icmp eq i8 %49, 0
  br i1 %.not36, label %57, label %50

50:                                               ; preds = %48
  %51 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1) #3
  %.not37 = icmp eq i8 %51, 0
  br i1 %.not37, label %57, label %52

52:                                               ; preds = %50
  %53 = load i16, ptr %41, align 1, !tbaa !31
  %54 = zext i16 %53 to i64
  %55 = load i16, ptr %45, align 1, !tbaa !36
  %56 = zext i16 %55 to i64
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef nonnull @.str.33, i64 noundef %54, i64 noundef %56) #3
  br label %57

57:                                               ; preds = %50, %52, %48
  %58 = call i64 @LaunchBaseCode(ptr noundef %0, i64 noundef %.02538) #3
  %59 = icmp slt i64 %58, 0
  br i1 %59, label %60, label %65

60:                                               ; preds = %57
  %61 = call i64 @Undi16SimpleNetworkUnloadUndi(ptr noundef %0)
  br label %62

62:                                               ; preds = %40, %44, %32, %15, %60
  %63 = add nuw nsw i64 %.02538, 2048
  %64 = icmp ult i64 %.02538, 1046527
  br i1 %64, label %15, label %65, !llvm.loop !38

65:                                               ; preds = %62, %28, %23, %57
  %.0 = phi i64 [ 0, %57 ], [ -9223372036854775794, %23 ], [ -9223372036854775794, %28 ], [ -9223372036854775794, %62 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #3
  ret i64 %.0
}

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #2

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

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

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

declare i64 @CacheVectorAddress(i8 noundef zeroext) local_unnamed_addr #2

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

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 = { "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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !11, i64 848}
!9 = !{!"", !10, i64 0, !11, i64 8, !12, i64 16, !13, i64 144, !16, i64 800, !11, i64 840, !11, i64 848, !11, i64 856, !6, i64 864, !11, i64 872, !11, i64 880, !17, i64 888, !17, i64 890, !18, i64 896, !11, i64 1416, !11, i64 1424, !19, i64 1432, !20, i64 1482, !21, i64 1499, !6, i64 1541, !22, i64 1542, !11, i64 1560, !11, i64 1568, !11, i64 1576, !11, i64 1584, !6, i64 1592, !10, i64 1600, !10, i64 1608, !10, i64 1616, !10, i64 1624, !11, i64 1632, !11, i64 1640, !11, i64 1648, !11, i64 1656}
!10 = !{!"long long", !6, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !10, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, 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, !6, i64 40, !15, i64 552, !15, i64 584, !15, i64 616, !6, i64 648, !6, i64 649, !6, i64 650, !6, i64 651, !6, i64 652}
!14 = !{!"int", !6, i64 0}
!15 = !{!"", !6, i64 0}
!16 = !{!"_EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !14, i64 24, !6, i64 28, !6, i64 32, !6, i64 33, !6, i64 34, !6, i64 35, !17, i64 36}
!17 = !{!"short", !6, i64 0}
!18 = !{!"", !14, i64 0, !14, i64 4, !6, i64 8}
!19 = !{!"", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6, !17, i64 8, !17, i64 10, !6, i64 12, !6, i64 28, !17, i64 44, !17, i64 46, !17, i64 48}
!20 = !{!"", !17, i64 0, !6, i64 2, !6, i64 3}
!21 = !{!"", !17, i64 0, !6, i64 2, !14, i64 18, !14, i64 22, !6, i64 26}
!22 = !{!"", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6, !17, i64 8, !17, i64 10, !17, i64 12, !6, i64 14, !6, i64 15}
!23 = !{!24, !11, i64 48}
!24 = !{!"_EFI_PCI_IO_PROTOCOL", !11, i64 0, !11, i64 8, !25, i64 16, !25, i64 32, !25, i64 48, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !10, i64 144, !11, i64 152}
!25 = !{!"", !11, i64 0, !11, i64 8}
!26 = !{!27, !17, i64 0}
!27 = !{!"", !17, i64 0, !6, i64 2, !17, i64 24}
!28 = !{!27, !17, i64 24}
!29 = !{!30, !14, i64 0}
!30 = !{!"", !14, i64 0, !17, i64 4, !17, i64 6, !17, i64 8, !17, i64 10, !6, i64 12, !6, i64 13, !17, i64 16, !17, i64 18, !6, i64 20, !6, i64 21, !17, i64 22}
!31 = !{!30, !17, i64 4}
!32 = !{!33, !17, i64 0}
!33 = !{!"", !34, i64 0, !35, i64 16}
!34 = !{!"", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6, !6, i64 8, !6, i64 9, !6, i64 12, !6, i64 13, !6, i64 14, !6, i64 15}
!35 = !{!"", !6, i64 0, !14, i64 24, !17, i64 28, !17, i64 30, !14, i64 32, !6, i64 36, !6, i64 37, !14, i64 40, !6, i64 44, !6, i64 45, !6, i64 46, !6, i64 47}
!36 = !{!30, !17, i64 6}
!37 = !{!33, !17, i64 2}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass