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

; 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.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.EFI_MAC_ADDRESS = type { [32 x 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 }
%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.s_pxe_cpb_initialize = type <{ i64, i32, i32, i16, i16, i16, i16, i8, i8 }>

@.str = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [152 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeInit(ptr noundef %0, i16 noundef zeroext %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i16, align 2
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i16 %1, ptr %5, align 2, !tbaa !9
  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
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.SNP_DRIVER, ptr %10, i32 0, i32 22
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  store ptr %12, ptr %6, align 8, !tbaa !5
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.SNP_DRIVER, ptr %13, i32 0, i32 11
  %15 = load i32, ptr %14, align 4, !tbaa !21
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %17, label %69

17:                                               ; preds = %2
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.SNP_DRIVER, ptr %18, i32 0, i32 17
  %20 = load ptr, ptr %19, align 8, !tbaa !22
  %21 = getelementptr inbounds %struct._EFI_PCI_IO_PROTOCOL, ptr %20, i32 0, i32 8
  %22 = load ptr, ptr %21, align 8, !tbaa !23
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.SNP_DRIVER, ptr %23, i32 0, i32 17
  %25 = load ptr, ptr %24, align 8, !tbaa !22
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.SNP_DRIVER, ptr %26, i32 0, i32 11
  %28 = load i32, ptr %27, align 4, !tbaa !21
  %29 = sub i32 %28, 1
  %30 = udiv i32 %29, 4096
  %31 = add i32 %30, 1
  %32 = zext i32 %31 to i64
  %33 = call i64 %22(ptr noundef %25, i32 noundef 0, i32 noundef 4, i64 noundef %32, ptr noundef %7, i64 noundef 0)
  store i64 %33, ptr %8, align 8, !tbaa !26
  %34 = load i64, ptr %8, align 8, !tbaa !26
  %35 = icmp ne i64 %34, 0
  br i1 %35, label %36, label %54

36:                                               ; preds = %17
  br label %37

37:                                               ; preds = %36
  %38 = call zeroext i8 @DebugPrintEnabled()
  %39 = icmp ne i8 %38, 0
  br i1 %39, label %40, label %50

40:                                               ; preds = %37
  br label %41

41:                                               ; preds = %40
  %42 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %43 = icmp ne i8 %42, 0
  br i1 %43, label %44, label %47

44:                                               ; preds = %41
  %45 = load i64, ptr %8, align 8, !tbaa !26
  %46 = load i64, ptr %8, align 8, !tbaa !26
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str, i64 noundef %45, i64 noundef %46)
  br label %47

47:                                               ; preds = %44, %41
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49, %37
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = load i64, ptr %8, align 8, !tbaa !26
  store i64 %53, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %222

54:                                               ; preds = %17
  br label %55

55:                                               ; preds = %54
  %56 = call zeroext i8 @DebugAssertEnabled()
  %57 = icmp ne i8 %56, 0
  br i1 %57, label %58, label %63

58:                                               ; preds = %55
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = icmp ne ptr %59, null
  br i1 %60, label %62, label %61

61:                                               ; preds = %58
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 62, ptr noundef @.str.2)
  br label %62

62:                                               ; preds = %61, %58
  br label %63

63:                                               ; preds = %62, %55
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.SNP_DRIVER, ptr %67, i32 0, i32 12
  store ptr %66, ptr %68, align 8, !tbaa !27
  br label %69

69:                                               ; preds = %65, %2
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.SNP_DRIVER, ptr %70, i32 0, i32 12
  %72 = load ptr, ptr %71, align 8, !tbaa !27
  %73 = ptrtoint ptr %72 to i64
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.s_pxe_cpb_initialize, ptr %74, i32 0, i32 0
  store i64 %73, ptr %75, align 1, !tbaa !28
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.SNP_DRIVER, ptr %76, i32 0, i32 11
  %78 = load i32, ptr %77, align 4, !tbaa !21
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.s_pxe_cpb_initialize, ptr %79, i32 0, i32 1
  store i32 %78, ptr %80, align 1, !tbaa !30
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.s_pxe_cpb_initialize, ptr %81, i32 0, i32 2
  store i32 0, ptr %82, align 1, !tbaa !31
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.s_pxe_cpb_initialize, ptr %83, i32 0, i32 3
  store i16 0, ptr %84, align 1, !tbaa !32
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.s_pxe_cpb_initialize, ptr %85, i32 0, i32 4
  store i16 0, ptr %86, align 1, !tbaa !33
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.s_pxe_cpb_initialize, ptr %87, i32 0, i32 5
  store i16 0, ptr %88, align 1, !tbaa !34
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.s_pxe_cpb_initialize, ptr %89, i32 0, i32 6
  store i16 0, ptr %90, align 1, !tbaa !35
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.s_pxe_cpb_initialize, ptr %91, i32 0, i32 7
  store i8 0, ptr %92, align 1, !tbaa !36
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.s_pxe_cpb_initialize, ptr %93, i32 0, i32 8
  store i8 0, ptr %94, align 1, !tbaa !37
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.SNP_DRIVER, ptr %95, i32 0, i32 20
  %97 = getelementptr inbounds %struct.s_pxe_cdb, ptr %96, i32 0, i32 0
  store i16 5, ptr %97, align 2, !tbaa !38
  %98 = load i16, ptr %5, align 2, !tbaa !9
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.SNP_DRIVER, ptr %99, i32 0, i32 20
  %101 = getelementptr inbounds %struct.s_pxe_cdb, ptr %100, i32 0, i32 1
  store i16 %98, ptr %101, align 2, !tbaa !39
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.SNP_DRIVER, ptr %102, i32 0, i32 20
  %104 = getelementptr inbounds %struct.s_pxe_cdb, ptr %103, i32 0, i32 2
  store i16 26, ptr %104, align 2, !tbaa !40
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.SNP_DRIVER, ptr %105, i32 0, i32 20
  %107 = getelementptr inbounds %struct.s_pxe_cdb, ptr %106, i32 0, i32 3
  store i16 12, ptr %107, align 2, !tbaa !41
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.SNP_DRIVER, ptr %108, i32 0, i32 22
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  %111 = ptrtoint ptr %110 to i64
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.SNP_DRIVER, ptr %112, i32 0, i32 20
  %114 = getelementptr inbounds %struct.s_pxe_cdb, ptr %113, i32 0, i32 4
  store i64 %111, ptr %114, align 2, !tbaa !42
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.SNP_DRIVER, ptr %115, i32 0, i32 24
  %117 = load ptr, ptr %116, align 8, !tbaa !43
  %118 = ptrtoint ptr %117 to i64
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.SNP_DRIVER, ptr %119, i32 0, i32 20
  %121 = getelementptr inbounds %struct.s_pxe_cdb, ptr %120, i32 0, i32 5
  store i64 %118, ptr %121, align 2, !tbaa !44
  %122 = load ptr, ptr %4, 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 6
  store i16 0, ptr %124, align 2, !tbaa !45
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.SNP_DRIVER, ptr %125, i32 0, i32 20
  %127 = getelementptr inbounds %struct.s_pxe_cdb, ptr %126, i32 0, i32 7
  store i16 0, ptr %127, align 2, !tbaa !46
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.SNP_DRIVER, ptr %128, i32 0, i32 10
  %130 = load i16, ptr %129, align 2, !tbaa !47
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.SNP_DRIVER, ptr %131, i32 0, i32 20
  %133 = getelementptr inbounds %struct.s_pxe_cdb, ptr %132, i32 0, i32 8
  store i16 %130, ptr %133, align 2, !tbaa !48
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.SNP_DRIVER, ptr %134, i32 0, i32 20
  %136 = getelementptr inbounds %struct.s_pxe_cdb, ptr %135, i32 0, i32 9
  store i16 0, ptr %136, align 2, !tbaa !49
  br label %137

137:                                              ; preds = %69
  %138 = call zeroext i8 @DebugPrintEnabled()
  %139 = icmp ne i8 %138, 0
  br i1 %139, label %140, label %148

140:                                              ; preds = %137
  br label %141

141:                                              ; preds = %140
  %142 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 16384)
  %143 = icmp ne i8 %142, 0
  br i1 %143, label %144, label %145

144:                                              ; preds = %141
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 16384, ptr noundef @.str.3)
  br label %145

145:                                              ; preds = %144, %141
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  br label %148

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

149:                                              ; preds = %148
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.SNP_DRIVER, ptr %151, i32 0, i32 7
  %153 = load ptr, ptr %152, align 8, !tbaa !50
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.SNP_DRIVER, ptr %154, i32 0, i32 20
  %156 = ptrtoint ptr %155 to i64
  %157 = call i64 %153(i64 noundef %156)
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.SNP_DRIVER, ptr %158, i32 0, i32 20
  %160 = getelementptr inbounds %struct.s_pxe_cdb, ptr %159, i32 0, i32 6
  %161 = load i16, ptr %160, align 2, !tbaa !45
  %162 = zext i16 %161 to i32
  %163 = icmp eq i32 %162, 0
  br i1 %163, label %164, label %168

164:                                              ; preds = %150
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.SNP_DRIVER, ptr %165, i32 0, i32 4
  %167 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %166, i32 0, i32 0
  store i32 2, ptr %167, align 8, !tbaa !51
  store i64 0, ptr %8, align 8, !tbaa !26
  br label %220

168:                                              ; preds = %150
  br label %169

169:                                              ; preds = %168
  %170 = call zeroext i8 @DebugPrintEnabled()
  %171 = icmp ne i8 %170, 0
  br i1 %171, label %172, label %190

172:                                              ; preds = %169
  br label %173

173:                                              ; preds = %172
  %174 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2)
  %175 = icmp ne i8 %174, 0
  br i1 %175, label %176, label %187

176:                                              ; preds = %173
  %177 = load ptr, ptr %4, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.SNP_DRIVER, ptr %177, i32 0, i32 20
  %179 = getelementptr inbounds %struct.s_pxe_cdb, ptr %178, i32 0, i32 7
  %180 = load i16, ptr %179, align 2, !tbaa !46
  %181 = zext i16 %180 to i32
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.SNP_DRIVER, ptr %182, i32 0, i32 20
  %184 = getelementptr inbounds %struct.s_pxe_cdb, ptr %183, i32 0, i32 6
  %185 = load i16, ptr %184, align 2, !tbaa !45
  %186 = zext i16 %185 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2, ptr noundef @.str.4, i32 noundef %181, i32 noundef %186)
  br label %187

187:                                              ; preds = %176, %173
  br label %188

188:                                              ; preds = %187
  br label %189

189:                                              ; preds = %188
  br label %190

190:                                              ; preds = %189, %169
  br label %191

191:                                              ; preds = %190
  br label %192

192:                                              ; preds = %191
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.SNP_DRIVER, ptr %193, i32 0, i32 12
  %195 = load ptr, ptr %194, align 8, !tbaa !27
  %196 = icmp ne ptr %195, null
  br i1 %196, label %197, label %217

197:                                              ; preds = %192
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.SNP_DRIVER, ptr %198, i32 0, i32 17
  %200 = load ptr, ptr %199, align 8, !tbaa !22
  %201 = getelementptr inbounds %struct._EFI_PCI_IO_PROTOCOL, ptr %200, i32 0, i32 9
  %202 = load ptr, ptr %201, align 8, !tbaa !52
  %203 = load ptr, ptr %4, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.SNP_DRIVER, ptr %203, i32 0, i32 17
  %205 = load ptr, ptr %204, align 8, !tbaa !22
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.SNP_DRIVER, ptr %206, i32 0, i32 11
  %208 = load i32, ptr %207, align 4, !tbaa !21
  %209 = sub i32 %208, 1
  %210 = udiv i32 %209, 4096
  %211 = add i32 %210, 1
  %212 = zext i32 %211 to i64
  %213 = load ptr, ptr %4, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.SNP_DRIVER, ptr %213, i32 0, i32 12
  %215 = load ptr, ptr %214, align 8, !tbaa !27
  %216 = call i64 %202(ptr noundef %205, i64 noundef %212, ptr noundef %215)
  br label %217

217:                                              ; preds = %197, %192
  %218 = load ptr, ptr %4, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.SNP_DRIVER, ptr %218, i32 0, i32 12
  store ptr null, ptr %219, align 8, !tbaa !27
  store i64 -9223372036854775801, ptr %8, align 8, !tbaa !26
  br label %220

220:                                              ; preds = %217, %164
  %221 = load i64, ptr %8, align 8, !tbaa !26
  store i64 %221, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %222

222:                                              ; preds = %220, %52
  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
  %223 = load i64, ptr %3, align 8
  ret i64 %223
}

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

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !6, i64 936}
!12 = !{!"", !13, i64 0, !14, i64 8, !16, i64 32, !17, i64 160, !6, i64 816, !6, i64 824, !6, i64 832, !7, i64 840, !10, i64 842, !13, 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, !19, i64 898, !6, i64 936, !6, i64 944, !6, i64 952, !20, i64 960, !6, i64 1008, !7, i64 1016, !6, i64 2616, !7, i64 2624}
!13 = !{!"int", !7, i64 0}
!14 = !{!"", !15, i64 0, !15, i64 8, !13, i64 16}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !15, 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}
!17 = !{!"", !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, !7, i64 40, !18, i64 552, !18, i64 584, !18, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!18 = !{!"", !7, i64 0}
!19 = !{!"s_pxe_cdb", !10, i64 0, !10, i64 2, !10, i64 4, !10, i64 6, !15, i64 8, !15, i64 16, !10, i64 24, !10, i64 26, !10, i64 28, !10, i64 30}
!20 = !{!"s_pxe_db_get_init_info", !13, i64 0, !13, i64 4, !7, i64 8, !13, i64 24, !10, i64 28, !10, i64 30, !10, i64 32, !10, i64 34, !10, i64 36, !10, i64 38, !10, i64 40, !10, i64 42, !7, i64 44, !7, i64 45, !7, i64 46}
!21 = !{!12, !13, i64 844}
!22 = !{!12, !6, i64 888}
!23 = !{!24, !6, i64 88}
!24 = !{!"_EFI_PCI_IO_PROTOCOL", !6, i64 0, !6, i64 8, !25, i64 16, !25, i64 32, !25, 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, !15, i64 144, !6, i64 152}
!25 = !{!"", !6, i64 0, !6, i64 8}
!26 = !{!15, !15, i64 0}
!27 = !{!12, !6, i64 848}
!28 = !{!29, !15, i64 0}
!29 = !{!"s_pxe_cpb_initialize", !15, i64 0, !13, i64 8, !13, i64 12, !10, i64 16, !10, i64 18, !10, i64 20, !10, i64 22, !7, i64 24, !7, i64 25}
!30 = !{!29, !13, i64 8}
!31 = !{!29, !13, i64 12}
!32 = !{!29, !10, i64 16}
!33 = !{!29, !10, i64 18}
!34 = !{!29, !10, i64 20}
!35 = !{!29, !10, i64 22}
!36 = !{!29, !7, i64 24}
!37 = !{!29, !7, i64 25}
!38 = !{!12, !10, i64 898}
!39 = !{!12, !10, i64 900}
!40 = !{!12, !10, i64 902}
!41 = !{!12, !10, i64 904}
!42 = !{!12, !15, i64 906}
!43 = !{!12, !6, i64 952}
!44 = !{!12, !15, i64 914}
!45 = !{!12, !10, i64 922}
!46 = !{!12, !10, i64 924}
!47 = !{!12, !10, i64 842}
!48 = !{!12, !10, i64 926}
!49 = !{!12, !10, i64 928}
!50 = !{!12, !6, i64 832}
!51 = !{!12, !13, i64 160}
!52 = !{!24, !6, i64 96}


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

@.str = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [152 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeInit(ptr noundef %0, i16 noundef zeroext %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %4 = getelementptr inbounds i8, ptr %0, i64 936
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 844
  %7 = load i32, ptr %6, align 4, !tbaa !19
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %._crit_edge, label %8

._crit_edge:                                      ; preds = %2
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 848
  %.pre61 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !20
  br label %32

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %0, i64 888
  %10 = load ptr, ptr %9, align 8, !tbaa !21
  %11 = getelementptr inbounds i8, ptr %10, i64 88
  %12 = load ptr, ptr %11, align 8, !tbaa !22
  %13 = add i32 %7, -1
  %14 = lshr i32 %13, 12
  %15 = add nuw nsw i32 %14, 1
  %16 = zext nneg i32 %15 to i64
  %17 = call i64 %12(ptr noundef %10, i32 noundef 0, i32 noundef 4, i64 noundef %16, ptr noundef nonnull %3, i64 noundef 0) #4
  %.not53 = icmp eq i64 %17, 0
  br i1 %.not53, label %23, label %18

18:                                               ; preds = %8
  %19 = call zeroext i8 @DebugPrintEnabled() #4
  %.not59 = icmp eq i8 %19, 0
  br i1 %.not59, label %92, label %20

20:                                               ; preds = %18
  %21 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #4
  %.not60 = icmp eq i8 %21, 0
  br i1 %.not60, label %92, label %22

22:                                               ; preds = %20
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str, i64 noundef %17, i64 noundef %17) #4
  br label %92

23:                                               ; preds = %8
  %24 = call zeroext i8 @DebugAssertEnabled() #4
  %25 = icmp eq i8 %24, 0
  %26 = load ptr, ptr %3, align 8
  %27 = icmp ne ptr %26, null
  %or.cond = select i1 %25, i1 true, i1 %27
  br i1 %or.cond, label %29, label %28

28:                                               ; preds = %23
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 62, ptr noundef nonnull @.str.2) #4
  %.pre = load ptr, ptr %3, align 8, !tbaa !25
  br label %29

29:                                               ; preds = %28, %23
  %30 = phi ptr [ %.pre, %28 ], [ %26, %23 ]
  %31 = getelementptr inbounds i8, ptr %0, i64 848
  store ptr %30, ptr %31, align 8, !tbaa !20
  %.pre62 = load i32, ptr %6, align 4, !tbaa !19
  %.pre63 = load ptr, ptr %4, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %._crit_edge, %29
  %33 = phi ptr [ %5, %._crit_edge ], [ %.pre63, %29 ]
  %34 = phi i32 [ 0, %._crit_edge ], [ %.pre62, %29 ]
  %35 = phi ptr [ %.pre61, %._crit_edge ], [ %30, %29 ]
  %36 = getelementptr inbounds i8, ptr %0, i64 848
  %37 = ptrtoint ptr %35 to i64
  store i64 %37, ptr %5, align 1, !tbaa !26
  %38 = getelementptr inbounds i8, ptr %5, i64 8
  store i32 %34, ptr %38, align 1, !tbaa !28
  %39 = getelementptr inbounds i8, ptr %5, i64 12
  %40 = getelementptr inbounds i8, ptr %0, i64 898
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(14) %39, i8 0, i64 14, i1 false)
  store i16 5, ptr %40, align 2, !tbaa !29
  %41 = getelementptr inbounds i8, ptr %0, i64 900
  store i16 %1, ptr %41, align 2, !tbaa !30
  %42 = getelementptr inbounds i8, ptr %0, i64 902
  store i16 26, ptr %42, align 2, !tbaa !31
  %43 = getelementptr inbounds i8, ptr %0, i64 904
  store i16 12, ptr %43, align 2, !tbaa !32
  %44 = ptrtoint ptr %33 to i64
  %45 = getelementptr inbounds i8, ptr %0, i64 906
  store i64 %44, ptr %45, align 2, !tbaa !33
  %46 = getelementptr inbounds i8, ptr %0, i64 952
  %47 = load ptr, ptr %46, align 8, !tbaa !34
  %48 = ptrtoint ptr %47 to i64
  %49 = getelementptr inbounds i8, ptr %0, i64 914
  store i64 %48, ptr %49, align 2, !tbaa !35
  %50 = getelementptr inbounds i8, ptr %0, i64 922
  store i16 0, ptr %50, align 2, !tbaa !36
  %51 = getelementptr inbounds i8, ptr %0, i64 924
  store i16 0, ptr %51, align 2, !tbaa !37
  %52 = getelementptr inbounds i8, ptr %0, i64 842
  %53 = load i16, ptr %52, align 2, !tbaa !38
  %54 = getelementptr inbounds i8, ptr %0, i64 926
  store i16 %53, ptr %54, align 2, !tbaa !39
  %55 = getelementptr inbounds i8, ptr %0, i64 928
  store i16 0, ptr %55, align 2, !tbaa !40
  %56 = call zeroext i8 @DebugPrintEnabled() #4
  %.not54 = icmp eq i8 %56, 0
  br i1 %.not54, label %60, label %57

57:                                               ; preds = %32
  %58 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 16384) #4
  %.not55 = icmp eq i8 %58, 0
  br i1 %.not55, label %60, label %59

59:                                               ; preds = %57
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 16384, ptr noundef nonnull @.str.3) #4
  br label %60

60:                                               ; preds = %57, %59, %32
  %61 = getelementptr inbounds i8, ptr %0, i64 832
  %62 = load ptr, ptr %61, align 8, !tbaa !41
  %63 = ptrtoint ptr %40 to i64
  %64 = call i64 %62(i64 noundef %63) #4
  %65 = load i16, ptr %50, align 2, !tbaa !36
  %66 = icmp eq i16 %65, 0
  br i1 %66, label %67, label %69

67:                                               ; preds = %60
  %68 = getelementptr inbounds i8, ptr %0, i64 160
  store i32 2, ptr %68, align 8, !tbaa !42
  br label %92

69:                                               ; preds = %60
  %70 = call zeroext i8 @DebugPrintEnabled() #4
  %.not56 = icmp eq i8 %70, 0
  br i1 %.not56, label %78, label %71

71:                                               ; preds = %69
  %72 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2) #4
  %.not57 = icmp eq i8 %72, 0
  br i1 %.not57, label %78, label %73

73:                                               ; preds = %71
  %74 = load i16, ptr %51, align 2, !tbaa !37
  %75 = zext i16 %74 to i32
  %76 = load i16, ptr %50, align 2, !tbaa !36
  %77 = zext i16 %76 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2, ptr noundef nonnull @.str.4, i32 noundef %75, i32 noundef %77) #4
  br label %78

78:                                               ; preds = %71, %73, %69
  %79 = load ptr, ptr %36, align 8, !tbaa !20
  %.not58 = icmp eq ptr %79, null
  br i1 %.not58, label %91, label %80

80:                                               ; preds = %78
  %81 = getelementptr inbounds i8, ptr %0, i64 888
  %82 = load ptr, ptr %81, align 8, !tbaa !21
  %83 = getelementptr inbounds i8, ptr %82, i64 96
  %84 = load ptr, ptr %83, align 8, !tbaa !43
  %85 = load i32, ptr %6, align 4, !tbaa !19
  %86 = add i32 %85, -1
  %87 = lshr i32 %86, 12
  %88 = add nuw nsw i32 %87, 1
  %89 = zext nneg i32 %88 to i64
  %90 = call i64 %84(ptr noundef %82, i64 noundef %89, ptr noundef nonnull %79) #4
  br label %91

91:                                               ; preds = %80, %78
  store ptr null, ptr %36, align 8, !tbaa !20
  br label %92

92:                                               ; preds = %67, %91, %18, %22, %20
  %.049 = phi i64 [ %17, %20 ], [ %17, %22 ], [ %17, %18 ], [ 0, %67 ], [ -9223372036854775801, %91 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret i64 %.049
}

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

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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, !13, i64 936}
!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, !7, i64 844}
!20 = !{!6, !13, i64 848}
!21 = !{!6, !13, i64 888}
!22 = !{!23, !13, i64 88}
!23 = !{!"_EFI_PCI_IO_PROTOCOL", !13, i64 0, !13, i64 8, !24, i64 16, !24, i64 32, !24, i64 48, !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, i64 128, !13, i64 136, !11, i64 144, !13, i64 152}
!24 = !{!"", !13, i64 0, !13, i64 8}
!25 = !{!13, !13, i64 0}
!26 = !{!27, !11, i64 0}
!27 = !{!"s_pxe_cpb_initialize", !11, i64 0, !7, i64 8, !7, i64 12, !16, i64 16, !16, i64 18, !16, i64 20, !16, i64 22, !8, i64 24, !8, i64 25}
!28 = !{!27, !7, i64 8}
!29 = !{!6, !16, i64 898}
!30 = !{!6, !16, i64 900}
!31 = !{!6, !16, i64 902}
!32 = !{!6, !16, i64 904}
!33 = !{!6, !11, i64 906}
!34 = !{!6, !13, i64 952}
!35 = !{!6, !11, i64 914}
!36 = !{!6, !16, i64 922}
!37 = !{!6, !16, i64 924}
!38 = !{!6, !16, i64 842}
!39 = !{!6, !16, i64 926}
!40 = !{!6, !16, i64 928}
!41 = !{!6, !13, i64 832}
!42 = !{!6, !7, i64 160}
!43 = !{!23, !13, i64 96}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,SimplifyCFGPass