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

; 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.PXENV_UNDI_INITIALIZE_T = type <{ i16, i32, [8 x i8] }>
%struct.PXENV_UNDI_OPEN_T = type { i16, i16, i16, %struct.PXENV_UNDI_MCAST_ADDR_T }
%struct.PXENV_UNDI_MCAST_ADDR_T = type { i16, [8 x [16 x 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 }

@.str.29 = external hidden unnamed_addr constant [160 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [44 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

declare zeroext i8 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Undi16SimpleNetworkInitialize(ptr noundef %0, i64 noundef %1, i64 noundef %2) #2 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.PXENV_UNDI_INITIALIZE_T, align 1
  %11 = alloca %struct.PXENV_UNDI_OPEN_T, align 1
  %12 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store i64 %2, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 14, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 136, ptr %11) #3
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %3
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %196

16:                                               ; preds = %3
  store i64 0, ptr %8, align 8, !tbaa !9
  %17 = call zeroext i8 @DebugAssertEnabled()
  %18 = zext i8 %17 to i32
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %30

20:                                               ; preds = %16
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = ptrtoint ptr %21 to i64
  %23 = sub i64 %22, ptrtoint (ptr getelementptr inbounds (%struct.EFI_SIMPLE_NETWORK_DEV, ptr null, i32 0, i32 2) to i64)
  %24 = inttoptr i64 %23 to ptr
  %25 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %24, i32 0, i32 0
  %26 = load i64, ptr %25, align 8, !tbaa !11
  %27 = icmp ne i64 %26, 909209203
  br i1 %27, label %28, label %30

28:                                               ; preds = %20
  call void @DebugAssert(ptr noundef @.str.29, i64 noundef 2054, ptr noundef @.str.30)
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  br label %35

30:                                               ; preds = %20, %16
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = ptrtoint ptr %31 to i64
  %33 = sub i64 %32, ptrtoint (ptr getelementptr inbounds (%struct.EFI_SIMPLE_NETWORK_DEV, ptr null, i32 0, i32 2) to i64)
  %34 = inttoptr i64 %33 to ptr
  br label %35

35:                                               ; preds = %30, %28
  %36 = phi ptr [ %29, %28 ], [ %34, %30 ]
  store ptr %36, ptr %9, align 8, !tbaa !5
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %35
  store i64 -9223372036854775801, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %196

40:                                               ; preds = %35
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %41, i32 0, i32 3
  %43 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %42, i32 0, i32 0
  %44 = load i32, ptr %43, align 8, !tbaa !24
  switch i32 %44, label %47 [
    i32 0, label %45
    i32 1, label %48
    i32 2, label %46
  ]

45:                                               ; preds = %40
  store i64 -9223372036854775789, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %196

46:                                               ; preds = %40
  br label %47

47:                                               ; preds = %46, %40
  store i64 -9223372036854775801, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %196

48:                                               ; preds = %40
  %49 = getelementptr inbounds %struct.PXENV_UNDI_INITIALIZE_T, ptr %10, i32 0, i32 0
  store i16 -21555, ptr %49, align 1, !tbaa !25
  %50 = getelementptr inbounds %struct.PXENV_UNDI_INITIALIZE_T, ptr %10, i32 0, i32 1
  store i32 0, ptr %50, align 1, !tbaa !27
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = call i64 @PxeUndiInitialize(ptr noundef %51, ptr noundef %10)
  store i64 %52, ptr %8, align 8, !tbaa !9
  %53 = load i64, ptr %8, align 8, !tbaa !9
  %54 = icmp slt i64 %53, 0
  br i1 %54, label %55, label %95

55:                                               ; preds = %48
  br label %56

56:                                               ; preds = %55
  %57 = call zeroext i8 @DebugPrintEnabled()
  %58 = icmp ne i8 %57, 0
  br i1 %58, label %59, label %68

59:                                               ; preds = %56
  br label %60

60:                                               ; preds = %59
  %61 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %62 = icmp ne i8 %61, 0
  br i1 %62, label %63, label %65

63:                                               ; preds = %60
  %64 = load i64, ptr %8, align 8, !tbaa !9
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.66, i64 noundef %64)
  br label %65

65:                                               ; preds = %63, %60
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67, %56
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70
  %72 = call zeroext i8 @DebugPrintEnabled()
  %73 = icmp ne i8 %72, 0
  br i1 %73, label %74, label %85

74:                                               ; preds = %71
  br label %75

75:                                               ; preds = %74
  %76 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %77 = icmp ne i8 %76, 0
  br i1 %77, label %78, label %82

78:                                               ; preds = %75
  %79 = getelementptr inbounds %struct.PXENV_UNDI_INITIALIZE_T, ptr %10, i32 0, i32 0
  %80 = load i16, ptr %79, align 1, !tbaa !25
  %81 = zext i16 %80 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.67, i32 noundef %81)
  br label %82

82:                                               ; preds = %78, %75
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84, %71
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  %88 = getelementptr inbounds %struct.PXENV_UNDI_INITIALIZE_T, ptr %10, i32 0, i32 0
  %89 = load i16, ptr %88, align 1, !tbaa !25
  %90 = zext i16 %89 to i32
  %91 = icmp eq i32 %90, 97
  br i1 %91, label %92, label %93

92:                                               ; preds = %87
  store i64 -9223372036854775796, ptr %8, align 8, !tbaa !9
  br label %93

93:                                               ; preds = %92, %87
  %94 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %94, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %196

95:                                               ; preds = %48
  %96 = getelementptr inbounds %struct.PXENV_UNDI_INITIALIZE_T, ptr %10, i32 0, i32 0
  %97 = load i16, ptr %96, align 1, !tbaa !25
  %98 = zext i16 %97 to i32
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %118

100:                                              ; preds = %95
  br label %101

101:                                              ; preds = %100
  %102 = call zeroext i8 @DebugPrintEnabled()
  %103 = icmp ne i8 %102, 0
  br i1 %103, label %104, label %115

104:                                              ; preds = %101
  br label %105

105:                                              ; preds = %104
  %106 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %107 = icmp ne i8 %106, 0
  br i1 %107, label %108, label %112

108:                                              ; preds = %105
  %109 = getelementptr inbounds %struct.PXENV_UNDI_INITIALIZE_T, ptr %10, i32 0, i32 0
  %110 = load i16, ptr %109, align 1, !tbaa !25
  %111 = zext i16 %110 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.68, i32 noundef %111)
  br label %112

