; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal (PxeRecvFilterRead)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.SNP_DRIVER = type <{ i32, [4 x i8], %struct.EFI_LOCK, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, ptr, i8, i8, i16, i32, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, %struct.s_pxe_cdb, [6 x i8], ptr, ptr, ptr, %struct.s_pxe_db_get_init_info, i8, ptr, [100 x %struct.MAP_LIST], ptr, i8, [7 x i8] }>
%struct.EFI_LOCK = type { i64, i64, i32 }
%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.s_pxe_cdb = type { i16, i16, i16, i16, i64, i64, i16, i16, i16, i16 }
%struct.s_pxe_db_get_init_info = type <{ i32, i32, [4 x i32], i32, i16, i16, i16, i16, i16, i16, i16, i16, i8, i8, i8 }>
%struct.MAP_LIST = type { i64, ptr }

@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [39 x i8], align 1

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #0

declare zeroext i8 @DebugPrintEnabled() #0

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #0

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeRecvFilterRead(ptr noundef %0) #1 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.EFI_MAC_ADDRESS, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.SNP_DRIVER, ptr %5, i32 0, i32 20
  %7 = getelementptr inbounds %struct.s_pxe_cdb, ptr %6, i32 0, i32 0
  store i16 9, ptr %7, align 2, !tbaa !9
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.SNP_DRIVER, ptr %8, i32 0, i32 20
  %10 = getelementptr inbounds %struct.s_pxe_cdb, ptr %9, i32 0, i32 1
  store i16 0, ptr %10, align 2, !tbaa !20
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.SNP_DRIVER, ptr %11, i32 0, i32 20
  %13 = getelementptr inbounds %struct.s_pxe_cdb, ptr %12, i32 0, i32 2
  store i16 0, ptr %13, align 2, !tbaa !21
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.SNP_DRIVER, ptr %14, i32 0, i32 4
  %16 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %15, i32 0, i32 8
  %17 = load i32, ptr %16, align 8, !tbaa !22
  %18 = zext i32 %17 to i64
  %19 = mul i64 %18, 32
  %20 = trunc i64 %19 to i16
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.SNP_DRIVER, ptr %21, i32 0, i32 20
  %23 = getelementptr inbounds %struct.s_pxe_cdb, ptr %22, i32 0, i32 3
  store i16 %20, ptr %23, align 2, !tbaa !23
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.SNP_DRIVER, ptr %24, i32 0, i32 20
  %26 = getelementptr inbounds %struct.s_pxe_cdb, ptr %25, i32 0, i32 4
  store i64 0, ptr %26, align 2, !tbaa !24
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.SNP_DRIVER, ptr %27, i32 0, i32 20
  %29 = getelementptr inbounds %struct.s_pxe_cdb, ptr %28, i32 0, i32 3
  %30 = load i16, ptr %29, align 2, !tbaa !23
  %31 = zext i16 %30 to i32
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %37

33:                                               ; preds = %1
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.SNP_DRIVER, ptr %34, i32 0, i32 20
  %36 = getelementptr inbounds %struct.s_pxe_cdb, ptr %35, i32 0, i32 5
  store i64 0, ptr %36, align 2, !tbaa !25
  br label %54

37:                                               ; preds = %1
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.SNP_DRIVER, ptr %38, i32 0, i32 24
  %40 = load ptr, ptr %39, align 8, !tbaa !26
  %41 = ptrtoint ptr %40 to i64
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.SNP_DRIVER, ptr %42, i32 0, i32 20
  %44 = getelementptr inbounds %struct.s_pxe_cdb, ptr %43, i32 0, i32 5
  store i64 %41, ptr %44, align 2, !tbaa !25
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.SNP_DRIVER, ptr %45, i32 0, i32 24
  %47 = load ptr, ptr %46, align 8, !tbaa !26
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.SNP_DRIVER, ptr %48, i32 0, i32 20
  %50 = getelementptr inbounds %struct.s_pxe_cdb, ptr %49, i32 0, i32 3
  %51 = load i16, ptr %50, align 2, !tbaa !23
  %52 = zext i16 %51 to i64
  %53 = call ptr @ZeroMem(ptr noundef %47, i64 noundef %52)
  br label %54

54:                                               ; preds = %37, %33
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.SNP_DRIVER, ptr %55, i32 0, i32 20
  %57 = getelementptr inbounds %struct.s_pxe_cdb, ptr %56, i32 0, i32 6
  store i16 0, ptr %57, align 2, !tbaa !27
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.SNP_DRIVER, ptr %58, i32 0, i32 20
  %60 = getelementptr inbounds %struct.s_pxe_cdb, ptr %59, i32 0, i32 7
  store i16 0, ptr %60, align 2, !tbaa !28
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.SNP_DRIVER, ptr %61, i32 0, i32 10
  %63 = load i16, ptr %62, align 2, !tbaa !29
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.SNP_DRIVER, ptr %64, i32 0, i32 20
  %66 = getelementptr inbounds %struct.s_pxe_cdb, ptr %65, i32 0, i32 8
  store i16 %63, ptr %66, align 2, !tbaa !30
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.SNP_DRIVER, ptr %67, i32 0, i32 20
  %69 = getelementptr inbounds %struct.s_pxe_cdb, ptr %68, i32 0, i32 9
  store i16 0, ptr %69, align 2, !tbaa !31
  br label %70

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

73:                                               ; preds = %70
  br label %74

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

77:                                               ; preds = %74
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 16384, ptr noundef @.str)
  br label %78

78:                                               ; preds = %77, %74
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79, %70
  br label %81

81:                                               ; preds = %80
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.SNP_DRIVER, ptr %82, i32 0, i32 7
  %84 = load ptr, ptr %83, align 8, !tbaa !32
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.SNP_DRIVER, ptr %85, i32 0, i32 20
  %87 = ptrtoint ptr %86 to i64
  %88 = call i64 %84(i64 noundef %87)
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.SNP_DRIVER, ptr %89, i32 0, i32 20
  %91 = getelementptr inbounds %struct.s_pxe_cdb, ptr %90, i32 0, i32 6
  %92 = load i16, ptr %91, align 2, !tbaa !27
  %93 = zext i16 %92 to i32
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %118

95:                                               ; preds = %81
  br label %96

96:                                               ; preds = %95
  %97 = call zeroext i8 @DebugPrintEnabled()
  %98 = icmp ne i8 %97, 0
  br i1 %98, label %99, label %116

99:                                               ; preds = %96
  br label %100

100:                                              ; preds = %99
  %101 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %102 = icmp ne i8 %101, 0
  br i1 %102, label %103, label %114

103:                                              ; preds = %100
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.SNP_DRIVER, ptr %104, i32 0, i32 20
  %106 = getelementptr inbounds %struct.s_pxe_cdb, ptr %105, i32 0, i32 7
  %107 = load i16, ptr %106, align 2, !tbaa !28
  %108 = zext i16 %107 to i32
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.SNP_DRIVER, ptr %109, i32 0, i32 20
  %111 = getelementptr inbounds %struct.s_pxe_cdb, ptr %110, i32 0, i32 6
  %112 = load i16, ptr %111, align 2, !tbaa !27
  %113 = zext i16 %112 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.1, i32 noundef %108, i32 noundef %113)
  br label %114

114:                                              ; preds = %103, %100
  br label %115

115:                                              ; preds = %114
  br label %116

116:                                              ; preds = %115, %96
  br label %117

117:                                              ; preds = %116
  store i64 -9223372036854775801, ptr %2, align 8
  br label %240

118:                                              ; preds = %81
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.SNP_DRIVER, ptr %119, i32 0, i32 4
  %121 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %120, i32 0, i32 7
  store i32 0, ptr %121, align 4, !tbaa !33
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.SNP_DRIVER, ptr %122, i32 0, i32 20
  %124 = getelementptr inbounds %struct.s_pxe_cdb, ptr %123, i32 0, i32 7
  %125 = load i16, ptr %124, align 2, !tbaa !28
  %126 = zext i16 %125 to i32
  %127 = and i32 %126, 1
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %135

129:                                              ; preds = %118
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.SNP_DRIVER, ptr %130, i32 0, i32 4
  %132 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %131, i32 0, i32 7
  %133 = load i32, ptr %132, align 4, !tbaa !33
  %134 = or i32 %133, 1
  store i32 %134, ptr %132, align 4, !tbaa !33
  br label %135

