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

; 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_ARP_CONFIG_DATA = type { i16, i8, ptr, i32, i32, i32 }
%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_MAC_ADDRESS = type { [32 x i8] }
%struct._LIST_ENTRY = type { 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_ARP_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [147 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [117 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@gIp4AllMasks = external global [33 x i32], align 16
@gEfiArpServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiArpProtocolGuid = 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 zeroext i8 @DebugAssertEnabled() #1

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

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

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

17:                                               ; preds = %14
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %25

20:                                               ; preds = %17
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = icmp eq i32 %23, 1179209801
  br i1 %24, label %26, label %25

25:                                               ; preds = %20, %17
  call void @DebugAssert(ptr noundef @.str, i64 noundef 567, ptr noundef @.str.4)
  br label %26

26:                                               ; preds = %25, %20
  br label %27

27:                                               ; preds = %26, %14
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  %31 = call zeroext i8 @DebugAssertEnabled()
  %32 = icmp ne i8 %31, 0
  br i1 %32, label %33, label %40

33:                                               ; preds = %30
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %34, i32 0, i32 7
  %36 = load i8, ptr %35, align 8, !tbaa !16
  %37 = icmp ne i8 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %33
  call void @DebugAssert(ptr noundef @.str, i64 noundef 569, ptr noundef @.str.5)
  br label %39

39:                                               ; preds = %38, %33
  br label %40

40:                                               ; preds = %39, %30
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %44, i32 0, i32 3
  store i32 %43, ptr %45, align 8, !tbaa !17
  %46 = load i32, ptr %7, align 4, !tbaa !9
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %47, i32 0, i32 4
  store i32 %46, ptr %48, align 4, !tbaa !18
  %49 = load i32, ptr %6, align 4, !tbaa !9
  %50 = load i32, ptr %7, align 4, !tbaa !9
  %51 = xor i32 %50, -1
  %52 = or i32 %49, %51
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %53, i32 0, i32 5
  store i32 %52, ptr %54, align 8, !tbaa !19
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = call i64 @NetGetIpClass(i32 noundef %55)
  store i64 %56, ptr %10, align 8, !tbaa !20
  br label %57

57:                                               ; preds = %42
  %58 = call zeroext i8 @DebugAssertEnabled()
  %59 = icmp ne i8 %58, 0
  br i1 %59, label %60, label %65

60:                                               ; preds = %57
  %61 = load i64, ptr %10, align 8, !tbaa !20
  %62 = icmp sle i64 %61, 3
  br i1 %62, label %64, label %63

63:                                               ; preds = %60
  call void @DebugAssert(ptr noundef @.str, i64 noundef 584, ptr noundef @.str.6)
  br label %64

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

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

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %7, align 4, !tbaa !9
  %69 = call i64 @NetGetMaskLength(i32 noundef %68)
  store i64 %69, ptr %11, align 8, !tbaa !20
  br label %70

70:                                               ; preds = %67
  %71 = call zeroext i8 @DebugAssertEnabled()
  %72 = icmp ne i8 %71, 0
  br i1 %72, label %73, label %78

73:                                               ; preds = %70
  %74 = load i64, ptr %11, align 8, !tbaa !20
  %75 = icmp slt i64 %74, 33
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  call void @DebugAssert(ptr noundef @.str, i64 noundef 586, ptr noundef @.str.7)
  br label %77

77:                                               ; preds = %76, %73
  br label %78

78:                                               ; preds = %77, %70
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79
  %81 = load i64, ptr %11, align 8, !tbaa !20
  %82 = load i64, ptr %10, align 8, !tbaa !20
  %83 = shl i64 %82, 3
  %84 = icmp slt i64 %81, %83
  br i1 %84, label %85, label %87

85:                                               ; preds = %80
  %86 = load i64, ptr %11, align 8, !tbaa !20
  br label %90

87:                                               ; preds = %80
  %88 = load i64, ptr %10, align 8, !tbaa !20
  %89 = shl i64 %88, 3
  br label %90

90:                                               ; preds = %87, %85
  %91 = phi i64 [ %86, %85 ], [ %89, %87 ]
  %92 = getelementptr inbounds [33 x i32], ptr @gIp4AllMasks, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !9
  store i32 %93, ptr %12, align 4, !tbaa !9
  %94 = load i32, ptr %6, align 4, !tbaa !9
  %95 = load i32, ptr %12, align 4, !tbaa !9
  %96 = xor i32 %95, -1
  %97 = or i32 %94, %96
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %98, i32 0, i32 6
  store i32 %97, ptr %99, align 4, !tbaa !21
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %100, i32 0, i32 11
  store ptr null, ptr %101, align 8, !tbaa !22
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %102, i32 0, i32 12
  store ptr null, ptr %103, align 8, !tbaa !23
  %104 = load i32, ptr %6, align 4, !tbaa !9
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %174

106:                                              ; preds = %90
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %107, i32 0, i32 8
  %109 = load ptr, ptr %108, align 8, !tbaa !24
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %110, i32 0, i32 9
  %112 = load ptr, ptr %111, align 8, !tbaa !25
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %113, i32 0, i32 12
  %115 = call i64 @NetLibCreateServiceChild(ptr noundef %109, ptr noundef %112, ptr noundef @gEfiArpServiceBindingProtocolGuid, ptr noundef %114)
  store i64 %115, ptr %9, align 8, !tbaa !20
  %116 = load i64, ptr %9, align 8, !tbaa !20
  %117 = icmp slt i64 %116, 0
  br i1 %117, label %118, label %120

118:                                              ; preds = %106
  %119 = load i64, ptr %9, align 8, !tbaa !20
  store i64 %119, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %188

120:                                              ; preds = %106
  %121 = load ptr, ptr @gBS, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %121, i32 0, i32 33
  %123 = load ptr, ptr %122, align 8, !tbaa !26
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %124, i32 0, i32 12
  %126 = load ptr, ptr %125, align 8, !tbaa !23
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %127, i32 0, i32 11
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %129, i32 0, i32 9
  %131 = load ptr, ptr %130, align 8, !tbaa !25
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %132, i32 0, i32 8
  %134 = load ptr, ptr %133, align 8, !tbaa !24
  %135 = call i64 %123(ptr noundef %126, ptr noundef @gEfiArpProtocolGuid, ptr noundef %128, ptr noundef %131, ptr noundef %134, i32 noundef 16)
  store i64 %135, ptr %9, align 8, !tbaa !20
  %136 = load i64, ptr %9, align 8, !tbaa !20
  %137 = icmp slt i64 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %120
  br label %177

139:                                              ; preds = %120
  %140 = load i32, ptr %6, align 4, !tbaa !9
  %141 = call i32 @SwapBytes32(i32 noundef %140)
  store i32 %141, ptr %6, align 4, !tbaa !9
  %142 = getelementptr inbounds %struct.EFI_ARP_CONFIG_DATA, ptr %8, i32 0, i32 0
  store i16 2048, ptr %142, align 8, !tbaa !29
  %143 = getelementptr inbounds %struct.EFI_ARP_CONFIG_DATA, ptr %8, i32 0, i32 1
  store i8 4, ptr %143, align 2, !tbaa !32
  %144 = getelementptr inbounds %struct.EFI_ARP_CONFIG_DATA, ptr %8, i32 0, i32 2
  store ptr %6, ptr %144, align 8, !tbaa !33
  %145 = getelementptr inbounds %struct.EFI_ARP_CONFIG_DATA, ptr %8, i32 0, i32 3
  store i32 0, ptr %145, align 8, !tbaa !34
  %146 = getelementptr inbounds %struct.EFI_ARP_CONFIG_DATA, ptr %8, i32 0, i32 4
  store i32 0, ptr %146, align 4, !tbaa !35
  %147 = getelementptr inbounds %struct.EFI_ARP_CONFIG_DATA, ptr %8, i32 0, i32 5
  store i32 0, ptr %147, align 8, !tbaa !36
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %148, i32 0, i32 11
  %150 = load ptr, ptr %149, align 8, !tbaa !22
  %151 = getelementptr inbounds %struct._EFI_ARP_PROTOCOL, ptr %150, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !37
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %153, i32 0, i32 11
  %155 = load ptr, ptr %154, align 8, !tbaa !22
  %156 = call i64 %152(ptr noundef %155, ptr noundef %8)
  store i64 %156, ptr %9, align 8, !tbaa !20
  %157 = load i64, ptr %9, align 8, !tbaa !20
  %158 = icmp slt i64 %157, 0
  br i1 %158, label %159, label %173

159:                                              ; preds = %139
  %160 = load ptr, ptr @gBS, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %160, i32 0, i32 34
  %162 = load ptr, ptr %161, align 8, !tbaa !39
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %163, i32 0, i32 12
  %165 = load ptr, ptr %164, align 8, !tbaa !23
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %166, i32 0, i32 9
  %168 = load ptr, ptr %167, align 8, !tbaa !25
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %169, i32 0, i32 8
  %171 = load ptr, ptr %170, align 8, !tbaa !24
  %172 = call i64 %162(ptr noundef %165, ptr noundef @gEfiArpProtocolGuid, ptr noundef %168, ptr noundef %171)
  br label %177

173:                                              ; preds = %139
  br label %174

174:                                              ; preds = %173, %90
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %175, i32 0, i32 7
  store i8 1, ptr %176, align 8, !tbaa !16
  store i64 0, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %188

177:                                              ; preds = %159, %138
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %178, i32 0, i32 8
  %180 = load ptr, ptr %179, align 8, !tbaa !24
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %181, i32 0, i32 9
  %183 = load ptr, ptr %182, align 8, !tbaa !25
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %184, i32 0, i32 12
  %186 = call i64 @NetLibDestroyServiceChild(ptr noundef %180, ptr noundef %183, ptr noundef @gEfiArpServiceBindingProtocolGuid, ptr noundef %185)
  %187 = load i64, ptr %9, align 8, !tbaa !20
  store i64 %187, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %188

188:                                              ; preds = %177, %174, %118
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #3
  %189 = load i64, ptr %4, align 8
  ret i64 %189
}

declare i64 @NetGetIpClass(i32 noundef) #1

declare i64 @NetGetMaskLength(i32 noundef) #1

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

declare i32 @SwapBytes32(i32 noundef) #1

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

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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_IP4_INTERFACE", !10, i64 0, !13, i64 8, !14, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !13, i64 96, !13, i64 112, !6, i64 128, !15, i64 136, !15, i64 168, !10, i64 200, !13, i64 208, !7, i64 224}
!13 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!14 = !{!"long long", !7, i64 0}
!15 = !{!"", !7, i64 0}
!16 = !{!12, !7, i64 48}
!17 = !{!12, !10, i64 32}
!18 = !{!12, !10, i64 36}
!19 = !{!12, !10, i64 40}
!20 = !{!14, !14, i64 0}
!21 = !{!12, !10, i64 44}
!22 = !{!12, !6, i64 80}
!23 = !{!12, !6, i64 88}
!24 = !{!12, !6, i64 56}
!25 = !{!12, !6, i64 64}
!26 = !{!27, !6, i64 280}
!27 = !{!"", !28, 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}
!28 = !{!"", !14, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!29 = !{!30, !31, i64 0}
!30 = !{!"", !31, i64 0, !7, i64 2, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!31 = !{!"short", !7, i64 0}
!32 = !{!30, !7, i64 2}
!33 = !{!30, !6, i64 8}
!34 = !{!30, !10, i64 16}
!35 = !{!30, !10, i64 20}
!36 = !{!30, !10, i64 24}
!37 = !{!38, !6, i64 0}
!38 = !{!"_EFI_ARP_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!39 = !{!27, !6, i64 288}


; 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_ARP_CONFIG_DATA = type { i16, i8, ptr, i32, i32, i32 }

@gBS = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [147 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [117 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@gIp4AllMasks = external local_unnamed_addr global [33 x i32], align 16
@gEfiArpServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiArpProtocolGuid = 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 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 range(i64 -9223372036854775808, 1) i64 @Ip4SetAddress(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = alloca i32, align 4
  %5 = alloca %struct.EFI_ARP_CONFIG_DATA, align 8
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  %6 = tail call zeroext i8 @DebugAssertEnabled() #5
  %.not = icmp eq i8 %6, 0
  br i1 %.not, label %12, label %7

7:                                                ; preds = %3
  %.not48 = icmp eq ptr %0, null
  br i1 %.not48, label %11, label %8

8:                                                ; preds = %7
  %9 = load i32, ptr %0, align 8, !tbaa !9
  %10 = icmp eq i32 %9, 1179209801
  br i1 %10, label %12, label %11

11:                                               ; preds = %8, %7
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 567, ptr noundef nonnull @.str.4) #5
  br label %12

12:                                               ; preds = %3, %11, %8
  %13 = tail call zeroext i8 @DebugAssertEnabled() #5
  %.not49 = icmp eq i8 %13, 0
  br i1 %.not49, label %18, label %14

14:                                               ; preds = %12
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = load i8, ptr %15, align 8, !tbaa !15
  %.not50 = icmp eq i8 %16, 0
  br i1 %.not50, label %18, label %17

17:                                               ; preds = %14
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 569, ptr noundef nonnull @.str.5) #5
  br label %18

18:                                               ; preds = %14, %17, %12
  %19 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %1, ptr %19, align 8, !tbaa !16
  %20 = getelementptr inbounds i8, ptr %0, i64 36
  store i32 %2, ptr %20, align 4, !tbaa !17
  %21 = xor i32 %2, -1
  %22 = or i32 %21, %1
  %23 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 %22, ptr %23, align 8, !tbaa !18
  %24 = tail call i64 @NetGetIpClass(i32 noundef %1) #5
  %25 = tail call zeroext i8 @DebugAssertEnabled() #5
  %26 = icmp eq i8 %25, 0
  %27 = icmp slt i64 %24, 4
  %or.cond = select i1 %26, i1 true, i1 %27
  br i1 %or.cond, label %29, label %28

28:                                               ; preds = %18
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 584, ptr noundef nonnull @.str.6) #5
  br label %29

29:                                               ; preds = %28, %18
  %30 = tail call i64 @NetGetMaskLength(i32 noundef %2) #5
  %31 = tail call zeroext i8 @DebugAssertEnabled() #5
  %32 = icmp eq i8 %31, 0
  %33 = icmp slt i64 %30, 33
  %or.cond3 = select i1 %32, i1 true, i1 %33
  br i1 %or.cond3, label %35, label %34

34:                                               ; preds = %29
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 586, ptr noundef nonnull @.str.7) #5
  br label %35

35:                                               ; preds = %34, %29
  %36 = shl i64 %24, 3
  %37 = tail call i64 @llvm.smin.i64(i64 %30, i64 %36)
  %38 = getelementptr inbounds [33 x i32], ptr @gIp4AllMasks, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = xor i32 %39, -1
  %41 = or i32 %40, %1
  %42 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 %41, ptr %42, align 4, !tbaa !19
  %43 = getelementptr inbounds i8, ptr %0, i64 80
  %44 = getelementptr inbounds i8, ptr %0, i64 88
  %.not51 = icmp eq i32 %1, 0
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %43, i8 0, i64 16, i1 false)
  br i1 %.not51, label %80, label %45

45:                                               ; preds = %35
  %46 = getelementptr inbounds i8, ptr %0, i64 56
  %47 = load ptr, ptr %46, align 8, !tbaa !20
  %48 = getelementptr inbounds i8, ptr %0, i64 64
  %49 = load ptr, ptr %48, align 8, !tbaa !21
  %50 = tail call i64 @NetLibCreateServiceChild(ptr noundef %47, ptr noundef %49, ptr noundef nonnull @gEfiArpServiceBindingProtocolGuid, ptr noundef nonnull %44) #5
  %51 = icmp slt i64 %50, 0
  br i1 %51, label %86, label %52

52:                                               ; preds = %45
  %53 = load ptr, ptr @gBS, align 8, !tbaa !22
  %54 = getelementptr inbounds i8, ptr %53, i64 280
  %55 = load ptr, ptr %54, align 8, !tbaa !23
  %56 = load ptr, ptr %44, align 8, !tbaa !26
  %57 = load ptr, ptr %48, align 8, !tbaa !21
  %58 = load ptr, ptr %46, align 8, !tbaa !20
  %59 = tail call i64 %55(ptr noundef %56, ptr noundef nonnull @gEfiArpProtocolGuid, ptr noundef nonnull %43, ptr noundef %57, ptr noundef %58, i32 noundef 16) #5
  %60 = icmp slt i64 %59, 0
  br i1 %60, label %82, label %61

61:                                               ; preds = %52
  %62 = tail call i32 @SwapBytes32(i32 noundef %1) #5
  store i32 %62, ptr %4, align 4, !tbaa !5
  store i16 2048, ptr %5, align 8, !tbaa !27
  %63 = getelementptr inbounds i8, ptr %5, i64 2
  store i8 4, ptr %63, align 2, !tbaa !30
  %64 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %4, ptr %64, align 8, !tbaa !31
  %65 = getelementptr inbounds i8, ptr %5, i64 16
  store i32 0, ptr %65, align 8, !tbaa !32
  %66 = getelementptr inbounds i8, ptr %5, i64 20
  store i32 0, ptr %66, align 4, !tbaa !33
  %67 = getelementptr inbounds i8, ptr %5, i64 24
  store i32 0, ptr %67, align 8, !tbaa !34
  %68 = load ptr, ptr %43, align 8, !tbaa !35
  %69 = load ptr, ptr %68, align 8, !tbaa !36
  %70 = call i64 %69(ptr noundef nonnull %68, ptr noundef nonnull %5) #5
  %71 = icmp slt i64 %70, 0
  br i1 %71, label %72, label %80

72:                                               ; preds = %61
  %73 = load ptr, ptr @gBS, align 8, !tbaa !22
  %74 = getelementptr inbounds i8, ptr %73, i64 288
  %75 = load ptr, ptr %74, align 8, !tbaa !38
  %76 = load ptr, ptr %44, align 8, !tbaa !26
  %77 = load ptr, ptr %48, align 8, !tbaa !21
  %78 = load ptr, ptr %46, align 8, !tbaa !20
  %79 = call i64 %75(ptr noundef %76, ptr noundef nonnull @gEfiArpProtocolGuid, ptr noundef %77, ptr noundef %78) #5
  br label %82

80:                                               ; preds = %61, %35
  %81 = getelementptr inbounds i8, ptr %0, i64 48
  store i8 1, ptr %81, align 8, !tbaa !15
  br label %86

82:                                               ; preds = %52, %72
  %.043 = phi i64 [ %59, %52 ], [ %70, %72 ]
  %83 = load ptr, ptr %46, align 8, !tbaa !20
  %84 = load ptr, ptr %48, align 8, !tbaa !21
  %85 = call i64 @NetLibDestroyServiceChild(ptr noundef %83, ptr noundef %84, ptr noundef nonnull @gEfiArpServiceBindingProtocolGuid, ptr noundef nonnull %44) #5
  br label %86

86:                                               ; preds = %45, %82, %80
  %.0 = phi i64 [ %.043, %82 ], [ 0, %80 ], [ %50, %45 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  ret i64 %.0
}

declare i64 @NetGetIpClass(i32 noundef) local_unnamed_addr #1

declare i64 @NetGetMaskLength(i32 noundef) local_unnamed_addr #1

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

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_IP4_INTERFACE", !6, i64 0, !11, i64 8, !13, i64 24, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !7, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !11, i64 96, !11, i64 112, !12, i64 128, !14, i64 136, !14, i64 168, !6, i64 200, !11, i64 208, !7, i64 224}
!11 = !{!"_LIST_ENTRY", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"", !7, i64 0}
!15 = !{!10, !7, i64 48}
!16 = !{!10, !6, i64 32}
!17 = !{!10, !6, i64 36}
!18 = !{!10, !6, i64 40}
!19 = !{!10, !6, i64 44}
!20 = !{!10, !12, i64 56}
!21 = !{!10, !12, i64 64}
!22 = !{!12, !12, i64 0}
!23 = !{!24, !12, i64 280}
!24 = !{!"", !25, i64 0, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !12, i64 312, !12, i64 320, !12, i64 328, !12, i64 336, !12, i64 344, !12, i64 352, !12, i64 360, !12, i64 368}
!25 = !{!"", !13, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!26 = !{!10, !12, i64 88}
!27 = !{!28, !29, i64 0}
!28 = !{!"", !29, i64 0, !7, i64 2, !12, i64 8, !6, i64 16, !6, i64 20, !6, i64 24}
!29 = !{!"short", !7, i64 0}
!30 = !{!28, !7, i64 2}
!31 = !{!28, !12, i64 8}
!32 = !{!28, !6, i64 16}
!33 = !{!28, !6, i64 20}
!34 = !{!28, !6, i64 24}
!35 = !{!10, !12, i64 80}
!36 = !{!37, !12, i64 0}
!37 = !{!"_EFI_ARP_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48}
!38 = !{!24, !12, i64 288}


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