112:                                              ; preds = %108, %105
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114, %101
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116
  store i64 -9223372036854775801, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %196

118:                                              ; preds = %95
  %119 = getelementptr inbounds %struct.PXENV_UNDI_OPEN_T, ptr %11, i32 0, i32 0
  store i16 -21555, ptr %119, align 1, !tbaa !28
  %120 = getelementptr inbounds %struct.PXENV_UNDI_OPEN_T, ptr %11, i32 0, i32 1
  store i16 0, ptr %120, align 1, !tbaa !31
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %121, i32 0, i32 3
  %123 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %122, i32 0, i32 7
  %124 = load i32, ptr %123, align 4, !tbaa !32
  %125 = zext i32 %124 to i64
  %126 = call zeroext i16 @Undi16GetPacketFilterSetting(i64 noundef %125)
  %127 = getelementptr inbounds %struct.PXENV_UNDI_OPEN_T, ptr %11, i32 0, i32 2
  store i16 %126, ptr %127, align 1, !tbaa !33
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %128, i32 0, i32 3
  %130 = getelementptr inbounds %struct.PXENV_UNDI_OPEN_T, ptr %11, i32 0, i32 3
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %131, i32 0, i32 3
  %133 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %132, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !34
  %135 = zext i32 %134 to i64
  call void @Undi16GetMCastFilters(ptr noundef %129, ptr noundef %130, i64 noundef %135)
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = call i64 @PxeUndiOpen(ptr noundef %136, ptr noundef %11)
  store i64 %137, ptr %8, align 8, !tbaa !9
  %138 = load i64, ptr %8, align 8, !tbaa !9
  %139 = icmp slt i64 %138, 0
  br i1 %139, label %140, label %157

140:                                              ; preds = %118
  br label %141

141:                                              ; preds = %140
  %142 = call zeroext i8 @DebugPrintEnabled()
  %143 = icmp ne i8 %142, 0
  br i1 %143, label %144, label %153

144:                                              ; preds = %141
  br label %145

145:                                              ; preds = %144
  %146 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %147 = icmp ne i8 %146, 0
  br i1 %147, label %148, label %150

148:                                              ; preds = %145
  %149 = load i64, ptr %8, align 8, !tbaa !9
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.69, i64 noundef %149)
  br label %150

150:                                              ; preds = %148, %145
  br label %151

151:                                              ; preds = %150
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152, %141
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154
  %156 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %156, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %196

157:                                              ; preds = %118
  %158 = getelementptr inbounds %struct.PXENV_UNDI_OPEN_T, ptr %11, i32 0, i32 0
  %159 = load i16, ptr %158, align 1, !tbaa !28
  %160 = zext i16 %159 to i32
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %162, label %180

162:                                              ; preds = %157
  br label %163

163:                                              ; preds = %162
  %164 = call zeroext i8 @DebugPrintEnabled()
  %165 = icmp ne i8 %164, 0
  br i1 %165, label %166, label %177

166:                                              ; preds = %163
  br label %167

167:                                              ; preds = %166
  %168 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %169 = icmp ne i8 %168, 0
  br i1 %169, label %170, label %174

170:                                              ; preds = %167
  %171 = getelementptr inbounds %struct.PXENV_UNDI_OPEN_T, ptr %11, i32 0, i32 0
  %172 = load i16, ptr %171, align 1, !tbaa !28
  %173 = zext i16 %172 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.70, i32 noundef %173)
  br label %174

174:                                              ; preds = %170, %167
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176, %163
  br label %178

178:                                              ; preds = %177
  br label %179

179:                                              ; preds = %178
  store i64 -9223372036854775801, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %196

180:                                              ; preds = %157
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %181, i32 0, i32 3
  %183 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %182, i32 0, i32 0
  store i32 2, ptr %183, align 8, !tbaa !24
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %184, i32 0, i32 3
  %186 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %185, i32 0, i32 18
  store i8 1, ptr %186, align 4, !tbaa !35
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %187, i32 0, i32 13
  %189 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV_FIFO, ptr %188, i32 0, i32 0
  store i32 0, ptr %189, align 8, !tbaa !36
  %190 = load ptr, ptr %9, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %190, i32 0, i32 13
  %192 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV_FIFO, ptr %191, i32 0, i32 1
  store i32 0, ptr %192, align 4, !tbaa !37
  %193 = load ptr, ptr %9, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_DEV, ptr %193, i32 0, i32 19
  store i8 0, ptr %194, align 1, !tbaa !38
  %195 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %195, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %196

196:                                              ; preds = %180, %179, %155, %117, %93, %47, %45, %39, %15
  call void @llvm.lifetime.end.p0(i64 136, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 14, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %197 = load i64, ptr %4, align 8
  ret i64 %197
}