135:                                              ; preds = %129, %118
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.SNP_DRIVER, ptr %136, i32 0, i32 20
  %138 = getelementptr inbounds %struct.s_pxe_cdb, ptr %137, i32 0, i32 7
  %139 = load i16, ptr %138, align 2, !tbaa !28
  %140 = zext i16 %139 to i32
  %141 = and i32 %140, 2
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %149

143:                                              ; preds = %135
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.SNP_DRIVER, ptr %144, i32 0, i32 4
  %146 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %145, i32 0, i32 7
  %147 = load i32, ptr %146, align 4, !tbaa !33
  %148 = or i32 %147, 4
  store i32 %148, ptr %146, align 4, !tbaa !33
  br label %149

149:                                              ; preds = %143, %135
  %150 = load ptr, ptr %3, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.SNP_DRIVER, ptr %150, i32 0, i32 20
  %152 = getelementptr inbounds %struct.s_pxe_cdb, ptr %151, i32 0, i32 7
  %153 = load i16, ptr %152, align 2, !tbaa !28
  %154 = zext i16 %153 to i32
  %155 = and i32 %154, 8
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %163

157:                                              ; preds = %149
  %158 = load ptr, ptr %3, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.SNP_DRIVER, ptr %158, i32 0, i32 4
  %160 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %159, i32 0, i32 7
  %161 = load i32, ptr %160, align 4, !tbaa !33
  %162 = or i32 %161, 8
  store i32 %162, ptr %160, align 4, !tbaa !33
  br label %163

163:                                              ; preds = %157, %149
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.SNP_DRIVER, ptr %164, i32 0, i32 20
  %166 = getelementptr inbounds %struct.s_pxe_cdb, ptr %165, i32 0, i32 7
  %167 = load i16, ptr %166, align 2, !tbaa !28
  %168 = zext i16 %167 to i32
  %169 = and i32 %168, 16
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %177

171:                                              ; preds = %163
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.SNP_DRIVER, ptr %172, i32 0, i32 4
  %174 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %173, i32 0, i32 7
  %175 = load i32, ptr %174, align 4, !tbaa !33
  %176 = or i32 %175, 16
  store i32 %176, ptr %174, align 4, !tbaa !33
  br label %177

177:                                              ; preds = %171, %163
  %178 = load ptr, ptr %3, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.SNP_DRIVER, ptr %178, i32 0, i32 20
  %180 = getelementptr inbounds %struct.s_pxe_cdb, ptr %179, i32 0, i32 7
  %181 = load i16, ptr %180, align 2, !tbaa !28
  %182 = zext i16 %181 to i32
  %183 = and i32 %182, 4
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %191

185:                                              ; preds = %177
  %186 = load ptr, ptr %3, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.SNP_DRIVER, ptr %186, i32 0, i32 4
  %188 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %187, i32 0, i32 7
  %189 = load i32, ptr %188, align 4, !tbaa !33
  %190 = or i32 %189, 2
  store i32 %190, ptr %188, align 4, !tbaa !33
  br label %191

191:                                              ; preds = %185, %177
  %192 = load ptr, ptr %3, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.SNP_DRIVER, ptr %192, i32 0, i32 4
  %194 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %193, i32 0, i32 10
  %195 = getelementptr inbounds [16 x %struct.EFI_MAC_ADDRESS], ptr %194, i64 0, i64 0
  %196 = load ptr, ptr %3, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.SNP_DRIVER, ptr %196, i32 0, i32 24
  %198 = load ptr, ptr %197, align 8, !tbaa !26
  %199 = load ptr, ptr %3, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.SNP_DRIVER, ptr %199, i32 0, i32 20
  %201 = getelementptr inbounds %struct.s_pxe_cdb, ptr %200, i32 0, i32 3
  %202 = load i16, ptr %201, align 2, !tbaa !23
  %203 = zext i16 %202 to i64
  %204 = call ptr @CopyMem(ptr noundef %195, ptr noundef %198, i64 noundef %203)
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #3
  %205 = call ptr @SetMem(ptr noundef %4, i64 noundef 32, i8 noundef zeroext 0)
  %206 = load ptr, ptr %3, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.SNP_DRIVER, ptr %206, i32 0, i32 4
  %208 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %207, i32 0, i32 9
  store i32 0, ptr %208, align 4, !tbaa !34
  br label %209

