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

; 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_IP4_ICMP_TYPE = type { i8, i8 }
%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._IP4_PROTOCOL = type { i32, %struct._EFI_IP4_PROTOCOL, ptr, i64, ptr, %struct._LIST_ENTRY, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct.EFI_LOCK, ptr, %struct._LIST_ENTRY, ptr, ptr, i32, ptr, i32, %struct.EFI_IP4_CONFIG_DATA }
%struct._EFI_IP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_IP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8, i32, i32 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_IP4_MODE_DATA = type { i8, i32, %struct.EFI_IP4_CONFIG_DATA, i8, i32, ptr, i32, ptr, i32, ptr }
%struct._IP4_SERVICE = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, i64, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, %struct.IP4_ASSEMBLE_TABLE, %struct.IGMP_SERVICE_DATA, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.IP4_ASSEMBLE_TABLE = type { [31 x %struct._LIST_ENTRY] }
%struct.IGMP_SERVICE_DATA = type { i64, %struct._LIST_ENTRY }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, 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._IP4_INTERFACE = type { i32, %struct._LIST_ENTRY, i64, i32, i32, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i32, %struct._LIST_ENTRY, i8 }
%struct._EFI_MANAGED_NETWORK_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [149 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@mIp4SupportedIcmp = external global [0 x %struct.EFI_IP4_ICMP_TYPE], align 1

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

19:                                               ; preds = %4
  store i64 -9223372036854775806, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %160

20:                                               ; preds = %4
  %21 = load ptr, ptr @gBS, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = call i64 %23(i64 noundef 8)
  store i64 %24, ptr %14, align 8, !tbaa !14
  %25 = call zeroext i8 @DebugAssertEnabled()
  %26 = zext i8 %25 to i32
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %38

28:                                               ; preds = %20
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = ptrtoint ptr %29 to i64
  %31 = sub i64 %30, ptrtoint (ptr getelementptr inbounds (%struct._IP4_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %32 = inttoptr i64 %31 to ptr
  %33 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !15
  %35 = icmp ne i32 %34, 1345605705
  br i1 %35, label %36, label %38

36:                                               ; preds = %28
  call void @DebugAssert(ptr noundef @.str, i64 noundef 388, ptr noundef @.str.1)
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  br label %43

38:                                               ; preds = %28, %20
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = ptrtoint ptr %39 to i64
  %41 = sub i64 %40, ptrtoint (ptr getelementptr inbounds (%struct._IP4_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %42 = inttoptr i64 %41 to ptr
  br label %43

43:                                               ; preds = %38, %36
  %44 = phi ptr [ %37, %36 ], [ %42, %38 ]
  store ptr %44, ptr %10, align 8, !tbaa !5
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %45, i32 0, i32 4
  %47 = load ptr, ptr %46, align 8, !tbaa !23
  store ptr %47, ptr %11, align 8, !tbaa !5
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %143

50:                                               ; preds = %43
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %51, i32 0, i32 3
  %53 = load i64, ptr %52, align 8, !tbaa !24
  %54 = icmp eq i64 %53, 1
  %55 = zext i1 %54 to i32
  %56 = trunc i32 %55 to i8
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %57, i32 0, i32 0
  store i8 %56, ptr %58, align 8, !tbaa !25
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %61, i32 0, i32 18
  %63 = call ptr @CopyMem(ptr noundef %60, ptr noundef %62, i64 noundef 28)
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %64, i32 0, i32 3
  store i8 0, ptr %65, align 4, !tbaa !27
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %66, i32 0, i32 17
  %68 = load i32, ptr %67, align 8, !tbaa !28
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %69, i32 0, i32 4
  store i32 %68, ptr %70, align 8, !tbaa !29
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %71, i32 0, i32 16
  %73 = load ptr, ptr %72, align 8, !tbaa !30
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %74, i32 0, i32 5
  store ptr %73, ptr %75, align 8, !tbaa !31
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %76, i32 0, i32 8
  store i32 23, ptr %77, align 8, !tbaa !32
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %78, i32 0, i32 9
  store ptr @mIp4SupportedIcmp, ptr %79, align 8, !tbaa !33
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %80, i32 0, i32 7
  store ptr null, ptr %81, align 8, !tbaa !34
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %82, i32 0, i32 6
  store i32 0, ptr %83, align 8, !tbaa !35
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._IP4_SERVICE, ptr %84, i32 0, i32 21
  %86 = load i32, ptr %85, align 8, !tbaa !36
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %87, i32 0, i32 1
  store i32 %86, ptr %88, align 4, !tbaa !43
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %89, i32 0, i32 0
  %91 = load i8, ptr %90, align 8, !tbaa !25
  %92 = icmp ne i8 %91, 0
  br i1 %92, label %93, label %142

93:                                               ; preds = %50
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %94, i32 0, i32 2
  store ptr %95, ptr %12, align 8, !tbaa !5
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %96, i32 0, i32 11
  %98 = load ptr, ptr %97, align 8, !tbaa !44
  %99 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %98, i32 0, i32 3
  %100 = load i32, ptr %99, align 8, !tbaa !45
  %101 = call i32 @SwapBytes32(i32 noundef %100)
  store i32 %101, ptr %15, align 4, !tbaa !47
  %102 = load ptr, ptr %12, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %102, i32 0, i32 6
  %104 = call ptr @CopyMem(ptr noundef %103, ptr noundef %15, i64 noundef 4)
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %105, i32 0, i32 11
  %107 = load ptr, ptr %106, align 8, !tbaa !44
  %108 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %107, i32 0, i32 4
  %109 = load i32, ptr %108, align 4, !tbaa !48
  %110 = call i32 @SwapBytes32(i32 noundef %109)
  store i32 %110, ptr %15, align 4, !tbaa !47
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %111, i32 0, i32 7
  %113 = call ptr @CopyMem(ptr noundef %112, ptr noundef %15, i64 noundef 4)
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %114, i32 0, i32 11
  %116 = load ptr, ptr %115, align 8, !tbaa !44
  %117 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %116, i32 0, i32 7
  %118 = load i8, ptr %117, align 8, !tbaa !49
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %119, i32 0, i32 3
  store i8 %118, ptr %120, align 4, !tbaa !27
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = call i64 @Ip4BuildEfiRouteTable(ptr noundef %121)
  store i64 %122, ptr %13, align 8, !tbaa !14
  %123 = load i64, ptr %13, align 8, !tbaa !14
  %124 = icmp slt i64 %123, 0
  br i1 %124, label %125, label %131

125:                                              ; preds = %93
  %126 = load ptr, ptr @gBS, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %126, i32 0, i32 2
  %128 = load ptr, ptr %127, align 8, !tbaa !50
  %129 = load i64, ptr %14, align 8, !tbaa !14
  call void %128(i64 noundef %129)
  %130 = load i64, ptr %13, align 8, !tbaa !14
  store i64 %130, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %160

131:                                              ; preds = %93
  %132 = load ptr, ptr %10, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %132, i32 0, i32 14
  %134 = load ptr, ptr %133, align 8, !tbaa !51
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %135, i32 0, i32 7
  store ptr %134, ptr %136, align 8, !tbaa !34
  %137 = load ptr, ptr %10, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %137, i32 0, i32 15
  %139 = load i32, ptr %138, align 8, !tbaa !52
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %140, i32 0, i32 6
  store i32 %139, ptr %141, align 8, !tbaa !35
  br label %142

142:                                              ; preds = %131, %50
  br label %143

143:                                              ; preds = %142, %43
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._IP4_SERVICE, ptr %144, i32 0, i32 13
  %146 = load ptr, ptr %145, align 8, !tbaa !53
  %147 = getelementptr inbounds %struct._EFI_MANAGED_NETWORK_PROTOCOL, ptr %146, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8, !tbaa !54
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct._IP4_SERVICE, ptr %149, i32 0, i32 13
  %151 = load ptr, ptr %150, align 8, !tbaa !53
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = call i64 %148(ptr noundef %151, ptr noundef %152, ptr noundef %153)
  store i64 %154, ptr %13, align 8, !tbaa !14
  %155 = load ptr, ptr @gBS, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %155, i32 0, i32 2
  %157 = load ptr, ptr %156, align 8, !tbaa !50
  %158 = load i64, ptr %14, align 8, !tbaa !14
  call void %157(i64 noundef %158)
  %159 = load i64, ptr %13, align 8, !tbaa !14
  store i64 %159, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %160

160:                                              ; preds = %143, %125, %19
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %161 = load i64, ptr %5, align 8
  ret i64 %161
}

; 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

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

declare i32 @SwapBytes32(i32 noundef) #2

declare i64 @Ip4BuildEfiRouteTable(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, !6, i64 24}
!10 = !{!"", !11, 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}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !12, i64 0}
!15 = !{!16, !13, i64 0}
!16 = !{!"_IP4_PROTOCOL", !13, i64 0, !17, i64 8, !6, i64 72, !12, i64 80, !6, i64 88, !18, i64 96, !19, i64 112, !19, i64 152, !18, i64 192, !18, i64 208, !20, i64 224, !6, i64 248, !18, i64 256, !6, i64 272, !6, i64 280, !13, i64 288, !6, i64 296, !13, i64 304, !21, i64 308}
!17 = !{!"_EFI_IP4_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}
!18 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!19 = !{!"", !18, i64 0, !18, i64 16, !12, i64 32}
!20 = !{!"", !12, i64 0, !12, i64 8, !13, i64 16}
!21 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !22, i64 6, !22, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !13, i64 20, !13, i64 24}
!22 = !{!"", !7, i64 0}
!23 = !{!16, !6, i64 88}
!24 = !{!16, !12, i64 80}
!25 = !{!26, !7, i64 0}
!26 = !{!"", !7, i64 0, !13, i64 4, !21, i64 8, !7, i64 36, !13, i64 40, !6, i64 48, !13, i64 56, !6, i64 64, !13, i64 72, !6, i64 80}
!27 = !{!26, !7, i64 36}
!28 = !{!16, !13, i64 304}
!29 = !{!26, !13, i64 40}
!30 = !{!16, !6, i64 296}
!31 = !{!26, !6, i64 48}
!32 = !{!26, !13, i64 72}
!33 = !{!26, !6, i64 80}
!34 = !{!26, !6, i64 64}
!35 = !{!26, !13, i64 56}
!36 = !{!37, !13, i64 1360}
!37 = !{!"_IP4_SERVICE", !13, i64 0, !38, i64 8, !12, i64 24, !12, i64 32, !18, i64 40, !18, i64 56, !6, i64 72, !6, i64 80, !22, i64 88, !39, i64 584, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !40, i64 640, !42, i64 660, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !13, i64 1360, !13, i64 1364}
!38 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!39 = !{!"", !12, i64 0, !18, i64 8}
!40 = !{!"", !13, i64 0, !13, i64 4, !41, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!41 = !{!"short", !7, i64 0}
!42 = !{!"", !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, !22, i64 552, !22, i64 584, !22, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!43 = !{!26, !13, i64 4}
!44 = !{!16, !6, i64 248}
!45 = !{!46, !13, i64 32}
!46 = !{!"_IP4_INTERFACE", !13, i64 0, !18, i64 8, !12, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !18, i64 96, !18, i64 112, !6, i64 128, !22, i64 136, !22, i64 168, !13, i64 200, !18, i64 208, !7, i64 224}
!47 = !{!13, !13, i64 0}
!48 = !{!46, !13, i64 36}
!49 = !{!46, !7, i64 48}
!50 = !{!10, !6, i64 32}
!51 = !{!16, !6, i64 280}
!52 = !{!16, !13, i64 288}
!53 = !{!37, !6, i64 632}
!54 = !{!55, !6, i64 0}
!55 = !{!"_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}


; 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_IP4_ICMP_TYPE = type { i8, i8 }

@gBS = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [149 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@mIp4SupportedIcmp = external global [0 x %struct.EFI_IP4_ICMP_TYPE], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiIp4GetModeData(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %6 = icmp eq ptr %0, null
  br i1 %6, label %74, label %7

7:                                                ; preds = %4
  %8 = load ptr, ptr @gBS, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 24
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %11 = tail call i64 %10(i64 noundef 8) #3
  %12 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %12, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre49 = add i64 %.pre, -8
  %.pre51 = inttoptr i64 %.pre49 to ptr
  br i1 %.not, label %._crit_edge, label %13

13:                                               ; preds = %7
  %14 = load i32, ptr %.pre51, align 8, !tbaa !14
  %.not46 = icmp eq i32 %14, 1345605705
  br i1 %.not46, label %._crit_edge, label %15

15:                                               ; preds = %13
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 388, ptr noundef nonnull @.str.1) #3
  br label %._crit_edge

._crit_edge:                                      ; preds = %7, %13, %15
  %16 = phi ptr [ %0, %15 ], [ %.pre51, %13 ], [ %.pre51, %7 ]
  %17 = getelementptr inbounds i8, ptr %16, i64 88
  %18 = load ptr, ptr %17, align 8, !tbaa !22
  %.not47 = icmp eq ptr %1, null
  br i1 %.not47, label %66, label %19

19:                                               ; preds = %._crit_edge
  %20 = getelementptr inbounds i8, ptr %16, i64 80
  %21 = load i64, ptr %20, align 8, !tbaa !23
  %22 = icmp eq i64 %21, 1
  %23 = zext i1 %22 to i8
  store i8 %23, ptr %1, align 8, !tbaa !24
  %24 = getelementptr inbounds i8, ptr %1, i64 8
  %25 = getelementptr inbounds i8, ptr %16, i64 308
  %26 = tail call ptr @CopyMem(ptr noundef nonnull %24, ptr noundef nonnull %25, i64 noundef 28) #3
  %27 = getelementptr inbounds i8, ptr %1, i64 36
  store i8 0, ptr %27, align 4, !tbaa !26
  %28 = getelementptr inbounds i8, ptr %16, i64 304
  %29 = load i32, ptr %28, align 8, !tbaa !27
  %30 = getelementptr inbounds i8, ptr %1, i64 40
  store i32 %29, ptr %30, align 8, !tbaa !28
  %31 = getelementptr inbounds i8, ptr %16, i64 296
  %32 = load ptr, ptr %31, align 8, !tbaa !29
  %33 = getelementptr inbounds i8, ptr %1, i64 48
  store ptr %32, ptr %33, align 8, !tbaa !30
  %34 = getelementptr inbounds i8, ptr %1, i64 72
  store i32 23, ptr %34, align 8, !tbaa !31
  %35 = getelementptr inbounds i8, ptr %1, i64 80
  store ptr @mIp4SupportedIcmp, ptr %35, align 8, !tbaa !32
  %36 = getelementptr inbounds i8, ptr %1, i64 64
  store ptr null, ptr %36, align 8, !tbaa !33
  %37 = getelementptr inbounds i8, ptr %1, i64 56
  store i32 0, ptr %37, align 8, !tbaa !34
  %38 = getelementptr inbounds i8, ptr %18, i64 1360
  %39 = load i32, ptr %38, align 8, !tbaa !35
  %40 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 %39, ptr %40, align 4, !tbaa !42
  %41 = load i8, ptr %1, align 8, !tbaa !24
  %.not48 = icmp eq i8 %41, 0
  br i1 %.not48, label %66, label %42

42:                                               ; preds = %19
  %43 = getelementptr inbounds i8, ptr %16, i64 248
  %44 = load ptr, ptr %43, align 8, !tbaa !43
  %45 = getelementptr inbounds i8, ptr %44, i64 32
  %46 = load i32, ptr %45, align 8, !tbaa !44
  %47 = tail call i32 @SwapBytes32(i32 noundef %46) #3
  store i32 %47, ptr %5, align 4, !tbaa !46
  %48 = getelementptr inbounds i8, ptr %1, i64 14
  %49 = call ptr @CopyMem(ptr noundef nonnull %48, ptr noundef nonnull %5, i64 noundef 4) #3
  %50 = load ptr, ptr %43, align 8, !tbaa !43
  %51 = getelementptr inbounds i8, ptr %50, i64 36
  %52 = load i32, ptr %51, align 4, !tbaa !47
  %53 = call i32 @SwapBytes32(i32 noundef %52) #3
  store i32 %53, ptr %5, align 4, !tbaa !46
  %54 = getelementptr inbounds i8, ptr %1, i64 18
  %55 = call ptr @CopyMem(ptr noundef nonnull %54, ptr noundef nonnull %5, i64 noundef 4) #3
  %56 = load ptr, ptr %43, align 8, !tbaa !43
  %57 = getelementptr inbounds i8, ptr %56, i64 48
  %58 = load i8, ptr %57, align 8, !tbaa !48
  store i8 %58, ptr %27, align 4, !tbaa !26
  %59 = call i64 @Ip4BuildEfiRouteTable(ptr noundef nonnull %16) #3
  %60 = icmp slt i64 %59, 0
  br i1 %60, label %.sink.split, label %61

61:                                               ; preds = %42
  %62 = getelementptr inbounds i8, ptr %16, i64 280
  %63 = load ptr, ptr %62, align 8, !tbaa !49
  store ptr %63, ptr %36, align 8, !tbaa !33
  %64 = getelementptr inbounds i8, ptr %16, i64 288
  %65 = load i32, ptr %64, align 8, !tbaa !50
  store i32 %65, ptr %37, align 8, !tbaa !34
  br label %66

66:                                               ; preds = %19, %61, %._crit_edge
  %67 = getelementptr inbounds i8, ptr %18, i64 632
  %68 = load ptr, ptr %67, align 8, !tbaa !51
  %69 = load ptr, ptr %68, align 8, !tbaa !52
  %70 = call i64 %69(ptr noundef nonnull %68, ptr noundef %2, ptr noundef %3) #3
  br label %.sink.split

.sink.split:                                      ; preds = %42, %66
  %.0.ph = phi i64 [ %70, %66 ], [ %59, %42 ]
  %71 = load ptr, ptr @gBS, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %71, i64 32
  %73 = load ptr, ptr %72, align 8, !tbaa !54
  call void %73(i64 noundef %11) #3
  br label %74

74:                                               ; preds = %.sink.split, %4
  %.0 = phi i64 [ -9223372036854775806, %4 ], [ %.0.ph, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  ret i64 %.0
}

; 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 @DebugAssertEnabled() local_unnamed_addr #2

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

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

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #2

declare i64 @Ip4BuildEfiRouteTable(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

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 = { 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 24}
!10 = !{!"", !11, 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}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"_IP4_PROTOCOL", !13, i64 0, !16, i64 8, !6, i64 72, !12, i64 80, !6, i64 88, !17, i64 96, !18, i64 112, !18, i64 152, !17, i64 192, !17, i64 208, !19, i64 224, !6, i64 248, !17, i64 256, !6, i64 272, !6, i64 280, !13, i64 288, !6, i64 296, !13, i64 304, !20, i64 308}
!16 = !{!"_EFI_IP4_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}
!17 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!18 = !{!"", !17, i64 0, !17, i64 16, !12, i64 32}
!19 = !{!"", !12, i64 0, !12, i64 8, !13, i64 16}
!20 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !21, i64 6, !21, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !13, i64 20, !13, i64 24}
!21 = !{!"", !7, i64 0}
!22 = !{!15, !6, i64 88}
!23 = !{!15, !12, i64 80}
!24 = !{!25, !7, i64 0}
!25 = !{!"", !7, i64 0, !13, i64 4, !20, i64 8, !7, i64 36, !13, i64 40, !6, i64 48, !13, i64 56, !6, i64 64, !13, i64 72, !6, i64 80}
!26 = !{!25, !7, i64 36}
!27 = !{!15, !13, i64 304}
!28 = !{!25, !13, i64 40}
!29 = !{!15, !6, i64 296}
!30 = !{!25, !6, i64 48}
!31 = !{!25, !13, i64 72}
!32 = !{!25, !6, i64 80}
!33 = !{!25, !6, i64 64}
!34 = !{!25, !13, i64 56}
!35 = !{!36, !13, i64 1360}
!36 = !{!"_IP4_SERVICE", !13, i64 0, !37, i64 8, !12, i64 24, !12, i64 32, !17, i64 40, !17, i64 56, !6, i64 72, !6, i64 80, !21, i64 88, !38, i64 584, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !39, i64 640, !41, i64 660, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !13, i64 1360, !13, i64 1364}
!37 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!38 = !{!"", !12, i64 0, !17, i64 8}
!39 = !{!"", !13, i64 0, !13, i64 4, !40, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!40 = !{!"short", !7, i64 0}
!41 = !{!"", !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, !21, i64 552, !21, i64 584, !21, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!42 = !{!25, !13, i64 4}
!43 = !{!15, !6, i64 248}
!44 = !{!45, !13, i64 32}
!45 = !{!"_IP4_INTERFACE", !13, i64 0, !17, i64 8, !12, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !17, i64 96, !17, i64 112, !6, i64 128, !21, i64 136, !21, i64 168, !13, i64 200, !17, i64 208, !7, i64 224}
!46 = !{!13, !13, i64 0}
!47 = !{!45, !13, i64 36}
!48 = !{!45, !7, i64 48}
!49 = !{!15, !6, i64 280}
!50 = !{!15, !13, i64 288}
!51 = !{!36, !6, i64 632}
!52 = !{!53, !6, i64 0}
!53 = !{!"_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}
!54 = !{!10, !6, i64 32}


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