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

; 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_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [152 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8

; Function Attrs: nounwind uwtable
declare dso_local i64 @PxeInit(ptr noundef, i16 noundef zeroext) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @SnpUndi32Initialize(ptr noundef %0, i64 noundef %1, i64 noundef %2) #0 {
  %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 i64, align 8
  %11 = 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 8, ptr %10) #3
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %3
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %134

15:                                               ; preds = %3
  %16 = call zeroext i8 @DebugAssertEnabled()
  %17 = zext i8 %16 to i32
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %19, label %29

19:                                               ; preds = %15
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = ptrtoint ptr %20 to i64
  %22 = sub i64 %21, ptrtoint (ptr getelementptr inbounds (%struct.SNP_DRIVER, ptr null, i32 0, i32 3) to i64)
  %23 = inttoptr i64 %22 to ptr
  %24 = getelementptr inbounds %struct.SNP_DRIVER, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !11
  %26 = icmp ne i32 %25, 1935961715
  br i1 %26, label %27, label %29

27:                                               ; preds = %19
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 180, ptr noundef @.str.5)
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  br label %34

29:                                               ; preds = %19, %15
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = ptrtoint ptr %30 to i64
  %32 = sub i64 %31, ptrtoint (ptr getelementptr inbounds (%struct.SNP_DRIVER, ptr null, i32 0, i32 3) to i64)
  %33 = inttoptr i64 %32 to ptr
  br label %34

34:                                               ; preds = %29, %27
  %35 = phi ptr [ %28, %27 ], [ %33, %29 ]
  store ptr %35, ptr %9, align 8, !tbaa !5
  %36 = load ptr, ptr @gBS, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  %39 = call i64 %38(i64 noundef 8)
  store i64 %39, ptr %10, align 8, !tbaa !9
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %43

42:                                               ; preds = %34
  store i64 -9223372036854775806, ptr %8, align 8, !tbaa !9
  br label %128

43:                                               ; preds = %34
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.SNP_DRIVER, ptr %44, i32 0, i32 4
  %46 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %45, i32 0, i32 0
  %47 = load i32, ptr %46, align 8, !tbaa !24
  switch i32 %47, label %49 [
    i32 1, label %50
    i32 0, label %48
  ]

48:                                               ; preds = %43
  store i64 -9223372036854775789, ptr %8, align 8, !tbaa !9
  br label %128

49:                                               ; preds = %43
  store i64 -9223372036854775801, ptr %8, align 8, !tbaa !9
  br label %128

50:                                               ; preds = %43
  %51 = load ptr, ptr @gBS, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %51, i32 0, i32 8
  %53 = load ptr, ptr %52, align 8, !tbaa !25
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.SNP_DRIVER, ptr %55, i32 0, i32 3
  %57 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %56, i32 0, i32 14
  %58 = call i64 %53(i32 noundef 256, i64 noundef 16, ptr noundef @SnpWaitForPacketNotify, ptr noundef %54, ptr noundef %57)
  store i64 %58, ptr %8, align 8, !tbaa !9
  %59 = load i64, ptr %8, align 8, !tbaa !9
  %60 = icmp slt i64 %59, 0
  br i1 %60, label %61, label %65

61:                                               ; preds = %50
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.SNP_DRIVER, ptr %62, i32 0, i32 3
  %64 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %63, i32 0, i32 14
  store ptr null, ptr %64, align 8, !tbaa !26
  store i64 -9223372036854775801, ptr %8, align 8, !tbaa !9
  br label %128

65:                                               ; preds = %50
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.SNP_DRIVER, ptr %66, i32 0, i32 4
  %68 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %67, i32 0, i32 9
  store i32 0, ptr %68, align 4, !tbaa !27
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.SNP_DRIVER, ptr %69, i32 0, i32 4
  %71 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %70, i32 0, i32 7
  store i32 0, ptr %71, align 4, !tbaa !28
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.SNP_DRIVER, ptr %72, i32 0, i32 4
  %74 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %73, i32 0, i32 10
  %75 = getelementptr inbounds [16 x %struct.EFI_MAC_ADDRESS], ptr %74, i64 0, i64 0
  %76 = call ptr @ZeroMem(ptr noundef %75, i64 noundef 512)
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.SNP_DRIVER, ptr %77, i32 0, i32 4
  %79 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %78, i32 0, i32 11
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.SNP_DRIVER, ptr %80, i32 0, i32 4
  %82 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %81, i32 0, i32 13
  %83 = call ptr @CopyMem(ptr noundef %79, ptr noundef %82, i64 noundef 32)
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.SNP_DRIVER, ptr %84, i32 0, i32 25
  %86 = getelementptr inbounds %struct.s_pxe_db_get_init_info, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !29
  %88 = zext i32 %87 to i64
  %89 = load i64, ptr %6, align 8, !tbaa !9
  %90 = add i64 %88, %89
  %91 = load i64, ptr %7, align 8, !tbaa !9
  %92 = add i64 %90, %91
  %93 = trunc i64 %92 to i32
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.SNP_DRIVER, ptr %94, i32 0, i32 11
  store i32 %93, ptr %95, align 4, !tbaa !30
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.SNP_DRIVER, ptr %96, i32 0, i32 4
  %98 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %97, i32 0, i32 17
  %99 = load i8, ptr %98, align 1, !tbaa !31
  %100 = icmp ne i8 %99, 0
  br i1 %100, label %101, label %110

101:                                              ; preds = %65
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = call i64 @PxeInit(ptr noundef %102, i16 noundef zeroext 0)
  %104 = icmp eq i64 %103, 0
  br i1 %104, label %105, label %109

105:                                              ; preds = %101
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.SNP_DRIVER, ptr %106, i32 0, i32 4
  %108 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %107, i32 0, i32 18
  store i8 1, ptr %108, align 4, !tbaa !32
  br label %128

109:                                              ; preds = %101
  br label %110

110:                                              ; preds = %109, %65
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.SNP_DRIVER, ptr %111, i32 0, i32 4
  %113 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %112, i32 0, i32 18
  store i8 0, ptr %113, align 4, !tbaa !32
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = call i64 @PxeInit(ptr noundef %114, i16 noundef zeroext 1)
  store i64 %115, ptr %8, align 8, !tbaa !9
  %116 = load i64, ptr %8, align 8, !tbaa !9
  %117 = icmp slt i64 %116, 0
  br i1 %117, label %118, label %127

118:                                              ; preds = %110
  %119 = load ptr, ptr @gBS, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %119, i32 0, i32 12
  %121 = load ptr, ptr %120, align 8, !tbaa !33
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.SNP_DRIVER, ptr %122, i32 0, i32 3
  %124 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %123, i32 0, i32 14
  %125 = load ptr, ptr %124, align 8, !tbaa !26
  %126 = call i64 %121(ptr noundef %125)
  br label %127

127:                                              ; preds = %118, %110
  br label %128

128:                                              ; preds = %127, %105, %61, %49, %48, %42
  %129 = load ptr, ptr @gBS, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %130, align 8, !tbaa !34
  %132 = load i64, ptr %10, align 8, !tbaa !9
  call void %131(i64 noundef %132)
  %133 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %133, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %134

134:                                              ; preds = %128, %14
  call void @llvm.lifetime.end.p0(i64 8, 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
  %135 = load i64, ptr %4, align 8
  ret i64 %135
}

declare void @SnpWaitForPacketNotify(ptr noundef, ptr noundef) #2

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

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

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 = !{!"long long", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"", !13, i64 0, !14, i64 8, !15, i64 32, !16, i64 160, !6, i64 816, !6, i64 824, !6, i64 832, !7, i64 840, !18, 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 = !{!"", !10, i64 0, !10, i64 8, !13, i64 16}
!15 = !{!"_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}
!16 = !{!"", !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, !17, i64 552, !17, i64 584, !17, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!17 = !{!"", !7, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{!"s_pxe_cdb", !18, i64 0, !18, i64 2, !18, i64 4, !18, i64 6, !10, i64 8, !10, i64 16, !18, i64 24, !18, i64 26, !18, i64 28, !18, i64 30}
!20 = !{!"s_pxe_db_get_init_info", !13, i64 0, !13, i64 4, !7, i64 8, !13, i64 24, !18, i64 28, !18, i64 30, !18, i64 32, !18, i64 34, !18, i64 36, !18, i64 38, !18, i64 40, !18, i64 42, !7, i64 44, !7, i64 45, !7, i64 46}
!21 = !{!22, !6, i64 24}
!22 = !{!"", !23, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!23 = !{!"", !10, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!24 = !{!12, !13, i64 160}
!25 = !{!22, !6, i64 80}
!26 = !{!12, !6, i64 144}
!27 = !{!12, !13, i64 196}
!28 = !{!12, !13, i64 188}
!29 = !{!12, !13, i64 960}
!30 = !{!12, !13, i64 844}
!31 = !{!12, !7, i64 811}
!32 = !{!12, !7, i64 812}
!33 = !{!22, !6, i64 112}
!34 = !{!22, !6, i64 32}


; 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.1 = external hidden unnamed_addr constant [152 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
declare dso_local i64 @PxeInit(ptr noundef, i16 noundef zeroext) local_unnamed_addr #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
define dso_local i64 @SnpUndi32Initialize(ptr noundef %0, i64 noundef %1, i64 noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %63, label %5

5:                                                ; preds = %3
  %6 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %6, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre35 = add i64 %.pre, -32
  %.pre37 = inttoptr i64 %.pre35 to ptr
  br i1 %.not, label %._crit_edge, label %7

7:                                                ; preds = %5
  %8 = load i32, ptr %.pre37, align 8, !tbaa !5
  %.not33 = icmp eq i32 %8, 1935961715
  br i1 %.not33, label %._crit_edge, label %9

9:                                                ; preds = %7
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 180, ptr noundef nonnull @.str.5) #2
  br label %._crit_edge

._crit_edge:                                      ; preds = %5, %7, %9
  %10 = phi ptr [ %0, %9 ], [ %.pre37, %7 ], [ %.pre37, %5 ]
  %11 = load ptr, ptr @gBS, align 8, !tbaa !19
  %12 = getelementptr inbounds i8, ptr %11, i64 24
  %13 = load ptr, ptr %12, align 8, !tbaa !20
  %14 = tail call i64 %13(i64 noundef 8) #2
  %15 = icmp eq ptr %10, null
  br i1 %15, label %59, label %16

16:                                               ; preds = %._crit_edge
  %17 = getelementptr inbounds i8, ptr %10, i64 160
  %18 = load i32, ptr %17, align 8, !tbaa !23
  switch i32 %18, label %19 [
    i32 1, label %20
    i32 0, label %59
  ]

19:                                               ; preds = %16
  br label %59

20:                                               ; preds = %16
  %21 = load ptr, ptr @gBS, align 8, !tbaa !19
  %22 = getelementptr inbounds i8, ptr %21, i64 80
  %23 = load ptr, ptr %22, align 8, !tbaa !24
  %24 = getelementptr inbounds i8, ptr %10, i64 144
  %25 = tail call i64 %23(i32 noundef 256, i64 noundef 16, ptr noundef nonnull @SnpWaitForPacketNotify, ptr noundef nonnull %10, ptr noundef nonnull %24) #2
  %26 = icmp slt i64 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %20
  store ptr null, ptr %24, align 8, !tbaa !25
  br label %59

28:                                               ; preds = %20
  %29 = getelementptr inbounds i8, ptr %10, i64 196
  store i32 0, ptr %29, align 4, !tbaa !26
  %30 = getelementptr inbounds i8, ptr %10, i64 188
  store i32 0, ptr %30, align 4, !tbaa !27
  %31 = getelementptr inbounds i8, ptr %10, i64 200
  %32 = tail call ptr @ZeroMem(ptr noundef nonnull %31, i64 noundef 512) #2
  %33 = getelementptr inbounds i8, ptr %10, i64 712
  %34 = getelementptr inbounds i8, ptr %10, i64 776
  %35 = tail call ptr @CopyMem(ptr noundef nonnull %33, ptr noundef nonnull %34, i64 noundef 32) #2
  %36 = getelementptr inbounds i8, ptr %10, i64 960
  %37 = load i32, ptr %36, align 8, !tbaa !28
  %38 = add i64 %2, %1
  %39 = trunc i64 %38 to i32
  %40 = add i32 %37, %39
  %41 = getelementptr inbounds i8, ptr %10, i64 844
  store i32 %40, ptr %41, align 4, !tbaa !29
  %42 = getelementptr inbounds i8, ptr %10, i64 811
  %43 = load i8, ptr %42, align 1, !tbaa !30
  %.not34 = icmp eq i8 %43, 0
  br i1 %.not34, label %49, label %44

44:                                               ; preds = %28
  %45 = tail call i64 @PxeInit(ptr noundef nonnull %10, i16 noundef zeroext 0)
  %46 = icmp eq i64 %45, 0
  br i1 %46, label %47, label %49

47:                                               ; preds = %44
  %48 = getelementptr inbounds i8, ptr %10, i64 812
  store i8 1, ptr %48, align 4, !tbaa !31
  br label %59

49:                                               ; preds = %44, %28
  %50 = getelementptr inbounds i8, ptr %10, i64 812
  store i8 0, ptr %50, align 4, !tbaa !31
  %51 = tail call i64 @PxeInit(ptr noundef nonnull %10, i16 noundef zeroext 1)
  %52 = icmp slt i64 %51, 0
  br i1 %52, label %53, label %59

53:                                               ; preds = %49
  %54 = load ptr, ptr @gBS, align 8, !tbaa !19
  %55 = getelementptr inbounds i8, ptr %54, i64 112
  %56 = load ptr, ptr %55, align 8, !tbaa !32
  %57 = load ptr, ptr %24, align 8, !tbaa !25
  %58 = tail call i64 %56(ptr noundef %57) #2
  br label %59

59:                                               ; preds = %16, %._crit_edge, %49, %53, %47, %27, %19
  %.028 = phi i64 [ -9223372036854775801, %19 ], [ -9223372036854775801, %27 ], [ %25, %47 ], [ %51, %53 ], [ %51, %49 ], [ -9223372036854775806, %._crit_edge ], [ -9223372036854775789, %16 ]
  %60 = load ptr, ptr @gBS, align 8, !tbaa !19
  %61 = getelementptr inbounds i8, ptr %60, i64 32
  %62 = load ptr, ptr %61, align 8, !tbaa !33
  tail call void %62(i64 noundef %14) #2
  br label %63

63:                                               ; preds = %3, %59
  %.0 = phi i64 [ %.028, %59 ], [ -9223372036854775806, %3 ]
  ret i64 %.0
}

declare void @SnpWaitForPacketNotify(ptr noundef, ptr noundef) #1

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!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 = !{!13, !13, i64 0}
!20 = !{!21, !13, i64 24}
!21 = !{!"", !22, i64 0, !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, i64 128, !13, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208, !13, i64 216, !13, i64 224, !13, i64 232, !13, i64 240, !13, i64 248, !13, i64 256, !13, i64 264, !13, i64 272, !13, i64 280, !13, i64 288, !13, i64 296, !13, i64 304, !13, i64 312, !13, i64 320, !13, i64 328, !13, i64 336, !13, i64 344, !13, i64 352, !13, i64 360, !13, i64 368}
!22 = !{!"", !11, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!23 = !{!6, !7, i64 160}
!24 = !{!21, !13, i64 80}
!25 = !{!6, !13, i64 144}
!26 = !{!6, !7, i64 196}
!27 = !{!6, !7, i64 188}
!28 = !{!6, !7, i64 960}
!29 = !{!6, !7, i64 844}
!30 = !{!6, !8, i64 811}
!31 = !{!6, !8, i64 812}
!32 = !{!21, !13, i64 112}
!33 = !{!21, !13, i64 32}


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