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

; 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_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_DHCP4_MODE_DATA = type { i32, %struct.EFI_DHCP4_CONFIG_DATA, %struct.EFI_IPv4_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i32, ptr }
%struct.EFI_DHCP4_CONFIG_DATA = type { i32, ptr, i32, ptr, %struct.EFI_IPv4_ADDRESS, ptr, ptr, i32, ptr }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct._IP4_CONFIG_INSTANCE = type { i32, ptr, ptr, ptr, %struct._EFI_IP4_CONFIG_PROTOCOL, %struct._EFI_HII_CONFIG_ACCESS_PROTOCOL, ptr, ptr, ptr, %struct._IP4CONFIG_CALLBACK_INFO, i64, ptr, ptr, ptr, ptr, i64, %struct.NIC_ADDR, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8 }
%struct._EFI_IP4_CONFIG_PROTOCOL = type { ptr, ptr, ptr }
%struct._EFI_HII_CONFIG_ACCESS_PROTOCOL = type { ptr, ptr, ptr }
%struct._IP4CONFIG_CALLBACK_INFO = type { i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS }
%struct.NIC_ADDR = type { i16, i8, %struct.EFI_MAC_ADDRESS }
%struct._EFI_DHCP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NIC_IP4_CONFIG_INFO = type { %struct.NIC_ADDR, i32, i8, %struct.EFI_IP4_IPCONFIG_DATA }
%struct.EFI_IP4_IPCONFIG_DATA = type { %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i32, ptr }
%struct.EFI_IP4_ROUTE_TABLE = type { %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS }
%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 }

@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [157 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

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

declare void @FreePool(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @EfiNicIp4ConfigSetInfo(ptr noundef, ptr noundef, i8 noundef zeroext) #2

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

declare i64 @DispatchDpc() #1

; Function Attrs: nounwind uwtable
define dso_local void @Ip4ConfigOnDhcp4Complete(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.EFI_DHCP4_MODE_DATA, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 144, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %13, ptr %5, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %2
  %15 = call zeroext i8 @DebugAssertEnabled()
  %16 = icmp ne i8 %15, 0
  br i1 %16, label %17, label %24

17:                                               ; preds = %14
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %18, i32 0, i32 19
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = icmp ne ptr %20, null
  br i1 %21, label %23, label %22

22:                                               ; preds = %17
  call void @DebugAssert(ptr noundef @.str, i64 noundef 185, ptr noundef @.str.1)
  br label %23

23:                                               ; preds = %22, %17
  br label %24

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

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %27, i32 0, i32 10
  store i64 2, ptr %28, align 8, !tbaa !19
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %29, i32 0, i32 15
  store i64 -9223372036854775790, ptr %30, align 8, !tbaa !20
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %31, i32 0, i32 19
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct._EFI_DHCP4_PROTOCOL, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !21
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %36, i32 0, i32 19
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = call i64 %35(ptr noundef %38, ptr noundef %6)
  store i64 %39, ptr %8, align 8, !tbaa !23
  %40 = load i64, ptr %8, align 8, !tbaa !23
  %41 = icmp slt i64 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %26
  br label %185

43:                                               ; preds = %26
  %44 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %6, i32 0, i32 0
  %45 = load i32, ptr %44, align 8, !tbaa !24
  %46 = icmp eq i32 %45, 4
  br i1 %46, label %47, label %184

47:                                               ; preds = %43
  store i8 0, ptr %9, align 1, !tbaa !27
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %48, i32 0, i32 18
  %50 = load ptr, ptr %49, align 8, !tbaa !28
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %76

52:                                               ; preds = %47
  br label %53

53:                                               ; preds = %52
  %54 = call zeroext i8 @DebugAssertEnabled()
  %55 = icmp ne i8 %54, 0
  br i1 %55, label %56, label %65

56:                                               ; preds = %53
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %57, i32 0, i32 18
  %59 = load ptr, ptr %58, align 8, !tbaa !28
  %60 = getelementptr inbounds %struct.NIC_IP4_CONFIG_INFO, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !29
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %64, label %63

63:                                               ; preds = %56
  call void @DebugAssert(ptr noundef @.str, i64 noundef 208, ptr noundef @.str.2)
  br label %64

64:                                               ; preds = %63, %56
  br label %65

65:                                               ; preds = %64, %53
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %68, i32 0, i32 18
  %70 = load ptr, ptr %69, align 8, !tbaa !28
  %71 = getelementptr inbounds %struct.NIC_IP4_CONFIG_INFO, ptr %70, i32 0, i32 2
  %72 = load i8, ptr %71, align 8, !tbaa !32
  store i8 %72, ptr %9, align 1, !tbaa !27
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %73, i32 0, i32 18
  %75 = load ptr, ptr %74, align 8, !tbaa !28
  call void @FreePool(ptr noundef %75)
  br label %76

76:                                               ; preds = %67, %47
  %77 = call ptr @AllocatePool(i64 noundef 96)
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %78, i32 0, i32 18
  store ptr %77, ptr %79, align 8, !tbaa !28
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %80, i32 0, i32 18
  %82 = load ptr, ptr %81, align 8, !tbaa !28
  %83 = icmp eq ptr %82, null
  br i1 %83, label %84, label %87

84:                                               ; preds = %76
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %85, i32 0, i32 15
  store i64 -9223372036854775799, ptr %86, align 8, !tbaa !20
  br label %185

87:                                               ; preds = %76
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %88, i32 0, i32 18
  %90 = load ptr, ptr %89, align 8, !tbaa !28
  %91 = getelementptr inbounds %struct.NIC_IP4_CONFIG_INFO, ptr %90, i64 1
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %92, i32 0, i32 18
  %94 = load ptr, ptr %93, align 8, !tbaa !28
  %95 = getelementptr inbounds %struct.NIC_IP4_CONFIG_INFO, ptr %94, i32 0, i32 3
  %96 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %95, i32 0, i32 3
  store ptr %91, ptr %96, align 8, !tbaa !33
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %97, i32 0, i32 18
  %99 = load ptr, ptr %98, align 8, !tbaa !28
  %100 = getelementptr inbounds %struct.NIC_IP4_CONFIG_INFO, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %101, i32 0, i32 16
  %103 = call ptr @CopyMem(ptr noundef %100, ptr noundef %102, i64 noundef 36)
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %104, i32 0, i32 18
  %106 = load ptr, ptr %105, align 8, !tbaa !28
  %107 = getelementptr inbounds %struct.NIC_IP4_CONFIG_INFO, ptr %106, i32 0, i32 1
  store i32 0, ptr %107, align 4, !tbaa !29
  %108 = load i8, ptr %9, align 1, !tbaa !27
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %109, i32 0, i32 18
  %111 = load ptr, ptr %110, align 8, !tbaa !28
  %112 = getelementptr inbounds %struct.NIC_IP4_CONFIG_INFO, ptr %111, i32 0, i32 2
  store i8 %108, ptr %112, align 8, !tbaa !32
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %113, i32 0, i32 18
  %115 = load ptr, ptr %114, align 8, !tbaa !28
  %116 = getelementptr inbounds %struct.NIC_IP4_CONFIG_INFO, ptr %115, i32 0, i32 3
  store ptr %116, ptr %7, align 8, !tbaa !5
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %117, i32 0, i32 0
  %119 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %6, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %118, ptr align 8 %119, i64 4, i1 false), !tbaa.struct !34
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %120, i32 0, i32 1
  %122 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %6, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %121, ptr align 4 %122, i64 4, i1 false), !tbaa.struct !34
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %123, i32 0, i32 2
  store i32 1, ptr %124, align 8, !tbaa !35
  %125 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %6, i32 0, i32 2
  %126 = call ptr @CopyMem(ptr noundef %11, ptr noundef %125, i64 noundef 4)
  %127 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %6, i32 0, i32 6
  %128 = call ptr @CopyMem(ptr noundef %12, ptr noundef %127, i64 noundef 4)
  %129 = load i32, ptr %11, align 4, !tbaa !36
  %130 = load i32, ptr %12, align 4, !tbaa !36
  %131 = and i32 %129, %130
  store i32 %131, ptr %10, align 4, !tbaa !36
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %132, i32 0, i32 3
  %134 = load ptr, ptr %133, align 8, !tbaa !37
  %135 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %134, i64 0
  %136 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %135, i32 0, i32 0
  %137 = call ptr @CopyMem(ptr noundef %136, ptr noundef %10, i64 noundef 4)
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %138, i32 0, i32 3
  %140 = load ptr, ptr %139, align 8, !tbaa !37
  %141 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %140, i64 0
  %142 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %141, i32 0, i32 1
  %143 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %6, i32 0, i32 6
  %144 = call ptr @CopyMem(ptr noundef %142, ptr noundef %143, i64 noundef 4)
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %145, i32 0, i32 3
  %147 = load ptr, ptr %146, align 8, !tbaa !37
  %148 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %147, i64 0
  %149 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %148, i32 0, i32 2
  %150 = call ptr @ZeroMem(ptr noundef %149, i64 noundef 4)
  %151 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %6, i32 0, i32 5
  %152 = call i64 @CompareMem(ptr noundef %151, ptr noundef @mZeroIp4Addr, i64 noundef 4)
  %153 = icmp eq i64 %152, 0
  br i1 %153, label %176, label %154

154:                                              ; preds = %87
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %155, i32 0, i32 2
  store i32 2, ptr %156, align 8, !tbaa !35
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %157, i32 0, i32 3
  %159 = load ptr, ptr %158, align 8, !tbaa !37
  %160 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %159, i64 1
  %161 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %160, i32 0, i32 0
  %162 = call ptr @ZeroMem(ptr noundef %161, i64 noundef 4)
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %163, i32 0, i32 3
  %165 = load ptr, ptr %164, align 8, !tbaa !37
  %166 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %165, i64 1
  %167 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %166, i32 0, i32 1
  %168 = call ptr @ZeroMem(ptr noundef %167, i64 noundef 4)
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.EFI_IP4_IPCONFIG_DATA, ptr %169, i32 0, i32 3
  %171 = load ptr, ptr %170, align 8, !tbaa !37
  %172 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %171, i64 1
  %173 = getelementptr inbounds %struct.EFI_IP4_ROUTE_TABLE, ptr %172, i32 0, i32 2
  %174 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %6, i32 0, i32 5
  %175 = call ptr @CopyMem(ptr noundef %173, ptr noundef %174, i64 noundef 4)
  br label %176

176:                                              ; preds = %154, %87
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %177, i32 0, i32 15
  store i64 0, ptr %178, align 8, !tbaa !20
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %180, i32 0, i32 18
  %182 = load ptr, ptr %181, align 8, !tbaa !28
  %183 = call i64 @EfiNicIp4ConfigSetInfo(ptr noundef %179, ptr noundef %182, i8 noundef zeroext 0)
  br label %184

184:                                              ; preds = %176, %43
  br label %185

185:                                              ; preds = %184, %84, %42
  %186 = load ptr, ptr @gBS, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %186, i32 0, i32 11
  %188 = load ptr, ptr %187, align 8, !tbaa !38
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct._IP4_CONFIG_INSTANCE, ptr %189, i32 0, i32 13
  %191 = load ptr, ptr %190, align 8, !tbaa !41
  %192 = call i64 %188(ptr noundef %191)
  %193 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Ip4ConfigCleanDhcp4(ptr noundef %193)
  %194 = call i64 @DispatchDpc()
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 144, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

declare zeroext i8 @DebugAssertEnabled() #1

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

declare ptr @AllocatePool(i64 noundef) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @Ip4ConfigCleanDhcp4(ptr noundef) #2

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 224}
!10 = !{!"_IP4_CONFIG_INSTANCE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !13, i64 56, !6, i64 80, !6, i64 88, !6, i64 96, !14, i64 104, !16, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !16, i64 160, !17, i64 168, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !7, i64 256, !7, i64 257}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_EFI_IP4_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!13 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!14 = !{!"_IP4CONFIG_CALLBACK_INFO", !7, i64 0, !7, i64 1, !15, i64 2, !15, i64 6, !15, i64 10}
!15 = !{!"", !7, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = !{!"", !18, i64 0, !7, i64 2, !15, i64 3}
!18 = !{!"short", !7, i64 0}
!19 = !{!10, !16, i64 120}
!20 = !{!10, !16, i64 160}
!21 = !{!22, !6, i64 0}
!22 = !{!"_EFI_DHCP4_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, !6, i64 64}
!23 = !{!16, !16, i64 0}
!24 = !{!25, !11, i64 0}
!25 = !{!"", !11, i64 0, !26, i64 8, !15, i64 80, !15, i64 84, !15, i64 116, !15, i64 120, !15, i64 124, !11, i64 128, !6, i64 136}
!26 = !{!"", !11, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !15, i64 32, !6, i64 40, !6, i64 48, !11, i64 56, !6, i64 64}
!27 = !{!7, !7, i64 0}
!28 = !{!10, !6, i64 216}
!29 = !{!30, !11, i64 36}
!30 = !{!"", !17, i64 0, !11, i64 36, !7, i64 40, !31, i64 48}
!31 = !{!"", !15, i64 0, !15, i64 4, !11, i64 8, !6, i64 16}
!32 = !{!30, !7, i64 40}
!33 = !{!30, !6, i64 64}
!34 = !{i64 0, i64 4, !27}
!35 = !{!31, !11, i64 8}
!36 = !{!11, !11, i64 0}
!37 = !{!31, !6, i64 16}
!38 = !{!39, !6, i64 104}
!39 = !{!"", !40, 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}
!40 = !{!"", !16, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!41 = !{!10, !6, i64 144}


; 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_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_DHCP4_MODE_DATA = type { i32, %struct.EFI_DHCP4_CONFIG_DATA, %struct.EFI_IPv4_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i32, ptr }
%struct.EFI_DHCP4_CONFIG_DATA = type { i32, ptr, i32, ptr, %struct.EFI_IPv4_ADDRESS, ptr, ptr, i32, ptr }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }

@gBS = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [157 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

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

declare void @FreePool(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @EfiNicIp4ConfigSetInfo(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #2

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

declare i64 @DispatchDpc() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @Ip4ConfigOnDhcp4Complete(ptr nocapture noundef readnone %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.EFI_DHCP4_MODE_DATA, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  %7 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %7, 0
  br i1 %.not, label %12, label %8

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %1, i64 224
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %.not39 = icmp eq ptr %10, null
  br i1 %.not39, label %11, label %12

11:                                               ; preds = %8
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 185, ptr noundef nonnull @.str.1) #3
  br label %12

12:                                               ; preds = %8, %11, %2
  %13 = getelementptr inbounds i8, ptr %1, i64 120
  store i64 2, ptr %13, align 8, !tbaa !18
  %14 = getelementptr inbounds i8, ptr %1, i64 160
  store i64 -9223372036854775790, ptr %14, align 8, !tbaa !19
  %15 = getelementptr inbounds i8, ptr %1, i64 224
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = load ptr, ptr %16, align 8, !tbaa !20
  %18 = call i64 %17(ptr noundef nonnull %16, ptr noundef nonnull %3) #3
  %19 = icmp sgt i64 %18, -1
  %20 = load i32, ptr %3, align 8
  %21 = icmp eq i32 %20, 4
  %or.cond = select i1 %19, i1 %21, i1 false
  br i1 %or.cond, label %22, label %85

22:                                               ; preds = %12
  %23 = getelementptr inbounds i8, ptr %1, i64 216
  %24 = load ptr, ptr %23, align 8, !tbaa !22
  %.not40 = icmp eq ptr %24, null
  br i1 %.not40, label %36, label %25

25:                                               ; preds = %22
  %26 = call zeroext i8 @DebugAssertEnabled() #3
  %.not41 = icmp eq i8 %26, 0
  %.pre42 = load ptr, ptr %23, align 8, !tbaa !22
  br i1 %.not41, label %32, label %27

27:                                               ; preds = %25
  %28 = getelementptr inbounds i8, ptr %.pre42, i64 36
  %29 = load i32, ptr %28, align 4, !tbaa !23
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 208, ptr noundef nonnull @.str.2) #3
  %.pre = load ptr, ptr %23, align 8, !tbaa !22
  br label %32

32:                                               ; preds = %27, %31, %25
  %33 = phi ptr [ %.pre42, %27 ], [ %.pre, %31 ], [ %.pre42, %25 ]
  %34 = getelementptr inbounds i8, ptr %33, i64 40
  %35 = load i8, ptr %34, align 8, !tbaa !26
  call void @FreePool(ptr noundef %33) #3
  br label %36

36:                                               ; preds = %32, %22
  %.0 = phi i8 [ %35, %32 ], [ 0, %22 ]
  %37 = call ptr @AllocatePool(i64 noundef 96) #3
  store ptr %37, ptr %23, align 8, !tbaa !22
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  store i64 -9223372036854775799, ptr %14, align 8, !tbaa !19
  br label %85

40:                                               ; preds = %36
  %41 = getelementptr inbounds i8, ptr %37, i64 72
  %42 = getelementptr inbounds i8, ptr %37, i64 64
  store ptr %41, ptr %42, align 8, !tbaa !27
  %43 = getelementptr inbounds i8, ptr %1, i64 168
  %44 = call ptr @CopyMem(ptr noundef nonnull %37, ptr noundef nonnull %43, i64 noundef 36) #3
  %45 = load ptr, ptr %23, align 8, !tbaa !22
  %46 = getelementptr inbounds i8, ptr %45, i64 36
  store i32 0, ptr %46, align 4, !tbaa !23
  %47 = getelementptr inbounds i8, ptr %45, i64 40
  store i8 %.0, ptr %47, align 8, !tbaa !26
  %48 = getelementptr inbounds i8, ptr %45, i64 48
  %49 = getelementptr inbounds i8, ptr %3, i64 80
  %50 = load i32, ptr %49, align 8, !tbaa !28
  store i32 %50, ptr %48, align 8, !tbaa !28
  %51 = getelementptr inbounds i8, ptr %45, i64 52
  %52 = getelementptr inbounds i8, ptr %3, i64 124
  %53 = load i32, ptr %52, align 4, !tbaa !28
  store i32 %53, ptr %51, align 4, !tbaa !28
  %54 = getelementptr inbounds i8, ptr %45, i64 56
  store i32 1, ptr %54, align 8, !tbaa !29
  %55 = call ptr @CopyMem(ptr noundef nonnull %5, ptr noundef nonnull %49, i64 noundef 4) #3
  %56 = call ptr @CopyMem(ptr noundef nonnull %6, ptr noundef nonnull %52, i64 noundef 4) #3
  %57 = load i32, ptr %5, align 4, !tbaa !30
  %58 = load i32, ptr %6, align 4, !tbaa !30
  %59 = and i32 %58, %57
  store i32 %59, ptr %4, align 4, !tbaa !30
  %60 = getelementptr inbounds i8, ptr %45, i64 64
  %61 = load ptr, ptr %60, align 8, !tbaa !31
  %62 = call ptr @CopyMem(ptr noundef %61, ptr noundef nonnull %4, i64 noundef 4) #3
  %63 = load ptr, ptr %60, align 8, !tbaa !31
  %64 = getelementptr inbounds i8, ptr %63, i64 4
  %65 = call ptr @CopyMem(ptr noundef nonnull %64, ptr noundef nonnull %52, i64 noundef 4) #3
  %66 = load ptr, ptr %60, align 8, !tbaa !31
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  %68 = call ptr @ZeroMem(ptr noundef nonnull %67, i64 noundef 4) #3
  %69 = getelementptr inbounds i8, ptr %3, i64 120
  %70 = call i64 @CompareMem(ptr noundef nonnull %69, ptr noundef nonnull @mZeroIp4Addr, i64 noundef 4) #3
  %71 = icmp eq i64 %70, 0
  br i1 %71, label %82, label %72

72:                                               ; preds = %40
  store i32 2, ptr %54, align 8, !tbaa !29
  %73 = load ptr, ptr %60, align 8, !tbaa !31
  %74 = getelementptr inbounds i8, ptr %73, i64 12
  %75 = call ptr @ZeroMem(ptr noundef nonnull %74, i64 noundef 4) #3
  %76 = load ptr, ptr %60, align 8, !tbaa !31
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  %78 = call ptr @ZeroMem(ptr noundef nonnull %77, i64 noundef 4) #3
  %79 = load ptr, ptr %60, align 8, !tbaa !31
  %80 = getelementptr inbounds i8, ptr %79, i64 20
  %81 = call ptr @CopyMem(ptr noundef nonnull %80, ptr noundef nonnull %69, i64 noundef 4) #3
  br label %82

82:                                               ; preds = %72, %40
  store i64 0, ptr %14, align 8, !tbaa !19
  %83 = load ptr, ptr %23, align 8, !tbaa !22
  %84 = call i64 @EfiNicIp4ConfigSetInfo(ptr noundef nonnull %1, ptr noundef %83, i8 noundef zeroext 0)
  br label %85

85:                                               ; preds = %82, %12, %39
  %86 = load ptr, ptr @gBS, align 8, !tbaa !32
  %87 = getelementptr inbounds i8, ptr %86, i64 104
  %88 = load ptr, ptr %87, align 8, !tbaa !33
  %89 = getelementptr inbounds i8, ptr %1, i64 144
  %90 = load ptr, ptr %89, align 8, !tbaa !36
  %91 = call i64 %88(ptr noundef %90) #3
  call void @Ip4ConfigCleanDhcp4(ptr noundef nonnull %1)
  %92 = call i64 @DispatchDpc() #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %3) #3
  ret void
}

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @Ip4ConfigCleanDhcp4(ptr noundef) local_unnamed_addr #2

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, !10, i64 224}
!6 = !{!"_IP4_CONFIG_INSTANCE", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !11, i64 32, !12, i64 56, !10, i64 80, !10, i64 88, !10, i64 96, !13, i64 104, !15, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !15, i64 160, !16, i64 168, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !8, i64 256, !8, i64 257}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_EFI_IP4_CONFIG_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16}
!12 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16}
!13 = !{!"_IP4CONFIG_CALLBACK_INFO", !8, i64 0, !8, i64 1, !14, i64 2, !14, i64 6, !14, i64 10}
!14 = !{!"", !8, i64 0}
!15 = !{!"long long", !8, i64 0}
!16 = !{!"", !17, i64 0, !8, i64 2, !14, i64 3}
!17 = !{!"short", !8, i64 0}
!18 = !{!6, !15, i64 120}
!19 = !{!6, !15, i64 160}
!20 = !{!21, !10, i64 0}
!21 = !{!"_EFI_DHCP4_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!22 = !{!6, !10, i64 216}
!23 = !{!24, !7, i64 36}
!24 = !{!"", !16, i64 0, !7, i64 36, !8, i64 40, !25, i64 48}
!25 = !{!"", !14, i64 0, !14, i64 4, !7, i64 8, !10, i64 16}
!26 = !{!24, !8, i64 40}
!27 = !{!24, !10, i64 64}
!28 = !{!8, !8, i64 0}
!29 = !{!25, !7, i64 8}
!30 = !{!7, !7, i64 0}
!31 = !{!25, !10, i64 16}
!32 = !{!10, !10, i64 0}
!33 = !{!34, !10, i64 104}
!34 = !{!"", !35, i64 0, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368}
!35 = !{!"", !15, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!36 = !{!6, !10, i64 144}


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