declare zeroext i8 @DebugAssertEnabled() #1

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i16 @Undi16GetPacketFilterSetting(i64 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @Undi16GetMCastFilters(ptr noundef, ptr noundef, i64 noundef) #2

declare i64 @PxeUndiInitialize(ptr noundef, ptr noundef) #1

declare i64 @PxeUndiOpen(ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"", !10, i64 0, !6, i64 8, !13, i64 16, !14, i64 144, !17, i64 800, !6, i64 840, !6, i64 848, !6, i64 856, !7, i64 864, !6, i64 872, !6, i64 880, !18, i64 888, !18, i64 890, !19, i64 896, !6, i64 1416, !6, i64 1424, !20, i64 1432, !21, i64 1482, !22, i64 1499, !7, i64 1541, !23, i64 1542, !6, i64 1560, !6, i64 1568, !6, i64 1576, !6, i64 1584, !7, i64 1592, !10, i64 1600, !10, i64 1608, !10, i64 1616, !10, i64 1624, !6, i64 1632, !6, i64 1640, !6, i64 1648, !6, i64 1656}
!13 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !10, 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}
!14 = !{!"", !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, !7, i64 40, !16, i64 552, !16, i64 584, !16, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!15 = !{!"int", !7, i64 0}
!16 = !{!"", !7, i64 0}
!17 = !{!"_EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !15, i64 24, !7, i64 28, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !18, i64 36}
!18 = !{!"short", !7, i64 0}
!19 = !{!"", !15, i64 0, !15, i64 4, !7, i64 8}
!20 = !{!"", !18, i64 0, !18, i64 2, !18, i64 4, !18, i64 6, !18, i64 8, !18, i64 10, !7, i64 12, !7, i64 28, !18, i64 44, !18, i64 46, !18, i64 48}
!21 = !{!"", !18, i64 0, !7, i64 2, !7, i64 3}
!22 = !{!"", !18, i64 0, !7, i64 2, !15, i64 18, !15, i64 22, !7, i64 26}
!23 = !{!"", !18, i64 0, !18, i64 2, !18, i64 4, !18, i64 6, !18, i64 8, !18, i64 10, !18, i64 12, !7, i64 14, !7, i64 15}
!24 = !{!12, !15, i64 144}
!25 = !{!26, !18, i64 0}
!26 = !{!"", !18, i64 0, !15, i64 2, !7, i64 6}
!27 = !{!26, !15, i64 2}
!28 = !{!29, !18, i64 0}
!29 = !{!"", !18, i64 0, !18, i64 2, !18, i64 4, !30, i64 6}
!30 = !{!"", !18, i64 0, !7, i64 2}
!31 = !{!29, !18, i64 2}
!32 = !{!12, !15, i64 172}
!33 = !{!29, !18, i64 4}
!34 = !{!12, !15, i64 148}
!35 = !{!12, !7, i64 796}
!36 = !{!12, !15, i64 896}
!37 = !{!12, !15, i64 900}
!38 = !{!12, !7, i64 1541}


; 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.PXENV_UNDI_INITIALIZE_T = type <{ i16, i32, [8 x i8] }>
%struct.PXENV_UNDI_OPEN_T = type { i16, i16, i16, %struct.PXENV_UNDI_MCAST_ADDR_T }
%struct.PXENV_UNDI_MCAST_ADDR_T = type { i16, [8 x [16 x i8]] }

@.str.29 = external hidden unnamed_addr constant [160 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [44 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

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 @Undi16SimpleNetworkInitialize(ptr noundef %0, i64 noundef %1, i64 noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.PXENV_UNDI_INITIALIZE_T, align 2
  %5 = alloca %struct.PXENV_UNDI_OPEN_T, align 2
  call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %5) #3
  %6 = icmp eq ptr %0, null
  br i1 %6, label %77, label %7

7:                                                ; preds = %3
  %8 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %8, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre41 = add i64 %.pre, -16
  %.pre43 = inttoptr i64 %.pre41 to ptr
  br i1 %.not, label %._crit_edge, label %9

9:                                                ; preds = %7
  %10 = load i64, ptr %.pre43, align 8, !tbaa !5
  %.not28 = icmp eq i64 %10, 909209203
  br i1 %.not28, label %._crit_edge, label %.thread

.thread:                                          ; preds = %9
  tail call void @DebugAssert(ptr noundef nonnull @.str.29, i64 noundef 2054, ptr noundef nonnull @.str.30) #3
  br label %12

._crit_edge:                                      ; preds = %7, %9
  %11 = icmp eq i64 %.pre41, 0
  br i1 %11, label %77, label %12

12:                                               ; preds = %.thread, %._crit_edge
  %13 = phi ptr [ %0, %.thread ], [ %.pre43, %._crit_edge ]
  %14 = getelementptr inbounds i8, ptr %13, i64 144
  %15 = load i32, ptr %14, align 8, !tbaa !22
  switch i32 %15, label %16 [
    i32 0, label %77
    i32 1, label %17
  ]

16:                                               ; preds = %12
  br label %77

17:                                               ; preds = %12
  store i16 -21555, ptr %4, align 2, !tbaa !23
  %18 = getelementptr inbounds i8, ptr %4, i64 2
  store i32 0, ptr %18, align 2, !tbaa !25
  %19 = call i64 @PxeUndiInitialize(ptr noundef nonnull %13, ptr noundef nonnull %4) #3
  %20 = icmp slt i64 %19, 0
  br i1 %20, label %21, label %36

21:                                               ; preds = %17
  %22 = call zeroext i8 @DebugPrintEnabled() #3
  %.not37 = icmp eq i8 %22, 0
  br i1 %.not37, label %26, label %23

23:                                               ; preds = %21
  %24 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not38 = icmp eq i8 %24, 0
  br i1 %.not38, label %26, label %25

25:                                               ; preds = %23
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.66, i64 noundef %19) #3
  br label %26

26:                                               ; preds = %21, %25, %23
  %27 = call zeroext i8 @DebugPrintEnabled() #3
  %.not39 = icmp eq i8 %27, 0
  br i1 %.not39, label %33, label %28

28:                                               ; preds = %26
  %29 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not40 = icmp eq i8 %29, 0
  br i1 %.not40, label %33, label %30

30:                                               ; preds = %28
  %31 = load i16, ptr %4, align 2, !tbaa !23
  %32 = zext i16 %31 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.67, i32 noundef %32) #3
  br label %33

33:                                               ; preds = %28, %30, %26
  %34 = load i16, ptr %4, align 2, !tbaa !23
  %35 = icmp eq i16 %34, 97
  %spec.select = select i1 %35, i64 -9223372036854775796, i64 %19
  br label %77

36:                                               ; preds = %17
  %37 = load i16, ptr %4, align 2, !tbaa !23
  %.not29 = icmp eq i16 %37, 0
  br i1 %.not29, label %45, label %38

38:                                               ; preds = %36
  %39 = call zeroext i8 @DebugPrintEnabled() #3
  %.not35 = icmp eq i8 %39, 0
  br i1 %.not35, label %77, label %40

40:                                               ; preds = %38
  %41 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not36 = icmp eq i8 %41, 0
  br i1 %.not36, label %77, label %42

42:                                               ; preds = %40
  %43 = load i16, ptr %4, align 2, !tbaa !23
  %44 = zext i16 %43 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.68, i32 noundef %44) #3
  br label %77

45:                                               ; preds = %36
  store i16 -21555, ptr %5, align 2, !tbaa !26
  %46 = getelementptr inbounds i8, ptr %5, i64 2
  store i16 0, ptr %46, align 2, !tbaa !29
  %47 = getelementptr inbounds i8, ptr %13, i64 172
  %48 = load i32, ptr %47, align 4, !tbaa !30
  %49 = zext i32 %48 to i64
  %50 = call zeroext i16 @Undi16GetPacketFilterSetting(i64 noundef %49)
  %51 = getelementptr inbounds i8, ptr %5, i64 4
  store i16 %50, ptr %51, align 2, !tbaa !31
  %52 = getelementptr inbounds i8, ptr %5, i64 6
  %53 = getelementptr inbounds i8, ptr %13, i64 148
  %54 = load i32, ptr %53, align 4, !tbaa !32
  %55 = zext i32 %54 to i64
  call void @Undi16GetMCastFilters(ptr noundef nonnull %14, ptr noundef nonnull %52, i64 noundef %55)
  %56 = call i64 @PxeUndiOpen(ptr noundef nonnull %13, ptr noundef nonnull %5) #3
  %57 = icmp slt i64 %56, 0
  br i1 %57, label %58, label %63

58:                                               ; preds = %45
  %59 = call zeroext i8 @DebugPrintEnabled() #3
  %.not33 = icmp eq i8 %59, 0
  br i1 %.not33, label %77, label %60

60:                                               ; preds = %58
  %61 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not34 = icmp eq i8 %61, 0
  br i1 %.not34, label %77, label %62

62:                                               ; preds = %60
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.69, i64 noundef %56) #3
  br label %77

63:                                               ; preds = %45
  %64 = load i16, ptr %5, align 2, !tbaa !26
  %.not30 = icmp eq i16 %64, 0
  br i1 %.not30, label %72, label %65

65:                                               ; preds = %63
  %66 = call zeroext i8 @DebugPrintEnabled() #3
  %.not31 = icmp eq i8 %66, 0
  br i1 %.not31, label %77, label %67

67:                                               ; preds = %65
  %68 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not32 = icmp eq i8 %68, 0
  br i1 %.not32, label %77, label %69

69:                                               ; preds = %67
  %70 = load i16, ptr %5, align 2, !tbaa !26
  %71 = zext i16 %70 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.70, i32 noundef %71) #3
  br label %77

72:                                               ; preds = %63
  store i32 2, ptr %14, align 8, !tbaa !22
  %73 = getelementptr inbounds i8, ptr %13, i64 796
  store i8 1, ptr %73, align 4, !tbaa !33
  %74 = getelementptr inbounds i8, ptr %13, i64 896
  store i32 0, ptr %74, align 8, !tbaa !34
  %75 = getelementptr inbounds i8, ptr %13, i64 900
  store i32 0, ptr %75, align 4, !tbaa !35
  %76 = getelementptr inbounds i8, ptr %13, i64 1541
  store i8 0, ptr %76, align 1, !tbaa !36
  br label %77

77:                                               ; preds = %65, %69, %67, %58, %62, %60, %38, %42, %40, %12, %._crit_edge, %3, %72, %33, %16
  %.0 = phi i64 [ -9223372036854775801, %16 ], [ %spec.select, %33 ], [ %56, %72 ], [ -9223372036854775806, %3 ], [ -9223372036854775801, %._crit_edge ], [ -9223372036854775789, %12 ], [ -9223372036854775801, %40 ], [ -9223372036854775801, %42 ], [ -9223372036854775801, %38 ], [ %56, %60 ], [ %56, %62 ], [ %56, %58 ], [ -9223372036854775801, %67 ], [ -9223372036854775801, %69 ], [ -9223372036854775801, %65 ]
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %4) #3
  ret i64 %.0
}

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i16 @Undi16GetPacketFilterSetting(i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @Undi16GetMCastFilters(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i64 @PxeUndiInitialize(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i64 @PxeUndiOpen(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8, !11, i64 16, !12, i64 144, !15, i64 800, !10, i64 840, !10, i64 848, !10, i64 856, !8, i64 864, !10, i64 872, !10, i64 880, !16, i64 888, !16, i64 890, !17, i64 896, !10, i64 1416, !10, i64 1424, !18, i64 1432, !19, i64 1482, !20, i64 1499, !8, i64 1541, !21, i64 1542, !10, i64 1560, !10, i64 1568, !10, i64 1576, !10, i64 1584, !8, i64 1592, !7, i64 1600, !7, i64 1608, !7, i64 1616, !7, i64 1624, !10, i64 1632, !10, i64 1640, !10, i64 1648, !10, i64 1656}
!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 = !{!"_EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL", !7, i64 0, !7, i64 8, !7, i64 16, !13, i64 24, !8, i64 28, !8, i64 32, !8, i64 33, !8, i64 34, !8, i64 35, !16, i64 36}
!16 = !{!"short", !8, i64 0}
!17 = !{!"", !13, i64 0, !13, i64 4, !8, i64 8}
!18 = !{!"", !16, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !16, i64 8, !16, i64 10, !8, i64 12, !8, i64 28, !16, i64 44, !16, i64 46, !16, i64 48}
!19 = !{!"", !16, i64 0, !8, i64 2, !8, i64 3}
!20 = !{!"", !16, i64 0, !8, i64 2, !13, i64 18, !13, i64 22, !8, i64 26}
!21 = !{!"", !16, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !16, i64 8, !16, i64 10, !16, i64 12, !8, i64 14, !8, i64 15}
!22 = !{!6, !13, i64 144}
!23 = !{!24, !16, i64 0}
!24 = !{!"", !16, i64 0, !13, i64 2, !8, i64 6}
!25 = !{!24, !13, i64 2}
!26 = !{!27, !16, i64 0}
!27 = !{!"", !16, i64 0, !16, i64 2, !16, i64 4, !28, i64 6}
!28 = !{!"", !16, i64 0, !8, i64 2}
!29 = !{!27, !16, i64 2}
!30 = !{!6, !13, i64 172}
!31 = !{!27, !16, i64 4}
!32 = !{!6, !13, i64 148}
!33 = !{!6, !8, i64 796}
!34 = !{!6, !13, i64 896}
!35 = !{!6, !13, i64 900}
!36 = !{!6, !8, i64 1541}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass