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

; 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"

%union.IP_IO_IP_PROTOCOL = type { ptr }
%struct.EFI_IP4_MODE_DATA = type { i8, i32, %struct.EFI_IP4_CONFIG_DATA, i8, i32, ptr, i32, ptr, i32, 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_IP6_MODE_DATA = type { i8, i32, %struct.EFI_IP6_CONFIG_DATA, i8, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct._IP_IO_IP_INFO = type { %union.EFI_IP_ADDRESS, %union.IP_IO_IP_MASK, %struct._LIST_ENTRY, ptr, %union.IP_IO_IP_PROTOCOL, %union.IP_IO_IP_COMPLETION_TOKEN, i64, i8 }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%union.IP_IO_IP_MASK = type { i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%union.IP_IO_IP_COMPLETION_TOKEN = type { %struct.EFI_IP4_COMPLETION_TOKEN }
%struct.EFI_IP4_COMPLETION_TOKEN = type { ptr, i64, %union.anon }
%union.anon = type { ptr }
%struct._EFI_IP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._EFI_IP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [146 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [23 x i8], align 1

; 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

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

declare ptr @ZeroMem(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) #2

declare void @FreePool(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @IpIoConfigIp(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca %union.IP_IO_IP_PROTOCOL, align 8
  %8 = alloca i8, align 1
  %9 = alloca %struct.EFI_IP4_MODE_DATA, align 8
  %10 = alloca %struct.EFI_IP6_MODE_DATA, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 88, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 160, ptr %10) #4
  br label %12

12:                                               ; preds = %2
  %13 = call zeroext i8 @DebugAssertEnabled()
  %14 = icmp ne i8 %13, 0
  br i1 %14, label %15, label %20

15:                                               ; preds = %12
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1730, ptr noundef @.str.9)
  br label %19

19:                                               ; preds = %18, %15
  br label %20

20:                                               ; preds = %19, %12
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %23, i32 0, i32 6
  %25 = load i64, ptr %24, align 8, !tbaa !9
  %26 = icmp sgt i64 %25, 1
  br i1 %26, label %27, label %28

27:                                               ; preds = %22
  store i64 0, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %219

28:                                               ; preds = %22
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %29, i32 0, i32 7
  %31 = load i8, ptr %30, align 8, !tbaa !13
  store i8 %31, ptr %8, align 1, !tbaa !14
  br label %32

32:                                               ; preds = %28
  %33 = call zeroext i8 @DebugAssertEnabled()
  %34 = icmp ne i8 %33, 0
  br i1 %34, label %35, label %45

35:                                               ; preds = %32
  %36 = load i8, ptr %8, align 1, !tbaa !14
  %37 = zext i8 %36 to i32
  %38 = icmp eq i32 %37, 4
  br i1 %38, label %44, label %39

39:                                               ; preds = %35
  %40 = load i8, ptr %8, align 1, !tbaa !14
  %41 = zext i8 %40 to i32
  %42 = icmp eq i32 %41, 6
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1743, ptr noundef @.str.4)
  br label %44

44:                                               ; preds = %43, %39, %35
  br label %45

45:                                               ; preds = %44, %32
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %48, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %49, i64 8, i1 false), !tbaa.struct !15
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %50, i32 0, i32 7
  %52 = load i8, ptr %51, align 8, !tbaa !13
  %53 = zext i8 %52 to i32
  %54 = icmp eq i32 %53, 4
  br i1 %54, label %55, label %62

55:                                               ; preds = %47
  %56 = load ptr, ptr %7, align 8, !tbaa !14
  %57 = getelementptr inbounds %struct._EFI_IP4_PROTOCOL, ptr %56, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !16
  %59 = load ptr, ptr %7, align 8, !tbaa !14
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = call i64 %58(ptr noundef %59, ptr noundef %60)
  store i64 %61, ptr %6, align 8, !tbaa !18
  br label %69

62:                                               ; preds = %47
  %63 = load ptr, ptr %7, align 8, !tbaa !14
  %64 = getelementptr inbounds %struct._EFI_IP6_PROTOCOL, ptr %63, i32 0, i32 1
  %65 = load ptr, ptr %64, align 8, !tbaa !19
  %66 = load ptr, ptr %7, align 8, !tbaa !14
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = call i64 %65(ptr noundef %66, ptr noundef %67)
  store i64 %68, ptr %6, align 8, !tbaa !18
  br label %69

69:                                               ; preds = %62, %55
  %70 = load i64, ptr %6, align 8, !tbaa !18
  %71 = icmp slt i64 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %69
  br label %217

73:                                               ; preds = %69
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = icmp ne ptr %74, null
  br i1 %75, label %76, label %209

76:                                               ; preds = %73
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %77, i32 0, i32 7
  %79 = load i8, ptr %78, align 8, !tbaa !13
  %80 = zext i8 %79 to i32
  %81 = icmp eq i32 %80, 4
  br i1 %81, label %82, label %128

82:                                               ; preds = %76
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %83, i32 0, i32 5
  %85 = load i8, ptr %84, align 1, !tbaa !21
  %86 = icmp ne i8 %85, 0
  br i1 %86, label %87, label %101

87:                                               ; preds = %82
  %88 = load ptr, ptr %7, align 8, !tbaa !14
  %89 = getelementptr inbounds %struct._EFI_IP4_PROTOCOL, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !25
  %91 = load ptr, ptr %7, align 8, !tbaa !14
  %92 = call i64 %90(ptr noundef %91, ptr noundef %9, ptr noundef null, ptr noundef null)
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %93, i32 0, i32 6
  %95 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %9, i32 0, i32 2
  %96 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %95, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %94, ptr align 2 %96, i64 4, i1 false), !tbaa.struct !26
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %97, i32 0, i32 7
  %99 = getelementptr inbounds %struct.EFI_IP4_MODE_DATA, ptr %9, i32 0, i32 2
  %100 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %99, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %98, ptr align 2 %100, i64 4, i1 false), !tbaa.struct !26
  br label %101

101:                                              ; preds = %87, %82
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %102, i32 0, i32 0
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %104, i32 0, i32 6
  %106 = call ptr @CopyMem(ptr noundef %103, ptr noundef %105, i64 noundef 4)
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %107, i32 0, i32 1
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %109, i32 0, i32 7
  %111 = call ptr @CopyMem(ptr noundef %108, ptr noundef %110, i64 noundef 4)
  %112 = load ptr, ptr %7, align 8, !tbaa !14
  %113 = getelementptr inbounds %struct._EFI_IP4_PROTOCOL, ptr %112, i32 0, i32 5
  %114 = load ptr, ptr %113, align 8, !tbaa !27
  %115 = load ptr, ptr %7, align 8, !tbaa !14
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %116, i32 0, i32 5
  %118 = call i64 %114(ptr noundef %115, ptr noundef %117)
  store i64 %118, ptr %6, align 8, !tbaa !18
  %119 = load i64, ptr %6, align 8, !tbaa !18
  %120 = icmp slt i64 %119, 0
  br i1 %120, label %121, label %127

121:                                              ; preds = %101
  %122 = load ptr, ptr %7, align 8, !tbaa !14
  %123 = getelementptr inbounds %struct._EFI_IP4_PROTOCOL, ptr %122, i32 0, i32 1
  %124 = load ptr, ptr %123, align 8, !tbaa !16
  %125 = load ptr, ptr %7, align 8, !tbaa !14
  %126 = call i64 %124(ptr noundef %125, ptr noundef null)
  br label %127

127:                                              ; preds = %121, %101
  br label %208

128:                                              ; preds = %76
  %129 = load ptr, ptr %7, align 8, !tbaa !14
  %130 = getelementptr inbounds %struct._EFI_IP6_PROTOCOL, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !28
  %132 = load ptr, ptr %7, align 8, !tbaa !14
  %133 = call i64 %131(ptr noundef %132, ptr noundef %10, ptr noundef null, ptr noundef null)
  %134 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 3
  %135 = load i8, ptr %134, align 4, !tbaa !29
  %136 = icmp ne i8 %135, 0
  br i1 %136, label %137, label %185

137:                                              ; preds = %128
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %138, i32 0, i32 5
  %140 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 2
  %141 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %140, i32 0, i32 5
  %142 = call ptr @CopyMem(ptr noundef %139, ptr noundef %141, i64 noundef 16)
  %143 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 5
  %144 = load ptr, ptr %143, align 8, !tbaa !32
  %145 = icmp ne ptr %144, null
  br i1 %145, label %146, label %149

146:                                              ; preds = %137
  %147 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 5
  %148 = load ptr, ptr %147, align 8, !tbaa !32
  call void @FreePool(ptr noundef %148)
  br label %149

149:                                              ; preds = %146, %137
  %150 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 7
  %151 = load ptr, ptr %150, align 8, !tbaa !33
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %156

153:                                              ; preds = %149
  %154 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 7
  %155 = load ptr, ptr %154, align 8, !tbaa !33
  call void @FreePool(ptr noundef %155)
  br label %156

156:                                              ; preds = %153, %149
  %157 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 9
  %158 = load ptr, ptr %157, align 8, !tbaa !34
  %159 = icmp ne ptr %158, null
  br i1 %159, label %160, label %163

160:                                              ; preds = %156
  %161 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 9
  %162 = load ptr, ptr %161, align 8, !tbaa !34
  call void @FreePool(ptr noundef %162)
  br label %163

163:                                              ; preds = %160, %156
  %164 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 11
  %165 = load ptr, ptr %164, align 8, !tbaa !35
  %166 = icmp ne ptr %165, null
  br i1 %166, label %167, label %170

167:                                              ; preds = %163
  %168 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 11
  %169 = load ptr, ptr %168, align 8, !tbaa !35
  call void @FreePool(ptr noundef %169)
  br label %170

170:                                              ; preds = %167, %163
  %171 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 13
  %172 = load ptr, ptr %171, align 8, !tbaa !36
  %173 = icmp ne ptr %172, null
  br i1 %173, label %174, label %177

174:                                              ; preds = %170
  %175 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 13
  %176 = load ptr, ptr %175, align 8, !tbaa !36
  call void @FreePool(ptr noundef %176)
  br label %177

177:                                              ; preds = %174, %170
  %178 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 15
  %179 = load ptr, ptr %178, align 8, !tbaa !37
  %180 = icmp ne ptr %179, null
  br i1 %180, label %181, label %184

181:                                              ; preds = %177
  %182 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 15
  %183 = load ptr, ptr %182, align 8, !tbaa !37
  call void @FreePool(ptr noundef %183)
  br label %184

184:                                              ; preds = %181, %177
  br label %186

185:                                              ; preds = %128
  store i64 -9223372036854775791, ptr %6, align 8, !tbaa !18
  br label %217

186:                                              ; preds = %184
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %187, i32 0, i32 0
  %189 = getelementptr inbounds %struct.EFI_IP6_MODE_DATA, ptr %10, i32 0, i32 2
  %190 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %189, i32 0, i32 5
  %191 = call ptr @CopyMem(ptr noundef %188, ptr noundef %190, i64 noundef 16)
  %192 = load ptr, ptr %7, align 8, !tbaa !14
  %193 = getelementptr inbounds %struct._EFI_IP6_PROTOCOL, ptr %192, i32 0, i32 6
  %194 = load ptr, ptr %193, align 8, !tbaa !38
  %195 = load ptr, ptr %7, align 8, !tbaa !14
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %196, i32 0, i32 5
  %198 = call i64 %194(ptr noundef %195, ptr noundef %197)
  store i64 %198, ptr %6, align 8, !tbaa !18
  %199 = load i64, ptr %6, align 8, !tbaa !18
  %200 = icmp slt i64 %199, 0
  br i1 %200, label %201, label %207

201:                                              ; preds = %186
  %202 = load ptr, ptr %7, align 8, !tbaa !14
  %203 = getelementptr inbounds %struct._EFI_IP6_PROTOCOL, ptr %202, i32 0, i32 1
  %204 = load ptr, ptr %203, align 8, !tbaa !19
  %205 = load ptr, ptr %7, align 8, !tbaa !14
  %206 = call i64 %204(ptr noundef %205, ptr noundef null)
  br label %207

207:                                              ; preds = %201, %186
  br label %208

208:                                              ; preds = %207, %127
  br label %216

209:                                              ; preds = %73
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %210, i32 0, i32 0
  %212 = call ptr @ZeroMem(ptr noundef %211, i64 noundef 16)
  %213 = load ptr, ptr %4, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %213, i32 0, i32 1
  %215 = call ptr @ZeroMem(ptr noundef %214, i64 noundef 4)
  br label %216

216:                                              ; preds = %209, %208
  br label %217

217:                                              ; preds = %216, %185, %72
  %218 = load i64, ptr %6, align 8, !tbaa !18
  store i64 %218, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %219

219:                                              ; preds = %217, %27
  call void @llvm.lifetime.end.p0(i64 160, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 88, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %220 = load i64, ptr %3, align 8
  ret i64 %220
}

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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, !12, i64 80}
!10 = !{!"_IP_IO_IP_INFO", !7, i64 0, !7, i64 16, !11, i64 24, !6, i64 40, !7, i64 48, !7, i64 56, !12, i64 80, !7, i64 88}
!11 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!12 = !{!"long long", !7, i64 0}
!13 = !{!10, !7, i64 88}
!14 = !{!7, !7, i64 0}
!15 = !{i64 0, i64 8, !14}
!16 = !{!17, !6, i64 8}
!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 = !{!12, !12, i64 0}
!19 = !{!20, !6, i64 8}
!20 = !{!"_EFI_IP6_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}
!21 = !{!22, !7, i64 5}
!22 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !23, i64 6, !23, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !24, i64 20, !24, i64 24}
!23 = !{!"", !7, i64 0}
!24 = !{!"int", !7, i64 0}
!25 = !{!17, !6, i64 0}
!26 = !{i64 0, i64 4, !14}
!27 = !{!17, !6, i64 40}
!28 = !{!20, !6, i64 0}
!29 = !{!30, !7, i64 60}
!30 = !{!"", !7, i64 0, !24, i64 4, !31, i64 8, !7, i64 60, !24, i64 64, !6, i64 72, !24, i64 80, !6, i64 88, !24, i64 96, !6, i64 104, !24, i64 112, !6, i64 120, !24, i64 128, !6, i64 136, !24, i64 144, !6, i64 152}
!31 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !23, i64 4, !23, i64 20, !7, i64 36, !7, i64 37, !24, i64 40, !24, i64 44, !24, i64 48}
!32 = !{!30, !6, i64 72}
!33 = !{!30, !6, i64 88}
!34 = !{!30, !6, i64 104}
!35 = !{!30, !6, i64 120}
!36 = !{!30, !6, i64 136}
!37 = !{!30, !6, i64 152}
!38 = !{!20, !6, i64 48}


; 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_MODE_DATA = type { i8, i32, %struct.EFI_IP4_CONFIG_DATA, i8, i32, ptr, i32, ptr, i32, 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_IP6_MODE_DATA = type { i8, i32, %struct.EFI_IP6_CONFIG_DATA, i8, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }

@.str = external hidden unnamed_addr constant [146 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [23 x i8], align 1

; 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

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

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

declare void @FreePool(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @IpIoConfigIp(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.EFI_IP4_MODE_DATA, align 8
  %4 = alloca %struct.EFI_IP6_MODE_DATA, align 8
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %4) #3
  %5 = tail call zeroext i8 @DebugAssertEnabled() #3
  %6 = icmp eq i8 %5, 0
  %7 = icmp ne ptr %0, null
  %or.cond4 = or i1 %7, %6
  br i1 %or.cond4, label %9, label %8

8:                                                ; preds = %2
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1730, ptr noundef nonnull @.str.9) #3
  br label %9

9:                                                ; preds = %8, %2
  %10 = getelementptr inbounds i8, ptr %0, i64 80
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %12 = icmp sgt i64 %11, 1
  br i1 %12, label %100, label %13

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %0, i64 88
  %15 = load i8, ptr %14, align 8, !tbaa !12
  %16 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %16, 0
  %17 = and i8 %15, -3
  %or.cond = icmp eq i8 %17, 4
  %or.cond68 = select i1 %.not, i1 true, i1 %or.cond
  br i1 %or.cond68, label %19, label %18

18:                                               ; preds = %13
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1743, ptr noundef nonnull @.str.4) #3
  br label %19

19:                                               ; preds = %18, %13
  %20 = getelementptr inbounds i8, ptr %0, i64 48
  %.sroa.0.0.copyload = load ptr, ptr %20, align 8, !tbaa !13
  %21 = getelementptr inbounds i8, ptr %.sroa.0.0.copyload, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  %23 = tail call i64 %22(ptr noundef %.sroa.0.0.copyload, ptr noundef %1) #3
  %24 = icmp slt i64 %23, 0
  br i1 %24, label %100, label %25

25:                                               ; preds = %19
  %.not59 = icmp eq ptr %1, null
  br i1 %.not59, label %96, label %26

26:                                               ; preds = %25
  %27 = load i8, ptr %14, align 8, !tbaa !12
  %28 = icmp eq i8 %27, 4
  br i1 %28, label %29, label %53

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %1, i64 5
  %31 = load i8, ptr %30, align 1, !tbaa !15
  %.not67 = icmp eq i8 %31, 0
  br i1 %.not67, label %38, label %32

32:                                               ; preds = %29
  %33 = load ptr, ptr %.sroa.0.0.copyload, align 8, !tbaa !19
  %34 = call i64 %33(ptr noundef nonnull %.sroa.0.0.copyload, ptr noundef nonnull %3, ptr noundef null, ptr noundef null) #3
  %35 = getelementptr inbounds i8, ptr %1, i64 6
  %36 = getelementptr inbounds i8, ptr %3, i64 14
  %37 = load <2 x i32>, ptr %36, align 2, !tbaa !13
  store <2 x i32> %37, ptr %35, align 2, !tbaa !13
  br label %38

38:                                               ; preds = %32, %29
  %39 = getelementptr inbounds i8, ptr %1, i64 6
  %40 = call ptr @CopyMem(ptr noundef nonnull %0, ptr noundef nonnull %39, i64 noundef 4) #3
  %41 = getelementptr inbounds i8, ptr %0, i64 16
  %42 = getelementptr inbounds i8, ptr %1, i64 10
  %43 = call ptr @CopyMem(ptr noundef nonnull %41, ptr noundef nonnull %42, i64 noundef 4) #3
  %44 = getelementptr inbounds i8, ptr %.sroa.0.0.copyload, i64 40
  %45 = load ptr, ptr %44, align 8, !tbaa !21
  %46 = getelementptr inbounds i8, ptr %0, i64 56
  %47 = call i64 %45(ptr noundef nonnull %.sroa.0.0.copyload, ptr noundef nonnull %46) #3
  %48 = icmp slt i64 %47, 0
  br i1 %48, label %49, label %100

49:                                               ; preds = %38
  %50 = getelementptr inbounds i8, ptr %.sroa.0.0.copyload, i64 8
  %51 = load ptr, ptr %50, align 8, !tbaa !22
  %52 = call i64 %51(ptr noundef nonnull %.sroa.0.0.copyload, ptr noundef null) #3
  br label %100

53:                                               ; preds = %26
  %54 = load ptr, ptr %.sroa.0.0.copyload, align 8, !tbaa !23
  %55 = call i64 %54(ptr noundef nonnull %.sroa.0.0.copyload, ptr noundef nonnull %4, ptr noundef null, ptr noundef null) #3
  %56 = getelementptr inbounds i8, ptr %4, i64 60
  %57 = load i8, ptr %56, align 4, !tbaa !25
  %.not60 = icmp eq i8 %57, 0
  br i1 %.not60, label %100, label %58

58:                                               ; preds = %53
  %59 = getelementptr inbounds i8, ptr %1, i64 20
  %60 = getelementptr inbounds i8, ptr %4, i64 28
  %61 = call ptr @CopyMem(ptr noundef nonnull %59, ptr noundef nonnull %60, i64 noundef 16) #3
  %62 = getelementptr inbounds i8, ptr %4, i64 72
  %63 = load ptr, ptr %62, align 8, !tbaa !28
  %.not61 = icmp eq ptr %63, null
  br i1 %.not61, label %65, label %64

64:                                               ; preds = %58
  call void @FreePool(ptr noundef nonnull %63) #3
  br label %65

65:                                               ; preds = %64, %58
  %66 = getelementptr inbounds i8, ptr %4, i64 88
  %67 = load ptr, ptr %66, align 8, !tbaa !29
  %.not62 = icmp eq ptr %67, null
  br i1 %.not62, label %69, label %68

68:                                               ; preds = %65
  call void @FreePool(ptr noundef nonnull %67) #3
  br label %69

69:                                               ; preds = %68, %65
  %70 = getelementptr inbounds i8, ptr %4, i64 104
  %71 = load ptr, ptr %70, align 8, !tbaa !30
  %.not63 = icmp eq ptr %71, null
  br i1 %.not63, label %73, label %72

72:                                               ; preds = %69
  call void @FreePool(ptr noundef nonnull %71) #3
  br label %73

73:                                               ; preds = %72, %69
  %74 = getelementptr inbounds i8, ptr %4, i64 120
  %75 = load ptr, ptr %74, align 8, !tbaa !31
  %.not64 = icmp eq ptr %75, null
  br i1 %.not64, label %77, label %76

76:                                               ; preds = %73
  call void @FreePool(ptr noundef nonnull %75) #3
  br label %77

77:                                               ; preds = %76, %73
  %78 = getelementptr inbounds i8, ptr %4, i64 136
  %79 = load ptr, ptr %78, align 8, !tbaa !32
  %.not65 = icmp eq ptr %79, null
  br i1 %.not65, label %81, label %80

80:                                               ; preds = %77
  call void @FreePool(ptr noundef nonnull %79) #3
  br label %81

81:                                               ; preds = %80, %77
  %82 = getelementptr inbounds i8, ptr %4, i64 152
  %83 = load ptr, ptr %82, align 8, !tbaa !33
  %.not66 = icmp eq ptr %83, null
  br i1 %.not66, label %85, label %84

84:                                               ; preds = %81
  call void @FreePool(ptr noundef nonnull %83) #3
  br label %85

85:                                               ; preds = %81, %84
  %86 = call ptr @CopyMem(ptr noundef nonnull %0, ptr noundef nonnull %60, i64 noundef 16) #3
  %87 = getelementptr inbounds i8, ptr %.sroa.0.0.copyload, i64 48
  %88 = load ptr, ptr %87, align 8, !tbaa !34
  %89 = getelementptr inbounds i8, ptr %0, i64 56
  %90 = call i64 %88(ptr noundef nonnull %.sroa.0.0.copyload, ptr noundef nonnull %89) #3
  %91 = icmp slt i64 %90, 0
  br i1 %91, label %92, label %100

92:                                               ; preds = %85
  %93 = getelementptr inbounds i8, ptr %.sroa.0.0.copyload, i64 8
  %94 = load ptr, ptr %93, align 8, !tbaa !35
  %95 = call i64 %94(ptr noundef nonnull %.sroa.0.0.copyload, ptr noundef null) #3
  br label %100

96:                                               ; preds = %25
  %97 = tail call ptr @ZeroMem(ptr noundef nonnull %0, i64 noundef 16) #3
  %98 = getelementptr inbounds i8, ptr %0, i64 16
  %99 = tail call ptr @ZeroMem(ptr noundef nonnull %98, i64 noundef 4) #3
  br label %100

100:                                              ; preds = %19, %49, %38, %92, %85, %96, %53, %9
  %.0 = phi i64 [ 0, %9 ], [ %23, %19 ], [ %47, %49 ], [ %47, %38 ], [ %90, %92 ], [ %90, %85 ], [ %23, %96 ], [ -9223372036854775791, %53 ]
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %3) #3
  ret i64 %.0
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 80}
!6 = !{!"_IP_IO_IP_INFO", !7, i64 0, !7, i64 16, !9, i64 24, !10, i64 40, !7, i64 48, !7, i64 56, !11, i64 80, !7, i64 88}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = !{!6, !7, i64 88}
!13 = !{!7, !7, i64 0}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !7, i64 5}
!16 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !17, i64 6, !17, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !18, i64 20, !18, i64 24}
!17 = !{!"", !7, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!20, !10, i64 0}
!20 = !{!"_EFI_IP4_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}
!21 = !{!20, !10, i64 40}
!22 = !{!20, !10, i64 8}
!23 = !{!24, !10, i64 0}
!24 = !{!"_EFI_IP6_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}
!25 = !{!26, !7, i64 60}
!26 = !{!"", !7, i64 0, !18, i64 4, !27, i64 8, !7, i64 60, !18, i64 64, !10, i64 72, !18, i64 80, !10, i64 88, !18, i64 96, !10, i64 104, !18, i64 112, !10, i64 120, !18, i64 128, !10, i64 136, !18, i64 144, !10, i64 152}
!27 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !17, i64 4, !17, i64 20, !7, i64 36, !7, i64 37, !18, i64 40, !18, i64 44, !18, i64 48}
!28 = !{!26, !10, i64 72}
!29 = !{!26, !10, i64 88}
!30 = !{!26, !10, i64 104}
!31 = !{!26, !10, i64 120}
!32 = !{!26, !10, i64 136}
!33 = !{!26, !10, i64 152}
!34 = !{!24, !10, i64 48}
!35 = !{!24, !10, i64 8}


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