209:                                              ; preds = %233, %191
  %210 = load ptr, ptr %3, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.SNP_DRIVER, ptr %210, i32 0, i32 4
  %212 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %211, i32 0, i32 9
  %213 = load i32, ptr %212, align 4, !tbaa !34
  %214 = load ptr, ptr %3, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.SNP_DRIVER, ptr %214, i32 0, i32 4
  %216 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %215, i32 0, i32 8
  %217 = load i32, ptr %216, align 8, !tbaa !22
  %218 = icmp ult i32 %213, %217
  br i1 %218, label %219, label %239

219:                                              ; preds = %209
  %220 = load ptr, ptr %3, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.SNP_DRIVER, ptr %220, i32 0, i32 4
  %222 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %221, i32 0, i32 10
  %223 = load ptr, ptr %3, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.SNP_DRIVER, ptr %223, i32 0, i32 4
  %225 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %224, i32 0, i32 9
  %226 = load i32, ptr %225, align 4, !tbaa !34
  %227 = zext i32 %226 to i64
  %228 = getelementptr inbounds [16 x %struct.EFI_MAC_ADDRESS], ptr %222, i64 0, i64 %227
  %229 = call i64 @CompareMem(ptr noundef %228, ptr noundef %4, i64 noundef 32)
  %230 = icmp eq i64 %229, 0
  br i1 %230, label %231, label %232

231:                                              ; preds = %219
  br label %239

232:                                              ; preds = %219
  br label %233

233:                                              ; preds = %232
  %234 = load ptr, ptr %3, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.SNP_DRIVER, ptr %234, i32 0, i32 4
  %236 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %235, i32 0, i32 9
  %237 = load i32, ptr %236, align 4, !tbaa !34
  %238 = add i32 %237, 1
  store i32 %238, ptr %236, align 4, !tbaa !34
  br label %209, !llvm.loop !35

239:                                              ; preds = %231, %209
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #3
  store i64 0, ptr %2, align 8
  br label %240

240:                                              ; preds = %239, %117
  %241 = load i64, ptr %2, align 8
  ret i64 %241
}

declare ptr @ZeroMem(ptr noundef, i64 noundef) #0

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

declare ptr @SetMem(ptr noundef, i64 noundef, i8 noundef zeroext) #0

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) #0

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !17, i64 898}
!10 = !{!"", !11, i64 0, !12, i64 8, !14, i64 32, !15, i64 160, !6, i64 816, !6, i64 824, !6, i64 832, !7, i64 840, !17, i64 842, !11, i64 844, !6, i64 848, !6, i64 856, !6, i64 864, !6, i64 872, !6, i64 880, !6, i64 888, !7, i64 896, !7, i64 897, !18, i64 898, !6, i64 936, !6, i64 944, !6, i64 952, !19, i64 960, !6, i64 1008, !7, i64 1016, !6, i64 2616, !7, i64 2624}
!11 = !{!"int", !7, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 8, !11, i64 16}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !13, 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 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, 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}
!16 = !{!"", !7, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{!"s_pxe_cdb", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6, !13, i64 8, !13, i64 16, !17, i64 24, !17, i64 26, !17, i64 28, !17, i64 30}
!19 = !{!"s_pxe_db_get_init_info", !11, i64 0, !11, i64 4, !7, i64 8, !11, i64 24, !17, i64 28, !17, i64 30, !17, i64 32, !17, i64 34, !17, i64 36, !17, i64 38, !17, i64 40, !17, i64 42, !7, i64 44, !7, i64 45, !7, i64 46}
!20 = !{!10, !17, i64 900}
!21 = !{!10, !17, i64 902}
!22 = !{!10, !11, i64 192}
!23 = !{!10, !17, i64 904}
!24 = !{!10, !13, i64 906}
!25 = !{!10, !13, i64 914}
!26 = !{!10, !6, i64 952}
!27 = !{!10, !17, i64 922}
!28 = !{!10, !17, i64 924}
!29 = !{!10, !17, i64 842}
!30 = !{!10, !17, i64 926}
!31 = !{!10, !17, i64 928}
!32 = !{!10, !6, i64 832}
!33 = !{!10, !11, i64 188}
!34 = !{!10, !11, i64 196}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}


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

%struct.EFI_MAC_ADDRESS = type { [32 x i8] }

@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [39 x i8], align 1

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775801, 1) i64 @PxeRecvFilterRead(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca %struct.EFI_MAC_ADDRESS, align 1
  %3 = getelementptr inbounds i8, ptr %0, i64 898
  store i16 9, ptr %3, align 2, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 900
  store i16 0, ptr %4, align 2, !tbaa !19
  %5 = getelementptr inbounds i8, ptr %0, i64 902
  store i16 0, ptr %5, align 2, !tbaa !20
  %6 = getelementptr inbounds i8, ptr %0, i64 192
  %7 = load i32, ptr %6, align 8, !tbaa !21
  %8 = trunc i32 %7 to i16
  %9 = shl i16 %8, 5
  %10 = getelementptr inbounds i8, ptr %0, i64 904
  store i16 %9, ptr %10, align 2, !tbaa !22
  %11 = getelementptr inbounds i8, ptr %0, i64 906
  store i64 0, ptr %11, align 2, !tbaa !23
  %12 = icmp eq i16 %9, 0
  br i1 %12, label %13, label %15

13:                                               ; preds = %1
  %14 = getelementptr inbounds i8, ptr %0, i64 914
  store i64 0, ptr %14, align 2, !tbaa !24
  br label %22

15:                                               ; preds = %1
  %16 = getelementptr inbounds i8, ptr %0, i64 952
  %17 = load ptr, ptr %16, align 8, !tbaa !25
  %18 = ptrtoint ptr %17 to i64
  %19 = getelementptr inbounds i8, ptr %0, i64 914
  store i64 %18, ptr %19, align 2, !tbaa !24
  %20 = zext i16 %9 to i64
  %21 = tail call ptr @ZeroMem(ptr noundef %17, i64 noundef %20) #3
  br label %22

22:                                               ; preds = %15, %13
  %23 = getelementptr inbounds i8, ptr %0, i64 922
  store i16 0, ptr %23, align 2, !tbaa !26
  %24 = getelementptr inbounds i8, ptr %0, i64 924
  store i16 0, ptr %24, align 2, !tbaa !27
  %25 = getelementptr inbounds i8, ptr %0, i64 842
  %26 = load i16, ptr %25, align 2, !tbaa !28
  %27 = getelementptr inbounds i8, ptr %0, i64 926
  store i16 %26, ptr %27, align 2, !tbaa !29
  %28 = getelementptr inbounds i8, ptr %0, i64 928
  store i16 0, ptr %28, align 2, !tbaa !30
  %29 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not = icmp eq i8 %29, 0
  br i1 %.not, label %33, label %30

30:                                               ; preds = %22
  %31 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 16384) #3
  %.not43 = icmp eq i8 %31, 0
  br i1 %.not43, label %33, label %32

32:                                               ; preds = %30
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 16384, ptr noundef nonnull @.str) #3
  br label %33

33:                                               ; preds = %22, %30, %32
  %34 = getelementptr inbounds i8, ptr %0, i64 832
  %35 = load ptr, ptr %34, align 8, !tbaa !31
  %36 = ptrtoint ptr %3 to i64
  %37 = tail call i64 %35(i64 noundef %36) #3
  %38 = load i16, ptr %23, align 2, !tbaa !26
  %.not44 = icmp eq i16 %38, 0
  br i1 %.not44, label %48, label %39

39:                                               ; preds = %33
  %40 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not50 = icmp eq i8 %40, 0
  br i1 %.not50, label %75, label %41

41:                                               ; preds = %39
  %42 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not51 = icmp eq i8 %42, 0
  br i1 %.not51, label %75, label %43

43:                                               ; preds = %41
  %44 = load i16, ptr %24, align 2, !tbaa !27
  %45 = zext i16 %44 to i32
  %46 = load i16, ptr %23, align 2, !tbaa !26
  %47 = zext i16 %46 to i32
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.1, i32 noundef %45, i32 noundef %47) #3
  br label %75

48:                                               ; preds = %33
  %49 = getelementptr inbounds i8, ptr %0, i64 188
  %50 = load i16, ptr %24, align 2, !tbaa !27
  %51 = shl i16 %50, 1
  %52 = and i16 %51, 4
  %53 = and i16 %50, 25
  %54 = or disjoint i16 %53, %52
  %55 = lshr i16 %50, 1
  %56 = and i16 %55, 2
  %storemerge59 = or disjoint i16 %54, %56
  %storemerge = zext nneg i16 %storemerge59 to i32
  store i32 %storemerge, ptr %49, align 4
  %57 = getelementptr inbounds i8, ptr %0, i64 200
  %58 = getelementptr inbounds i8, ptr %0, i64 952
  %59 = load ptr, ptr %58, align 8, !tbaa !25
  %60 = load i16, ptr %10, align 2, !tbaa !22
  %61 = zext i16 %60 to i64
  %62 = tail call ptr @CopyMem(ptr noundef nonnull %57, ptr noundef %59, i64 noundef %61) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #3
  %63 = call ptr @SetMem(ptr noundef nonnull %2, i64 noundef 32, i8 noundef zeroext 0) #3
  %64 = getelementptr inbounds i8, ptr %0, i64 196
  store i32 0, ptr %64, align 4, !tbaa !32
  %65 = load i32, ptr %6, align 8, !tbaa !21
  %.not56 = icmp eq i32 %65, 0
  br i1 %.not56, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %48, %70
  %storemerge53 = phi i32 [ %72, %70 ], [ 0, %48 ]
  %66 = zext i32 %storemerge53 to i64
  %67 = getelementptr inbounds [16 x %struct.EFI_MAC_ADDRESS], ptr %57, i64 0, i64 %66
  %68 = call i64 @CompareMem(ptr noundef nonnull %67, ptr noundef nonnull %2, i64 noundef 32) #3
  %69 = icmp eq i64 %68, 0
  br i1 %69, label %._crit_edge, label %70

70:                                               ; preds = %.lr.ph
  %71 = load i32, ptr %64, align 4, !tbaa !32
  %72 = add i32 %71, 1
  store i32 %72, ptr %64, align 4, !tbaa !32
  %73 = load i32, ptr %6, align 8, !tbaa !21
  %74 = icmp ult i32 %72, %73
  br i1 %74, label %.lr.ph, label %._crit_edge, !llvm.loop !33

._crit_edge:                                      ; preds = %70, %.lr.ph, %48
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #3
  br label %75

75:                                               ; preds = %43, %41, %39, %._crit_edge
  %.0 = phi i64 [ 0, %._crit_edge ], [ -9223372036854775801, %39 ], [ -9223372036854775801, %41 ], [ -9223372036854775801, %43 ]
  ret i64 %.0
}

declare ptr @ZeroMem(ptr noundef, i64 noundef) local_unnamed_addr #0

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

declare ptr @SetMem(ptr noundef, i64 noundef, i8 noundef zeroext) local_unnamed_addr #0

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !16, i64 898}
!6 = !{!"", !7, i64 0, !10, i64 8, !12, i64 32, !14, i64 160, !13, i64 816, !13, i64 824, !13, i64 832, !8, i64 840, !16, i64 842, !7, i64 844, !13, i64 848, !13, i64 856, !13, i64 864, !13, i64 872, !13, i64 880, !13, i64 888, !8, i64 896, !8, i64 897, !17, i64 898, !13, i64 936, !13, i64 944, !13, i64 952, !18, i64 960, !13, i64 1008, !8, i64 1016, !13, i64 2616, !8, i64 2624}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !11, i64 8, !7, i64 16}
!11 = !{!"long long", !8, i64 0}
!12 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !11, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40, !15, i64 552, !15, i64 584, !15, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!15 = !{!"", !8, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = !{!"s_pxe_cdb", !16, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !11, i64 8, !11, i64 16, !16, i64 24, !16, i64 26, !16, i64 28, !16, i64 30}
!18 = !{!"s_pxe_db_get_init_info", !7, i64 0, !7, i64 4, !8, i64 8, !7, i64 24, !16, i64 28, !16, i64 30, !16, i64 32, !16, i64 34, !16, i64 36, !16, i64 38, !16, i64 40, !16, i64 42, !8, i64 44, !8, i64 45, !8, i64 46}
!19 = !{!6, !16, i64 900}
!20 = !{!6, !16, i64 902}
!21 = !{!6, !7, i64 192}
!22 = !{!6, !16, i64 904}
!23 = !{!6, !11, i64 906}
!24 = !{!6, !11, i64 914}
!25 = !{!6, !13, i64 952}
!26 = !{!6, !16, i64 922}
!27 = !{!6, !16, i64 924}
!28 = !{!6, !16, i64 842}
!29 = !{!6, !16, i64 926}
!30 = !{!6, !16, i64 928}
!31 = !{!6, !13, i64 832}
!32 = !{!6, !7, i64 196}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass