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

; 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.GUID = type { i32, i16, i16, [8 x i8] }
%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_SIMPLE_NETWORK_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, 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 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct._EFI_MANAGED_NETWORK_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@gBS = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [144 x i8], align 1
@gEfiManagedNetworkServiceBindingProtocolGuid = external global %struct.GUID, align 4
@.str.29 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [28 x i8], align 1
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4

; 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 ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #1

declare zeroext i8 @DebugAssertEnabled() #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @NetLibGetMacAddress(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.EFI_SIMPLE_NETWORK_MODE, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  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
  call void @llvm.lifetime.start.p0(i64 656, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  br label %17

17:                                               ; preds = %3
  %18 = call zeroext i8 @DebugAssertEnabled()
  %19 = icmp ne i8 %18, 0
  br i1 %19, label %20, label %25

20:                                               ; preds = %17
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  call void @DebugAssert(ptr noundef @.str.12, i64 noundef 2201, ptr noundef @.str.29)
  br label %24

24:                                               ; preds = %23, %20
  br label %25

25:                                               ; preds = %24, %17
  br label %26

26:                                               ; preds = %25
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  %29 = call zeroext i8 @DebugAssertEnabled()
  %30 = icmp ne i8 %29, 0
  br i1 %30, label %31, label %36

31:                                               ; preds = %28
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %35, label %34

34:                                               ; preds = %31
  call void @DebugAssert(ptr noundef @.str.12, i64 noundef 2202, ptr noundef @.str.30)
  br label %35

35:                                               ; preds = %34, %31
  br label %36

36:                                               ; preds = %35, %28
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  store ptr null, ptr %9, align 8, !tbaa !5
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call ptr @NetLibGetSnpHandle(ptr noundef %39, ptr noundef %9)
  store ptr %40, ptr %14, align 8, !tbaa !5
  %41 = load ptr, ptr %14, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %47

43:                                               ; preds = %38
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %44, i32 0, i32 15
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  store ptr %46, ptr %10, align 8, !tbaa !5
  br label %109

47:                                               ; preds = %38
  store ptr null, ptr %15, align 8, !tbaa !5
  %48 = load ptr, ptr @gBS, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %48, i32 0, i32 17
  %50 = load ptr, ptr %49, align 8, !tbaa !12
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = call i64 %50(ptr noundef %51, ptr noundef @gEfiManagedNetworkServiceBindingProtocolGuid, ptr noundef %13)
  store i64 %52, ptr %8, align 8, !tbaa !16
  %53 = load i64, ptr %8, align 8, !tbaa !16
  %54 = icmp slt i64 %53, 0
  br i1 %54, label %55, label %57

55:                                               ; preds = %47
  %56 = load i64, ptr %8, align 8, !tbaa !16
  store i64 %56, ptr %4, align 8
  store i32 1, ptr %16, align 4
  br label %127

57:                                               ; preds = %47
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %61 = load ptr, ptr %13, align 8, !tbaa !5
  %62 = call i64 %60(ptr noundef %61, ptr noundef %15)
  store i64 %62, ptr %8, align 8, !tbaa !16
  %63 = load i64, ptr %8, align 8, !tbaa !16
  %64 = icmp slt i64 %63, 0
  br i1 %64, label %65, label %67

65:                                               ; preds = %57
  %66 = load i64, ptr %8, align 8, !tbaa !16
  store i64 %66, ptr %4, align 8
  store i32 1, ptr %16, align 4
  br label %127

67:                                               ; preds = %57
  %68 = load ptr, ptr @gBS, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %68, i32 0, i32 17
  %70 = load ptr, ptr %69, align 8, !tbaa !12
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = call i64 %70(ptr noundef %71, ptr noundef @gEfiManagedNetworkProtocolGuid, ptr noundef %12)
  store i64 %72, ptr %8, align 8, !tbaa !16
  %73 = load i64, ptr %8, align 8, !tbaa !16
  %74 = icmp slt i64 %73, 0
  br i1 %74, label %75, label %83

75:                                               ; preds = %67
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr %76, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !19
  %79 = load ptr, ptr %13, align 8, !tbaa !5
  %80 = load ptr, ptr %15, align 8, !tbaa !5
  %81 = call i64 %78(ptr noundef %79, ptr noundef %80)
  %82 = load i64, ptr %8, align 8, !tbaa !16
  store i64 %82, ptr %4, align 8
  store i32 1, ptr %16, align 4
  br label %127

83:                                               ; preds = %67
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._EFI_MANAGED_NETWORK_PROTOCOL, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !20
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = call i64 %86(ptr noundef %87, ptr noundef null, ptr noundef %11)
  store i64 %88, ptr %8, align 8, !tbaa !16
  %89 = load i64, ptr %8, align 8, !tbaa !16
  %90 = icmp slt i64 %89, 0
  br i1 %90, label %91, label %102

91:                                               ; preds = %83
  %92 = load i64, ptr %8, align 8, !tbaa !16
  %93 = icmp ne i64 %92, -9223372036854775789
  br i1 %93, label %94, label %102

94:                                               ; preds = %91
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr %95, i32 0, i32 1
  %97 = load ptr, ptr %96, align 8, !tbaa !19
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = load ptr, ptr %15, align 8, !tbaa !5
  %100 = call i64 %97(ptr noundef %98, ptr noundef %99)
  %101 = load i64, ptr %8, align 8, !tbaa !16
  store i64 %101, ptr %4, align 8
  store i32 1, ptr %16, align 4
  br label %127

102:                                              ; preds = %91, %83
  store ptr %11, ptr %10, align 8, !tbaa !5
  %103 = load ptr, ptr %13, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !19
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = load ptr, ptr %15, align 8, !tbaa !5
  %108 = call i64 %105(ptr noundef %106, ptr noundef %107)
  br label %109

109:                                              ; preds = %102, %43
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !22
  %113 = zext i32 %112 to i64
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %113, ptr %114, align 8, !tbaa !16
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.EFI_MAC_ADDRESS, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds [32 x i8], ptr %116, i64 0, i64 0
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %118, i32 0, i32 11
  %120 = getelementptr inbounds %struct.EFI_MAC_ADDRESS, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds [32 x i8], ptr %120, i64 0, i64 0
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %122, i32 0, i32 1
  %124 = load i32, ptr %123, align 4, !tbaa !22
  %125 = zext i32 %124 to i64
  %126 = call ptr @CopyMem(ptr noundef %117, ptr noundef %121, i64 noundef %125)
  store i64 0, ptr %4, align 8
  store i32 1, ptr %16, align 4
  br label %127

127:                                              ; preds = %109, %94, %75, %65, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 656, ptr %11) #3
  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
  %128 = load i64, ptr %4, align 8
  ret i64 %128
}

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, !6, i64 120}
!10 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!11 = !{!"long long", !7, i64 0}
!12 = !{!13, !6, i64 152}
!13 = !{!"", !14, 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}
!14 = !{!"", !11, i64 0, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!15 = !{!"int", !7, i64 0}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !6, i64 0}
!18 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!19 = !{!18, !6, i64 8}
!20 = !{!21, !6, i64 0}
!21 = !{!"_EFI_MANAGED_NETWORK_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!22 = !{!23, !15, i64 4}
!23 = !{!"", !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, !24, i64 552, !24, i64 584, !24, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!24 = !{!"", !7, i64 0}


; 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.GUID = type { i32, i16, i16, [8 x i8] }
%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] }

@gBS = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [144 x i8], align 1
@gEfiManagedNetworkServiceBindingProtocolGuid = external global %struct.GUID, align 4
@.str.29 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [28 x i8], align 1
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4

; 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 ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

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 ptr @NetLibGetSnpHandle(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @NetLibGetMacAddress(ptr noundef %0, ptr noundef %1, ptr noundef writeonly %2) local_unnamed_addr #2 {
  %4 = alloca ptr, align 8
  %5 = alloca %struct.EFI_SIMPLE_NETWORK_MODE, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 656, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  %9 = tail call zeroext i8 @DebugAssertEnabled() #3
  %10 = icmp eq i8 %9, 0
  %11 = icmp ne ptr %1, null
  %or.cond3 = or i1 %11, %10
  br i1 %or.cond3, label %13, label %12

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

13:                                               ; preds = %3, %12
  %14 = tail call zeroext i8 @DebugAssertEnabled() #3
  %15 = icmp eq i8 %14, 0
  %16 = icmp ne ptr %2, null
  %or.cond5 = or i1 %16, %15
  br i1 %or.cond5, label %18, label %17

17:                                               ; preds = %13
  tail call void @DebugAssert(ptr noundef nonnull @.str.12, i64 noundef 2202, ptr noundef nonnull @.str.30) #3
  br label %18

18:                                               ; preds = %17, %13
  store ptr null, ptr %4, align 8, !tbaa !5
  %19 = call ptr @NetLibGetSnpHandle(ptr noundef %0, ptr noundef nonnull %4)
  %.not = icmp eq ptr %19, null
  br i1 %.not, label %24, label %20

20:                                               ; preds = %18
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 120
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  br label %59

24:                                               ; preds = %18
  store ptr null, ptr %8, align 8, !tbaa !5
  %25 = load ptr, ptr @gBS, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 152
  %27 = load ptr, ptr %26, align 8, !tbaa !12
  %28 = call i64 %27(ptr noundef %0, ptr noundef nonnull @gEfiManagedNetworkServiceBindingProtocolGuid, ptr noundef nonnull %7) #3
  %29 = icmp slt i64 %28, 0
  br i1 %29, label %65, label %30

30:                                               ; preds = %24
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = load ptr, ptr %31, align 8, !tbaa !16
  %33 = call i64 %32(ptr noundef nonnull %31, ptr noundef nonnull %8) #3
  %34 = icmp slt i64 %33, 0
  br i1 %34, label %65, label %35

35:                                               ; preds = %30
  %36 = load ptr, ptr @gBS, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %36, i64 152
  %38 = load ptr, ptr %37, align 8, !tbaa !12
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = call i64 %38(ptr noundef %39, ptr noundef nonnull @gEfiManagedNetworkProtocolGuid, ptr noundef nonnull %6) #3
  %41 = icmp slt i64 %40, 0
  br i1 %41, label %42, label %48

42:                                               ; preds = %35
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 8
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = call i64 %45(ptr noundef %43, ptr noundef %46) #3
  br label %65

48:                                               ; preds = %35
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  %51 = call i64 %50(ptr noundef nonnull %49, ptr noundef null, ptr noundef nonnull %5) #3
  %52 = icmp slt i64 %51, 0
  %53 = icmp ne i64 %51, -9223372036854775789
  %or.cond = and i1 %52, %53
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = load ptr, ptr %55, align 8, !tbaa !18
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = call i64 %56(ptr noundef %54, ptr noundef %57) #3
  br i1 %or.cond, label %65, label %59

59:                                               ; preds = %48, %20
  %.024 = phi ptr [ %23, %20 ], [ %5, %48 ]
  %60 = getelementptr inbounds i8, ptr %.024, i64 4
  %61 = load i32, ptr %60, align 4, !tbaa !21
  %62 = zext i32 %61 to i64
  store i64 %62, ptr %2, align 8, !tbaa !24
  %63 = getelementptr inbounds i8, ptr %.024, i64 552
  %64 = call ptr @CopyMem(ptr noundef %1, ptr noundef nonnull %63, i64 noundef %62) #3
  br label %65

65:                                               ; preds = %48, %30, %24, %59, %42
  %.0 = phi i64 [ 0, %59 ], [ %40, %42 ], [ %28, %24 ], [ %33, %30 ], [ %51, %48 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 656, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret i64 %.0
}

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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 120}
!10 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!11 = !{!"long long", !7, i64 0}
!12 = !{!13, !6, i64 152}
!13 = !{!"", !14, 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}
!14 = !{!"", !11, i64 0, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !6, i64 0}
!17 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!18 = !{!17, !6, i64 8}
!19 = !{!20, !6, i64 0}
!20 = !{!"_EFI_MANAGED_NETWORK_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!21 = !{!22, !15, i64 4}
!22 = !{!"", !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, !23, i64 552, !23, i64 584, !23, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!23 = !{!"", !7, i64 0}
!24 = !{!11, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass