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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct._UDP6_INSTANCE_DATA = type { i32, %struct._LIST_ENTRY, ptr, %struct._EFI_UDP6_PROTOCOL, %struct.EFI_UDP6_CONFIG_DATA, ptr, i8, i8, %struct.NET_MAP, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i16, i64, ptr, i8 }
%struct._EFI_UDP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_UDP6_CONFIG_DATA = type { i8, i8, i8, i8, i8, i32, i32, %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16 }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%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._UDP6_SERVICE_DATA = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, ptr, %struct._LIST_ENTRY, i64, ptr, ptr }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [43 x i8], align 1

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

18:                                               ; preds = %2
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %15, align 4
  br label %216

19:                                               ; preds = %2
  %20 = call zeroext i8 @DebugAssertEnabled()
  %21 = zext i8 %20 to i32
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %33

23:                                               ; preds = %19
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = ptrtoint ptr %24 to i64
  %26 = sub i64 %25, ptrtoint (ptr getelementptr inbounds (%struct._UDP6_INSTANCE_DATA, ptr null, i32 0, i32 3) to i64)
  %27 = inttoptr i64 %26 to ptr
  %28 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !9
  %30 = icmp ne i32 %29, 1399874645
  br i1 %30, label %31, label %33

31:                                               ; preds = %23
  call void @DebugAssert(ptr noundef @.str, i64 noundef 158, ptr noundef @.str.1)
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  br label %38

33:                                               ; preds = %23, %19
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = ptrtoint ptr %34 to i64
  %36 = sub i64 %35, ptrtoint (ptr getelementptr inbounds (%struct._UDP6_INSTANCE_DATA, ptr null, i32 0, i32 3) to i64)
  %37 = inttoptr i64 %36 to ptr
  br label %38

38:                                               ; preds = %33, %31
  %39 = phi ptr [ %32, %31 ], [ %37, %33 ]
  store ptr %39, ptr %7, align 8, !tbaa !5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %40, i32 0, i32 6
  %42 = load i8, ptr %41, align 8, !tbaa !19
  %43 = icmp ne i8 %42, 0
  br i1 %43, label %48, label %44

44:                                               ; preds = %38
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %48

47:                                               ; preds = %44
  store i64 0, ptr %3, align 8
  store i32 1, ptr %15, align 4
  br label %216

48:                                               ; preds = %44, %38
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !20
  store ptr %51, ptr %8, align 8, !tbaa !5
  store i64 0, ptr %6, align 8, !tbaa !21
  br label %52

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

55:                                               ; preds = %52
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  call void @DebugAssert(ptr noundef @.str, i64 noundef 166, ptr noundef @.str.2)
  br label %59

59:                                               ; preds = %58, %55
  br label %60

60:                                               ; preds = %59, %52
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  %63 = load ptr, ptr @gBS, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %63, i32 0, i32 1
  %65 = load ptr, ptr %64, align 8, !tbaa !22
  %66 = call i64 %65(i64 noundef 8)
  store i64 %66, ptr %9, align 8, !tbaa !21
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %179

69:                                               ; preds = %62
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %70, i32 0, i32 7
  %72 = call ptr @CopyMem(ptr noundef %10, ptr noundef %71, i64 noundef 16)
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %73, i32 0, i32 9
  %75 = call ptr @CopyMem(ptr noundef %11, ptr noundef %74, i64 noundef 16)
  %76 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef %10)
  %77 = icmp ne i8 %76, 0
  br i1 %77, label %81, label %78

78:                                               ; preds = %69
  %79 = call zeroext i8 @NetIp6IsValidUnicast(ptr noundef %10)
  %80 = icmp ne i8 %79, 0
  br i1 %80, label %81, label %87

81:                                               ; preds = %78, %69
  %82 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef %11)
  %83 = icmp ne i8 %82, 0
  br i1 %83, label %88, label %84

84:                                               ; preds = %81
  %85 = call zeroext i8 @NetIp6IsValidUnicast(ptr noundef %11)
  %86 = icmp ne i8 %85, 0
  br i1 %86, label %88, label %87

87:                                               ; preds = %84, %78
  store i64 -9223372036854775806, ptr %6, align 8, !tbaa !21
  br label %210

88:                                               ; preds = %84, %81
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %89, i32 0, i32 6
  %91 = load i8, ptr %90, align 8, !tbaa !19
  %92 = icmp ne i8 %91, 0
  br i1 %92, label %93, label %125

93:                                               ; preds = %88
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %94, i32 0, i32 4
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = call zeroext i8 @Udp6IsReconfigurable(ptr noundef %95, ptr noundef %96)
  %98 = icmp ne i8 %97, 0
  br i1 %98, label %100, label %99

99:                                               ; preds = %93
  store i64 -9223372036854775788, ptr %6, align 8, !tbaa !21
  br label %210

100:                                              ; preds = %93
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %101, i32 0, i32 3
  %103 = load i8, ptr %102, align 1, !tbaa !25
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %104, i32 0, i32 4
  %106 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %105, i32 0, i32 3
  store i8 %103, ptr %106, align 1, !tbaa !26
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %107, i32 0, i32 4
  %109 = load i8, ptr %108, align 4, !tbaa !27
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %110, i32 0, i32 4
  %112 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %111, i32 0, i32 4
  store i8 %109, ptr %112, align 4, !tbaa !28
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %113, i32 0, i32 5
  %115 = load i32, ptr %114, align 4, !tbaa !29
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %116, i32 0, i32 4
  %118 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %117, i32 0, i32 5
  store i32 %115, ptr %118, align 8, !tbaa !30
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %119, i32 0, i32 6
  %121 = load i32, ptr %120, align 4, !tbaa !31
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %122, i32 0, i32 4
  %124 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %123, i32 0, i32 6
  store i32 %121, ptr %124, align 4, !tbaa !32
  br label %178

125:                                              ; preds = %88
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Udp6BuildIp6ConfigData(ptr noundef %126, ptr noundef %12)
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %127, i32 0, i32 15
  %129 = load ptr, ptr %128, align 8, !tbaa !33
  %130 = call i64 @IpIoConfigIp(ptr noundef %129, ptr noundef %12)
  store i64 %130, ptr %6, align 8, !tbaa !21
  %131 = load i64, ptr %6, align 8, !tbaa !21
  %132 = icmp slt i64 %131, 0
  br i1 %132, label %133, label %140

133:                                              ; preds = %125
  %134 = load i64, ptr %6, align 8, !tbaa !21
  %135 = icmp eq i64 %134, -9223372036854775791
  br i1 %135, label %136, label %139

136:                                              ; preds = %133
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %137, i32 0, i32 7
  store i8 1, ptr %138, align 1, !tbaa !34
  br label %139

139:                                              ; preds = %136, %133
  br label %210

140:                                              ; preds = %125
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %141, i32 0, i32 7
  store i8 0, ptr %142, align 1, !tbaa !34
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %143, i32 0, i32 4
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = call ptr @CopyMem(ptr noundef %144, ptr noundef %145, i64 noundef 52)
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %147, i32 0, i32 4
  %149 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %148, i32 0, i32 7
  %150 = getelementptr inbounds %struct.EFI_IP6_CONFIG_DATA, ptr %12, i32 0, i32 5
  %151 = call ptr @CopyMem(ptr noundef %149, ptr noundef %150, i64 noundef 16)
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._UDP6_SERVICE_DATA, ptr %152, i32 0, i32 4
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %154, i32 0, i32 4
  %156 = call i64 @Udp6Bind(ptr noundef %153, ptr noundef %155)
  store i64 %156, ptr %6, align 8, !tbaa !21
  %157 = load i64, ptr %6, align 8, !tbaa !21
  %158 = icmp slt i64 %157, 0
  br i1 %158, label %159, label %164

159:                                              ; preds = %140
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %160, i32 0, i32 15
  %162 = load ptr, ptr %161, align 8, !tbaa !33
  %163 = call i64 @IpIoConfigIp(ptr noundef %162, ptr noundef null)
  br label %210

164:                                              ; preds = %140
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %165, i32 0, i32 4
  %167 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %166, i32 0, i32 7
  %168 = call ptr @CopyMem(ptr noundef %13, ptr noundef %167, i64 noundef 16)
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %169, i32 0, i32 4
  %171 = getelementptr inbounds %struct.EFI_UDP6_CONFIG_DATA, ptr %170, i32 0, i32 9
  %172 = call ptr @CopyMem(ptr noundef %14, ptr noundef %171, i64 noundef 16)
  %173 = call zeroext i16 @NetIp6PseudoHeadChecksum(ptr noundef %13, ptr noundef %14, i8 noundef zeroext 17, i32 noundef 0)
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %174, i32 0, i32 13
  store i16 %173, ptr %175, align 8, !tbaa !35
  %176 = load ptr, ptr %7, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %176, i32 0, i32 6
  store i8 1, ptr %177, align 8, !tbaa !19
  br label %178

178:                                              ; preds = %164, %100
  br label %209

179:                                              ; preds = %62
  %180 = load ptr, ptr %7, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %180, i32 0, i32 6
  store i8 0, ptr %181, align 8, !tbaa !19
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %182, i32 0, i32 7
  store i8 0, ptr %183, align 1, !tbaa !34
  %184 = load ptr, ptr %7, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %184, i32 0, i32 15
  %186 = load ptr, ptr %185, align 8, !tbaa !33
  %187 = call i64 @IpIoConfigIp(ptr noundef %186, ptr noundef null)
  %188 = load ptr, ptr %7, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %188, i32 0, i32 3
  %190 = getelementptr inbounds %struct._EFI_UDP6_PROTOCOL, ptr %189, i32 0, i32 5
  %191 = load ptr, ptr %190, align 8, !tbaa !36
  %192 = load ptr, ptr %7, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %192, i32 0, i32 3
  %194 = call i64 %191(ptr noundef %193, ptr noundef null)
  %195 = load ptr, ptr %7, align 8, !tbaa !5
  call void @Udp6FlushRcvdDgram(ptr noundef %195)
  br label %196

196:                                              ; preds = %179
  %197 = call zeroext i8 @DebugAssertEnabled()
  %198 = icmp ne i8 %197, 0
  br i1 %198, label %199, label %206

199:                                              ; preds = %196
  %200 = load ptr, ptr %7, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct._UDP6_INSTANCE_DATA, ptr %200, i32 0, i32 12
  %202 = call zeroext i8 @IsListEmpty(ptr noundef %201)
  %203 = icmp ne i8 %202, 0
  br i1 %203, label %205, label %204

204:                                              ; preds = %199
  call void @DebugAssert(ptr noundef @.str, i64 noundef 285, ptr noundef @.str.3)
  br label %205

205:                                              ; preds = %204, %199
  br label %206

206:                                              ; preds = %205, %196
  br label %207

207:                                              ; preds = %206
  br label %208

208:                                              ; preds = %207
  br label %209

209:                                              ; preds = %208, %178
  br label %210

210:                                              ; preds = %209, %159, %139, %99, %87
  %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 !37
  %214 = load i64, ptr %9, align 8, !tbaa !21
  call void %213(i64 noundef %214)
  %215 = load i64, ptr %6, align 8, !tbaa !21
  store i64 %215, ptr %3, align 8
  store i32 1, ptr %15, align 4
  br label %216

216:                                              ; preds = %210, %47, %18
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 52, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 16, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %217 = load i64, ptr %3, align 8
  ret i64 %217
}

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

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

declare zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef) #2

declare zeroext i8 @NetIp6IsValidUnicast(ptr noundef) #2

declare zeroext i8 @Udp6IsReconfigurable(ptr noundef, ptr noundef) #2

declare void @Udp6BuildIp6ConfigData(ptr noundef, ptr noundef) #2

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

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

declare zeroext i16 @NetIp6PseudoHeadChecksum(ptr noundef, ptr noundef, i8 noundef zeroext, i32 noundef) #2

declare void @Udp6FlushRcvdDgram(ptr noundef) #2

declare zeroext i8 @IsListEmpty(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 = !{!"_UDP6_INSTANCE_DATA", !11, i64 0, !12, i64 8, !6, i64 24, !13, i64 32, !14, i64 88, !6, i64 144, !7, i64 152, !7, i64 153, !17, i64 160, !17, i64 200, !17, i64 240, !12, i64 280, !12, i64 296, !16, i64 312, !18, i64 320, !6, i64 328, !7, i64 336}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_UDP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!14 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !11, i64 8, !11, i64 12, !15, i64 16, !16, i64 32, !15, i64 34, !16, i64 50}
!15 = !{!"", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!"", !12, i64 0, !12, i64 16, !18, i64 32}
!18 = !{!"long long", !7, i64 0}
!19 = !{!10, !7, i64 152}
!20 = !{!10, !6, i64 24}
!21 = !{!18, !18, i64 0}
!22 = !{!23, !6, i64 24}
!23 = !{!"", !24, 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}
!24 = !{!"", !18, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!25 = !{!14, !7, i64 3}
!26 = !{!10, !7, i64 91}
!27 = !{!14, !7, i64 4}
!28 = !{!10, !7, i64 92}
!29 = !{!14, !11, i64 8}
!30 = !{!10, !11, i64 96}
!31 = !{!14, !11, i64 12}
!32 = !{!10, !11, i64 100}
!33 = !{!10, !6, i64 328}
!34 = !{!10, !7, i64 153}
!35 = !{!10, !16, i64 312}
!36 = !{!10, !6, i64 72}
!37 = !{!23, !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"

%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [131 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.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [43 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @Udp6Configure(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  %4 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  %5 = alloca %struct.EFI_IP6_CONFIG_DATA, align 4
  %6 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  %7 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %8 = icmp eq ptr %0, null
  br i1 %8, label %104, label %9

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

11:                                               ; preds = %9
  %12 = load i32, ptr %.pre68, align 8, !tbaa !5
  %.not56 = icmp eq i32 %12, 1399874645
  br i1 %.not56, label %._crit_edge, label %13

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

._crit_edge:                                      ; preds = %9, %11, %13
  %14 = phi ptr [ %0, %13 ], [ %.pre68, %11 ], [ %.pre68, %9 ]
  %15 = getelementptr inbounds i8, ptr %14, i64 152
  %16 = load i8, ptr %15, align 8, !tbaa !18
  %17 = icmp eq i8 %16, 0
  %18 = icmp eq ptr %1, null
  %or.cond = and i1 %18, %17
  br i1 %or.cond, label %104, label %19

19:                                               ; preds = %._crit_edge
  %20 = getelementptr inbounds i8, ptr %14, i64 24
  %21 = load ptr, ptr %20, align 8, !tbaa !19
  %22 = tail call zeroext i8 @DebugAssertEnabled() #3
  %23 = icmp eq i8 %22, 0
  %24 = icmp ne ptr %21, null
  %or.cond3 = select i1 %23, i1 true, i1 %24
  br i1 %or.cond3, label %26, label %25

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

26:                                               ; preds = %25, %19
  %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) #3
  br i1 %18, label %86, label %31

31:                                               ; preds = %26
  %32 = getelementptr inbounds i8, ptr %1, i64 16
  %33 = call ptr @CopyMem(ptr noundef nonnull %3, ptr noundef nonnull %32, i64 noundef 16) #3
  %34 = getelementptr inbounds i8, ptr %1, i64 34
  %35 = call ptr @CopyMem(ptr noundef nonnull %4, ptr noundef nonnull %34, i64 noundef 16) #3
  %36 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef nonnull %3) #3
  %.not60 = icmp eq i8 %36, 0
  br i1 %.not60, label %37, label %39

37:                                               ; preds = %31
  %38 = call zeroext i8 @NetIp6IsValidUnicast(ptr noundef nonnull %3) #3
  %.not61 = icmp eq i8 %38, 0
  br i1 %.not61, label %100, label %39

39:                                               ; preds = %37, %31
  %40 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef nonnull %4) #3
  %.not62 = icmp eq i8 %40, 0
  br i1 %.not62, label %41, label %43

41:                                               ; preds = %39
  %42 = call zeroext i8 @NetIp6IsValidUnicast(ptr noundef nonnull %4) #3
  %.not63 = icmp eq i8 %42, 0
  br i1 %.not63, label %100, label %43

43:                                               ; preds = %41, %39
  %44 = load i8, ptr %15, align 8, !tbaa !18
  %.not64 = icmp eq i8 %44, 0
  br i1 %.not64, label %58, label %45

45:                                               ; preds = %43
  %46 = getelementptr inbounds i8, ptr %14, i64 88
  %47 = call zeroext i8 @Udp6IsReconfigurable(ptr noundef nonnull %46, ptr noundef nonnull %1) #3
  %.not65 = icmp eq i8 %47, 0
  br i1 %.not65, label %100, label %48

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %1, i64 3
  %50 = load i8, ptr %49, align 1, !tbaa !24
  %51 = getelementptr inbounds i8, ptr %14, i64 91
  store i8 %50, ptr %51, align 1, !tbaa !25
  %52 = getelementptr inbounds i8, ptr %1, i64 4
  %53 = load i8, ptr %52, align 4, !tbaa !26
  %54 = getelementptr inbounds i8, ptr %14, i64 92
  store i8 %53, ptr %54, align 4, !tbaa !27
  %55 = getelementptr inbounds i8, ptr %1, i64 8
  %56 = getelementptr inbounds i8, ptr %14, i64 96
  %57 = load <2 x i32>, ptr %55, align 4, !tbaa !28
  store <2 x i32> %57, ptr %56, align 8, !tbaa !28
  br label %100

58:                                               ; preds = %43
  call void @Udp6BuildIp6ConfigData(ptr noundef nonnull %1, ptr noundef nonnull %5) #3
  %59 = getelementptr inbounds i8, ptr %14, i64 328
  %60 = load ptr, ptr %59, align 8, !tbaa !29
  %61 = call i64 @IpIoConfigIp(ptr noundef %60, ptr noundef nonnull %5) #3
  %62 = icmp slt i64 %61, 0
  br i1 %62, label %63, label %67

63:                                               ; preds = %58
  %64 = icmp eq i64 %61, -9223372036854775791
  br i1 %64, label %65, label %100

65:                                               ; preds = %63
  %66 = getelementptr inbounds i8, ptr %14, i64 153
  store i8 1, ptr %66, align 1, !tbaa !30
  br label %100

67:                                               ; preds = %58
  %68 = getelementptr inbounds i8, ptr %14, i64 153
  store i8 0, ptr %68, align 1, !tbaa !30
  %69 = getelementptr inbounds i8, ptr %14, i64 88
  %70 = call ptr @CopyMem(ptr noundef nonnull %69, ptr noundef nonnull %1, i64 noundef 52) #3
  %71 = getelementptr inbounds i8, ptr %14, i64 104
  %72 = getelementptr inbounds i8, ptr %5, i64 20
  %73 = call ptr @CopyMem(ptr noundef nonnull %71, ptr noundef nonnull %72, i64 noundef 16) #3
  %74 = getelementptr inbounds i8, ptr %21, i64 40
  %75 = call i64 @Udp6Bind(ptr noundef nonnull %74, ptr noundef nonnull %69) #3
  %76 = icmp slt i64 %75, 0
  br i1 %76, label %77, label %80

77:                                               ; preds = %67
  %78 = load ptr, ptr %59, align 8, !tbaa !29
  %79 = call i64 @IpIoConfigIp(ptr noundef %78, ptr noundef null) #3
  br label %100

80:                                               ; preds = %67
  %81 = call ptr @CopyMem(ptr noundef nonnull %6, ptr noundef nonnull %71, i64 noundef 16) #3
  %82 = getelementptr inbounds i8, ptr %14, i64 122
  %83 = call ptr @CopyMem(ptr noundef nonnull %7, ptr noundef nonnull %82, i64 noundef 16) #3
  %84 = call zeroext i16 @NetIp6PseudoHeadChecksum(ptr noundef nonnull %6, ptr noundef nonnull %7, i8 noundef zeroext 17, i32 noundef 0) #3
  %85 = getelementptr inbounds i8, ptr %14, i64 312
  store i16 %84, ptr %85, align 8, !tbaa !31
  store i8 1, ptr %15, align 8, !tbaa !18
  br label %100

86:                                               ; preds = %26
  store i8 0, ptr %15, align 8, !tbaa !18
  %87 = getelementptr inbounds i8, ptr %14, i64 153
  store i8 0, ptr %87, align 1, !tbaa !30
  %88 = getelementptr inbounds i8, ptr %14, i64 328
  %89 = load ptr, ptr %88, align 8, !tbaa !29
  %90 = tail call i64 @IpIoConfigIp(ptr noundef %89, ptr noundef null) #3
  %91 = getelementptr inbounds i8, ptr %14, i64 32
  %92 = getelementptr inbounds i8, ptr %14, i64 72
  %93 = load ptr, ptr %92, align 8, !tbaa !32
  %94 = tail call i64 %93(ptr noundef nonnull %91, ptr noundef null) #3
  tail call void @Udp6FlushRcvdDgram(ptr noundef nonnull %14) #3
  %95 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not58 = icmp eq i8 %95, 0
  br i1 %.not58, label %100, label %96

96:                                               ; preds = %86
  %97 = getelementptr inbounds i8, ptr %14, i64 296
  %98 = tail call zeroext i8 @IsListEmpty(ptr noundef nonnull %97) #3
  %.not59 = icmp eq i8 %98, 0
  br i1 %.not59, label %99, label %100

99:                                               ; preds = %96
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 285, ptr noundef nonnull @.str.3) #3
  br label %100

100:                                              ; preds = %45, %37, %41, %80, %48, %96, %99, %86, %63, %65, %77
  %.051 = phi i64 [ 0, %48 ], [ -9223372036854775791, %65 ], [ %61, %63 ], [ %75, %77 ], [ %75, %80 ], [ 0, %96 ], [ 0, %99 ], [ 0, %86 ], [ -9223372036854775806, %41 ], [ -9223372036854775806, %37 ], [ -9223372036854775788, %45 ]
  %101 = load ptr, ptr @gBS, align 8, !tbaa !20
  %102 = getelementptr inbounds i8, ptr %101, i64 32
  %103 = load ptr, ptr %102, align 8, !tbaa !33
  call void %103(i64 noundef %30) #3
  br label %104

104:                                              ; preds = %._crit_edge, %2, %100
  %.0 = phi i64 [ %.051, %100 ], [ -9223372036854775806, %2 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  ret i64 %.0
}

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

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

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

declare zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef) local_unnamed_addr #2

declare zeroext i8 @NetIp6IsValidUnicast(ptr noundef) local_unnamed_addr #2

declare zeroext i8 @Udp6IsReconfigurable(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @Udp6BuildIp6ConfigData(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare zeroext i16 @NetIp6PseudoHeadChecksum(ptr noundef, ptr noundef, i8 noundef zeroext, i32 noundef) local_unnamed_addr #2

declare void @Udp6FlushRcvdDgram(ptr noundef) local_unnamed_addr #2

declare zeroext i8 @IsListEmpty(ptr noundef) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_UDP6_INSTANCE_DATA", !7, i64 0, !10, i64 8, !11, i64 24, !12, i64 32, !13, i64 88, !11, i64 144, !8, i64 152, !8, i64 153, !16, i64 160, !16, i64 200, !16, i64 240, !10, i64 280, !10, i64 296, !15, i64 312, !17, i64 320, !11, i64 328, !8, i64 336}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_EFI_UDP6_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48}
!13 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !7, i64 8, !7, i64 12, !14, i64 16, !15, i64 32, !14, i64 34, !15, i64 50}
!14 = !{!"", !8, i64 0}
!15 = !{!"short", !8, i64 0}
!16 = !{!"", !10, i64 0, !10, i64 16, !17, i64 32}
!17 = !{!"long long", !8, i64 0}
!18 = !{!6, !8, i64 152}
!19 = !{!6, !11, i64 24}
!20 = !{!11, !11, i64 0}
!21 = !{!22, !11, i64 24}
!22 = !{!"", !23, i64 0, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !11, i64 280, !11, i64 288, !11, i64 296, !11, i64 304, !11, i64 312, !11, i64 320, !11, i64 328, !11, i64 336, !11, i64 344, !11, i64 352, !11, i64 360, !11, i64 368}
!23 = !{!"", !17, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!24 = !{!13, !8, i64 3}
!25 = !{!6, !8, i64 91}
!26 = !{!13, !8, i64 4}
!27 = !{!6, !8, i64 92}
!28 = !{!7, !7, i64 0}
!29 = !{!6, !11, i64 328}
!30 = !{!6, !8, i64 153}
!31 = !{!6, !15, i64 312}
!32 = !{!6, !11, i64 72}
!33 = !{!22, !11, i64 32}


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