; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/NetworkPkg/Dhcp6Dxe (EfiDhcp6GetModeData)

; 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._DHCP6_INSTANCE = type { i32, ptr, ptr, %struct._LIST_ENTRY, %struct._EFI_DHCP6_PROTOCOL, ptr, ptr, ptr, %struct._DHCP6_IA_CB, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, i8, ptr, i64, i8, i8, i64 }
%struct._EFI_DHCP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._DHCP6_IA_CB = type { ptr, i32, i32, i32, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct._DHCP6_SERVICE = type { i32, ptr, ptr, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, ptr, ptr, ptr, i32, %struct._LIST_ENTRY, i64 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = 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_DHCP6_DUID = type { i16, [1 x i8] }
%struct.EFI_DHCP6_MODE_DATA = type { ptr, ptr }
%struct.EFI_DHCP6_IA = type { %struct.EFI_DHCP6_IA_DESCRIPTOR, i32, ptr, i32, [1 x %struct.EFI_DHCP6_IA_ADDRESS] }
%struct.EFI_DHCP6_IA_DESCRIPTOR = type { i16, i32 }
%struct.EFI_DHCP6_IA_ADDRESS = type { %struct.EFI_IPv6_ADDRESS, i32, i32 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct.EFI_DHCP6_PACKET = type <{ i32, i32, %struct.anon }>
%struct.anon = type <{ %struct.EFI_DHCP6_HEADER, [1 x i8] }>
%struct.EFI_DHCP6_HEADER = type { i32 }

@.str = external hidden unnamed_addr constant [133 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1

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

17:                                               ; preds = %3
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %24

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

23:                                               ; preds = %20, %3
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %215

24:                                               ; preds = %20, %17
  %25 = call zeroext i8 @DebugAssertEnabled()
  %26 = zext i8 %25 to i32
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %38

28:                                               ; preds = %24
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = ptrtoint ptr %29 to i64
  %31 = sub i64 %30, ptrtoint (ptr getelementptr inbounds (%struct._DHCP6_INSTANCE, ptr null, i32 0, i32 4) to i64)
  %32 = inttoptr i64 %31 to ptr
  %33 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !9
  %35 = icmp ne i32 %34, 1228294212
  br i1 %35, label %36, label %38

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

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

43:                                               ; preds = %38, %36
  %44 = phi ptr [ %37, %36 ], [ %42, %38 ]
  store ptr %44, ptr %10, align 8, !tbaa !5
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %45, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  store ptr %47, ptr %11, align 8, !tbaa !5
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %48, i32 0, i32 6
  %50 = load ptr, ptr %49, align 8, !tbaa !17
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %56

52:                                               ; preds = %43
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  store i64 -9223372036854775793, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %215

56:                                               ; preds = %52, %43
  br label %57

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

60:                                               ; preds = %57
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %61, i32 0, i32 6
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %64 = icmp ne ptr %63, null
  br i1 %64, label %66, label %65

65:                                               ; preds = %60
  call void @DebugAssert(ptr noundef @.str, i64 noundef 282, ptr noundef @.str.4)
  br label %66

66:                                               ; preds = %65, %60
  br label %67

67:                                               ; preds = %66, %57
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr @gBS, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %70, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  %73 = call i64 %72(i64 noundef 8)
  store i64 %73, ptr %8, align 8, !tbaa !24
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = icmp ne ptr %74, null
  br i1 %75, label %76, label %87

76:                                               ; preds = %69
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = call ptr @ZeroMem(ptr noundef %77, i64 noundef 64)
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %80, i32 0, i32 6
  %82 = load ptr, ptr %81, align 8, !tbaa !17
  %83 = call i64 @Dhcp6CopyConfigData(ptr noundef %79, ptr noundef %82)
  %84 = icmp slt i64 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %76
  br label %200

86:                                               ; preds = %76
  br label %87

87:                                               ; preds = %86, %69
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %195

90:                                               ; preds = %87
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = call ptr @ZeroMem(ptr noundef %91, i64 noundef 16)
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %93, i32 0, i32 6
  %95 = load ptr, ptr %94, align 8, !tbaa !18
  %96 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %95, i32 0, i32 0
  %97 = load i16, ptr %96, align 2, !tbaa !25
  %98 = zext i16 %97 to i64
  %99 = add i64 %98, 2
  %100 = trunc i64 %99 to i32
  store i32 %100, ptr %13, align 4, !tbaa !28
  %101 = load i32, ptr %13, align 4, !tbaa !28
  %102 = zext i32 %101 to i64
  %103 = call ptr @AllocateZeroPool(i64 noundef %102)
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.EFI_DHCP6_MODE_DATA, ptr %104, i32 0, i32 0
  store ptr %103, ptr %105, align 8, !tbaa !29
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.EFI_DHCP6_MODE_DATA, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !29
  %109 = icmp eq ptr %108, null
  br i1 %109, label %110, label %111

110:                                              ; preds = %90
  br label %200

111:                                              ; preds = %90
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.EFI_DHCP6_MODE_DATA, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !29
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %115, i32 0, i32 6
  %117 = load ptr, ptr %116, align 8, !tbaa !18
  %118 = load i32, ptr %13, align 4, !tbaa !28
  %119 = zext i32 %118 to i64
  %120 = call ptr @CopyMem(ptr noundef %114, ptr noundef %117, i64 noundef %119)
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %121, i32 0, i32 8
  %123 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !31
  store ptr %124, ptr %9, align 8, !tbaa !5
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  %126 = icmp ne ptr %125, null
  br i1 %126, label %127, label %194

127:                                              ; preds = %111
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %128, i32 0, i32 3
  %130 = load i32, ptr %129, align 8, !tbaa !32
  %131 = sub i32 %130, 1
  %132 = zext i32 %131 to i64
  %133 = mul i64 %132, 24
  %134 = add i64 56, %133
  %135 = trunc i64 %134 to i32
  store i32 %135, ptr %12, align 4, !tbaa !28
  %136 = load i32, ptr %12, align 4, !tbaa !28
  %137 = zext i32 %136 to i64
  %138 = call ptr @AllocateZeroPool(i64 noundef %137)
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.EFI_DHCP6_MODE_DATA, ptr %139, i32 0, i32 1
  store ptr %138, ptr %140, align 8, !tbaa !35
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.EFI_DHCP6_MODE_DATA, ptr %141, i32 0, i32 1
  %143 = load ptr, ptr %142, align 8, !tbaa !35
  %144 = icmp eq ptr %143, null
  br i1 %144, label %145, label %146

145:                                              ; preds = %127
  br label %200

146:                                              ; preds = %127
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.EFI_DHCP6_MODE_DATA, ptr %147, i32 0, i32 1
  %149 = load ptr, ptr %148, align 8, !tbaa !35
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = load i32, ptr %12, align 4, !tbaa !28
  %152 = zext i32 %151 to i64
  %153 = call ptr @CopyMem(ptr noundef %149, ptr noundef %150, i64 noundef %152)
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %154, i32 0, i32 2
  %156 = load ptr, ptr %155, align 8, !tbaa !36
  %157 = icmp ne ptr %156, null
  br i1 %157, label %158, label %193

158:                                              ; preds = %146
  %159 = load ptr, ptr %9, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %159, i32 0, i32 2
  %161 = load ptr, ptr %160, align 8, !tbaa !36
  %162 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %161, i32 0, i32 0
  %163 = load i32, ptr %162, align 1, !tbaa !37
  %164 = zext i32 %163 to i64
  %165 = call ptr @AllocateZeroPool(i64 noundef %164)
  %166 = load ptr, ptr %6, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.EFI_DHCP6_MODE_DATA, ptr %166, i32 0, i32 1
  %168 = load ptr, ptr %167, align 8, !tbaa !35
  %169 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %168, i32 0, i32 2
  store ptr %165, ptr %169, align 8, !tbaa !36
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.EFI_DHCP6_MODE_DATA, ptr %170, i32 0, i32 1
  %172 = load ptr, ptr %171, align 8, !tbaa !35
  %173 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %172, i32 0, i32 2
  %174 = load ptr, ptr %173, align 8, !tbaa !36
  %175 = icmp eq ptr %174, null
  br i1 %175, label %176, label %177

176:                                              ; preds = %158
  br label %200

177:                                              ; preds = %158
  %178 = load ptr, ptr %6, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.EFI_DHCP6_MODE_DATA, ptr %178, i32 0, i32 1
  %180 = load ptr, ptr %179, align 8, !tbaa !35
  %181 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %180, i32 0, i32 2
  %182 = load ptr, ptr %181, align 8, !tbaa !36
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %183, i32 0, i32 2
  %185 = load ptr, ptr %184, align 8, !tbaa !36
  %186 = load ptr, ptr %9, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %186, i32 0, i32 2
  %188 = load ptr, ptr %187, align 8, !tbaa !36
  %189 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %188, i32 0, i32 0
  %190 = load i32, ptr %189, align 1, !tbaa !37
  %191 = zext i32 %190 to i64
  %192 = call ptr @CopyMem(ptr noundef %182, ptr noundef %185, i64 noundef %191)
  br label %193

193:                                              ; preds = %177, %146
  br label %194

194:                                              ; preds = %193, %111
  br label %195

195:                                              ; preds = %194, %87
  %196 = load ptr, ptr @gBS, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %196, i32 0, i32 2
  %198 = load ptr, ptr %197, align 8, !tbaa !41
  %199 = load i64, ptr %8, align 8, !tbaa !24
  call void %198(i64 noundef %199)
  store i64 0, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %215

200:                                              ; preds = %176, %145, %110, %85
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = icmp ne ptr %201, null
  br i1 %202, label %203, label %205

203:                                              ; preds = %200
  %204 = load ptr, ptr %7, align 8, !tbaa !5
  call void @Dhcp6CleanupConfigData(ptr noundef %204)
  br label %205

205:                                              ; preds = %203, %200
  %206 = load ptr, ptr %6, align 8, !tbaa !5
  %207 = icmp ne ptr %206, null
  br i1 %207, label %208, label %210

208:                                              ; preds = %205
  %209 = load ptr, ptr %6, align 8, !tbaa !5
  call void @Dhcp6CleanupModeData(ptr noundef %209)
  br label %210

210:                                              ; preds = %208, %205
  %211 = load ptr, ptr @gBS, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %211, i32 0, i32 2
  %213 = load ptr, ptr %212, align 8, !tbaa !41
  %214 = load i64, ptr %8, align 8, !tbaa !24
  call void %213(i64 noundef %214)
  store i64 -9223372036854775799, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %215

215:                                              ; preds = %210, %195, %55, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  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 8, ptr %8) #3
  %216 = load i64, ptr %4, align 8
  ret i64 %216
}

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

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

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

declare ptr @AllocateZeroPool(i64 noundef) #2

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

declare void @Dhcp6CleanupConfigData(ptr noundef) #2

declare void @Dhcp6CleanupModeData(ptr noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_DHCP6_INSTANCE", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !12, i64 160, !12, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !15, i64 216, !7, i64 224, !7, i64 225, !15, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_DHCP6_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}
!14 = !{!"_DHCP6_IA_CB", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!15 = !{!"long long", !7, i64 0}
!16 = !{!10, !6, i64 16}
!17 = !{!10, !6, i64 120}
!18 = !{!19, !6, i64 56}
!19 = !{!"_DHCP6_SERVICE", !11, i64 0, !6, i64 8, !6, i64 16, !20, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !12, i64 80, !15, i64 96}
!20 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!21 = !{!22, !6, i64 24}
!22 = !{!"", !23, 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}
!23 = !{!"", !15, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!24 = !{!15, !15, i64 0}
!25 = !{!26, !27, i64 0}
!26 = !{!"", !27, i64 0, !7, i64 2}
!27 = !{!"short", !7, i64 0}
!28 = !{!11, !11, i64 0}
!29 = !{!30, !6, i64 0}
!30 = !{!"", !6, i64 0, !6, i64 8}
!31 = !{!10, !6, i64 136}
!32 = !{!33, !11, i64 24}
!33 = !{!"", !34, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !7, i64 28}
!34 = !{!"", !27, i64 0, !11, i64 4}
!35 = !{!30, !6, i64 8}
!36 = !{!33, !6, i64 16}
!37 = !{!38, !11, i64 0}
!38 = !{!"", !11, i64 0, !11, i64 4, !39, i64 8}
!39 = !{!"", !40, i64 0, !7, i64 4}
!40 = !{!"", !11, i64 0, !11, i64 1}
!41 = !{!22, !6, i64 32}


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

@.str = external hidden unnamed_addr constant [133 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @EfiDhcp6GetModeData(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %81, label %5

5:                                                ; preds = %3
  %6 = icmp eq ptr %1, null
  %7 = icmp eq ptr %2, null
  %or.cond = and i1 %6, %7
  br i1 %or.cond, label %81, label %8

8:                                                ; preds = %5
  %9 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %9, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre66 = add i64 %.pre, -40
  %.pre68 = inttoptr i64 %.pre66 to ptr
  br i1 %.not, label %._crit_edge, label %10

10:                                               ; preds = %8
  %11 = load i32, ptr %.pre68, align 8, !tbaa !5
  %.not57 = icmp eq i32 %11, 1228294212
  br i1 %.not57, label %._crit_edge, label %12

12:                                               ; preds = %10
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 275, ptr noundef nonnull @.str.1) #2
  br label %._crit_edge

._crit_edge:                                      ; preds = %8, %10, %12
  %13 = phi ptr [ %0, %12 ], [ %.pre68, %10 ], [ %.pre68, %8 ]
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %13, i64 120
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  %18 = icmp eq ptr %17, null
  %19 = icmp ne ptr %2, null
  %or.cond3 = and i1 %19, %18
  br i1 %or.cond3, label %81, label %20

20:                                               ; preds = %._crit_edge
  %21 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not58 = icmp eq i8 %21, 0
  br i1 %.not58, label %26, label %22

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %15, i64 56
  %24 = load ptr, ptr %23, align 8, !tbaa !17
  %.not59 = icmp eq ptr %24, null
  br i1 %.not59, label %25, label %26

25:                                               ; preds = %22
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 282, ptr noundef nonnull @.str.4) #2
  br label %26

26:                                               ; preds = %22, %25, %20
  %27 = load ptr, ptr @gBS, align 8, !tbaa !20
  %28 = getelementptr inbounds i8, ptr %27, i64 24
  %29 = load ptr, ptr %28, align 8, !tbaa !21
  %30 = tail call i64 %29(i64 noundef 8) #2
  br i1 %19, label %31, label %36

31:                                               ; preds = %26
  %32 = tail call ptr @ZeroMem(ptr noundef nonnull %2, i64 noundef 64) #2
  %33 = load ptr, ptr %16, align 8, !tbaa !16
  %34 = tail call i64 @Dhcp6CopyConfigData(ptr noundef nonnull %2, ptr noundef %33) #2
  %35 = icmp slt i64 %34, 0
  br i1 %35, label %77, label %36

36:                                               ; preds = %31, %26
  br i1 %6, label %.sink.split, label %37

37:                                               ; preds = %36
  %38 = tail call ptr @ZeroMem(ptr noundef nonnull %1, i64 noundef 16) #2
  %39 = getelementptr inbounds i8, ptr %15, i64 56
  %40 = load ptr, ptr %39, align 8, !tbaa !17
  %41 = load i16, ptr %40, align 2, !tbaa !24
  %42 = zext i16 %41 to i64
  %43 = add nuw nsw i64 %42, 2
  %44 = tail call ptr @AllocateZeroPool(i64 noundef %43) #2
  store ptr %44, ptr %1, align 8, !tbaa !27
  %45 = icmp eq ptr %44, null
  br i1 %45, label %76, label %46

46:                                               ; preds = %37
  %47 = load ptr, ptr %39, align 8, !tbaa !17
  %48 = tail call ptr @CopyMem(ptr noundef nonnull %44, ptr noundef %47, i64 noundef %43) #2
  %49 = getelementptr inbounds i8, ptr %13, i64 136
  %50 = load ptr, ptr %49, align 8, !tbaa !29
  %.not61 = icmp eq ptr %50, null
  br i1 %.not61, label %.sink.split, label %51

51:                                               ; preds = %46
  %52 = getelementptr inbounds i8, ptr %50, i64 24
  %53 = load i32, ptr %52, align 8, !tbaa !30
  %54 = mul i32 %53, 24
  %55 = add i32 %54, 32
  %56 = zext i32 %55 to i64
  %57 = tail call ptr @AllocateZeroPool(i64 noundef %56) #2
  %58 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr %57, ptr %58, align 8, !tbaa !33
  %59 = icmp eq ptr %57, null
  br i1 %59, label %76, label %60

60:                                               ; preds = %51
  %61 = tail call ptr @CopyMem(ptr noundef nonnull %57, ptr noundef nonnull %50, i64 noundef %56) #2
  %62 = getelementptr inbounds i8, ptr %50, i64 16
  %63 = load ptr, ptr %62, align 8, !tbaa !34
  %.not62 = icmp eq ptr %63, null
  br i1 %.not62, label %.sink.split, label %64

64:                                               ; preds = %60
  %65 = load i32, ptr %63, align 1, !tbaa !35
  %66 = zext i32 %65 to i64
  %67 = tail call ptr @AllocateZeroPool(i64 noundef %66) #2
  %68 = load ptr, ptr %58, align 8, !tbaa !33
  %69 = getelementptr inbounds i8, ptr %68, i64 16
  store ptr %67, ptr %69, align 8, !tbaa !34
  %70 = icmp eq ptr %67, null
  br i1 %70, label %76, label %71

71:                                               ; preds = %64
  %72 = load ptr, ptr %62, align 8, !tbaa !34
  %73 = load i32, ptr %72, align 1, !tbaa !35
  %74 = zext i32 %73 to i64
  %75 = tail call ptr @CopyMem(ptr noundef nonnull %67, ptr noundef nonnull %72, i64 noundef %74) #2
  br label %.sink.split

76:                                               ; preds = %64, %51, %37
  br i1 %19, label %.thread65, label %.thread64

.thread65:                                        ; preds = %76
  tail call void @Dhcp6CleanupConfigData(ptr noundef nonnull %2) #2
  br label %.thread64

77:                                               ; preds = %31
  tail call void @Dhcp6CleanupConfigData(ptr noundef nonnull %2) #2
  br i1 %6, label %.sink.split, label %.thread64

.thread64:                                        ; preds = %76, %.thread65, %77
  tail call void @Dhcp6CleanupModeData(ptr noundef nonnull %1) #2
  br label %.sink.split

.sink.split:                                      ; preds = %77, %.thread64, %36, %60, %71, %46
  %.0.ph = phi i64 [ 0, %46 ], [ 0, %71 ], [ 0, %60 ], [ 0, %36 ], [ -9223372036854775799, %.thread64 ], [ -9223372036854775799, %77 ]
  %78 = load ptr, ptr @gBS, align 8, !tbaa !20
  %79 = getelementptr inbounds i8, ptr %78, i64 32
  %80 = load ptr, ptr %79, align 8, !tbaa !39
  tail call void %80(i64 noundef %30) #2
  br label %81

81:                                               ; preds = %.sink.split, %._crit_edge, %3, %5
  %.0 = phi i64 [ -9223372036854775806, %5 ], [ -9223372036854775806, %3 ], [ -9223372036854775793, %._crit_edge ], [ %.0.ph, %.sink.split ]
  ret i64 %.0
}

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

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

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

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #1

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

declare void @Dhcp6CleanupConfigData(ptr noundef) local_unnamed_addr #1

declare void @Dhcp6CleanupModeData(ptr noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 }

!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, !7, i64 0}
!6 = !{!"_DHCP6_INSTANCE", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 40, !10, i64 112, !10, i64 120, !10, i64 128, !13, i64 136, !11, i64 160, !11, i64 176, !10, i64 192, !8, i64 200, !10, i64 208, !14, i64 216, !8, i64 224, !8, i64 225, !14, i64 232}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!12 = !{!"_EFI_DHCP6_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}
!13 = !{!"_DHCP6_IA_CB", !10, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!14 = !{!"long long", !8, i64 0}
!15 = !{!6, !10, i64 16}
!16 = !{!6, !10, i64 120}
!17 = !{!18, !10, i64 56}
!18 = !{!"_DHCP6_SERVICE", !7, i64 0, !10, i64 8, !10, i64 16, !19, i64 24, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !11, i64 80, !14, i64 96}
!19 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!20 = !{!10, !10, i64 0}
!21 = !{!22, !10, i64 24}
!22 = !{!"", !23, 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}
!23 = !{!"", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!24 = !{!25, !26, i64 0}
!25 = !{!"", !26, i64 0, !8, i64 2}
!26 = !{!"short", !8, i64 0}
!27 = !{!28, !10, i64 0}
!28 = !{!"", !10, i64 0, !10, i64 8}
!29 = !{!6, !10, i64 136}
!30 = !{!31, !7, i64 24}
!31 = !{!"", !32, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !8, i64 28}
!32 = !{!"", !26, i64 0, !7, i64 4}
!33 = !{!28, !10, i64 8}
!34 = !{!31, !10, i64 16}
!35 = !{!36, !7, i64 0}
!36 = !{!"", !7, i64 0, !7, i64 4, !37, i64 8}
!37 = !{!"", !38, i64 0, !8, i64 4}
!38 = !{!"", !7, i64 0, !7, i64 1}
!39 = !{!22, !10, i64 32}


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