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

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

%struct.GUID = type { i32, i16, i16, [8 x i8] }
%struct._UDP_IO = type { i32, %struct._LIST_ENTRY, i64, i8, ptr, ptr, ptr, %struct.EFI_SIMPLE_NETWORK_MODE, %struct._LIST_ENTRY, ptr, %union.anon.1, %union.anon.2 }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct._LIST_ENTRY = type { ptr, ptr }
%union.anon.1 = type { ptr }
%union.anon.2 = type { %struct.EFI_UDP6_CONFIG_DATA }
%struct.EFI_UDP6_CONFIG_DATA = type { i8, i8, i8, i8, i8, i32, i32, %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%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_UDP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._EFI_UDP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [148 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [39 x i8], align 1
@gEfiUdp4ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiUdp4ProtocolGuid = external global %struct.GUID, align 4
@gEfiUdp6ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiUdp6ProtocolGuid = external global %struct.GUID, align 4

declare zeroext i8 @DebugAssertEnabled() #0

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

declare void @FreePool(ptr noundef) #0

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

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

declare ptr @AllocatePool(i64 noundef) #0

declare ptr @InitializeListHead(ptr noundef) #0

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

15:                                               ; preds = %5
  %16 = call zeroext i8 @DebugAssertEnabled()
  %17 = icmp ne i8 %16, 0
  br i1 %17, label %18, label %23

18:                                               ; preds = %15
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  call void @DebugAssert(ptr noundef @.str, i64 noundef 589, ptr noundef @.str.8)
  br label %22

22:                                               ; preds = %21, %18
  br label %23

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

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25
  %27 = call zeroext i8 @DebugAssertEnabled()
  %28 = icmp ne i8 %27, 0
  br i1 %28, label %29, label %39

29:                                               ; preds = %26
  %30 = load i8, ptr %10, align 1, !tbaa !9
  %31 = zext i8 %30 to i32
  %32 = icmp eq i32 %31, 4
  br i1 %32, label %38, label %33

33:                                               ; preds = %29
  %34 = load i8, ptr %10, align 1, !tbaa !9
  %35 = zext i8 %34 to i32
  %36 = icmp eq i32 %35, 6
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @DebugAssert(ptr noundef @.str, i64 noundef 590, ptr noundef @.str.9)
  br label %38

38:                                               ; preds = %37, %33, %29
  br label %39

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

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  %42 = call ptr @AllocatePool(i64 noundef 808)
  store ptr %42, ptr %12, align 8, !tbaa !5
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %46

45:                                               ; preds = %41
  store ptr null, ptr %6, align 8
  store i32 1, ptr %14, align 4
  br label %215

46:                                               ; preds = %41
  %47 = load i8, ptr %10, align 1, !tbaa !9
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._UDP_IO, ptr %48, i32 0, i32 3
  store i8 %47, ptr %49, align 8, !tbaa !10
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._UDP_IO, ptr %50, i32 0, i32 0
  store i32 1229997141, ptr %51, align 8, !tbaa !17
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._UDP_IO, ptr %52, i32 0, i32 1
  %54 = call ptr @InitializeListHead(ptr noundef %53)
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._UDP_IO, ptr %55, i32 0, i32 2
  store i64 1, ptr %56, align 8, !tbaa !18
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._UDP_IO, ptr %58, i32 0, i32 4
  store ptr %57, ptr %59, align 8, !tbaa !19
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._UDP_IO, ptr %61, i32 0, i32 5
  store ptr %60, ptr %62, align 8, !tbaa !20
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._UDP_IO, ptr %63, i32 0, i32 8
  %65 = call ptr @InitializeListHead(ptr noundef %64)
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._UDP_IO, ptr %66, i32 0, i32 9
  store ptr null, ptr %67, align 8, !tbaa !21
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._UDP_IO, ptr %68, i32 0, i32 6
  store ptr null, ptr %69, align 8, !tbaa !22
  %70 = load i8, ptr %10, align 1, !tbaa !9
  %71 = zext i8 %70 to i32
  %72 = icmp eq i32 %71, 4
  br i1 %72, label %73, label %120

73:                                               ; preds = %46
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._UDP_IO, ptr %76, i32 0, i32 6
  %78 = call i64 @NetLibCreateServiceChild(ptr noundef %74, ptr noundef %75, ptr noundef @gEfiUdp4ServiceBindingProtocolGuid, ptr noundef %77)
  store i64 %78, ptr %13, align 8, !tbaa !23
  %79 = load i64, ptr %13, align 8, !tbaa !23
  %80 = icmp slt i64 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %73
  br label %213

82:                                               ; preds = %73
  %83 = load ptr, ptr @gBS, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %83, i32 0, i32 33
  %85 = load ptr, ptr %84, align 8, !tbaa !24
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._UDP_IO, ptr %86, i32 0, i32 6
  %88 = load ptr, ptr %87, align 8, !tbaa !22
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._UDP_IO, ptr %89, i32 0, i32 10
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = call i64 %85(ptr noundef %88, ptr noundef @gEfiUdp4ProtocolGuid, ptr noundef %90, ptr noundef %91, ptr noundef %92, i32 noundef 16)
  store i64 %93, ptr %13, align 8, !tbaa !23
  %94 = load i64, ptr %13, align 8, !tbaa !23
  %95 = icmp slt i64 %94, 0
  br i1 %95, label %96, label %97

96:                                               ; preds = %82
  br label %194

97:                                               ; preds = %82
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = call i64 %98(ptr noundef %99, ptr noundef %100)
  %102 = icmp slt i64 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %97
  br label %169

104:                                              ; preds = %97
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._UDP_IO, ptr %105, i32 0, i32 10
  %107 = load ptr, ptr %106, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct._EFI_UDP4_PROTOCOL, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !27
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._UDP_IO, ptr %110, i32 0, i32 10
  %112 = load ptr, ptr %111, align 8, !tbaa !9
  %113 = load ptr, ptr %12, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._UDP_IO, ptr %113, i32 0, i32 7
  %115 = call i64 %109(ptr noundef %112, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef %114)
  store i64 %115, ptr %13, align 8, !tbaa !23
  %116 = load i64, ptr %13, align 8, !tbaa !23
  %117 = icmp slt i64 %116, 0
  br i1 %117, label %118, label %119

118:                                              ; preds = %104
  br label %169

119:                                              ; preds = %104
  br label %167

120:                                              ; preds = %46
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = load ptr, ptr %12, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._UDP_IO, ptr %123, i32 0, i32 6
  %125 = call i64 @NetLibCreateServiceChild(ptr noundef %121, ptr noundef %122, ptr noundef @gEfiUdp6ServiceBindingProtocolGuid, ptr noundef %124)
  store i64 %125, ptr %13, align 8, !tbaa !23
  %126 = load i64, ptr %13, align 8, !tbaa !23
  %127 = icmp slt i64 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %120
  br label %213

129:                                              ; preds = %120
  %130 = load ptr, ptr @gBS, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %130, i32 0, i32 33
  %132 = load ptr, ptr %131, align 8, !tbaa !24
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._UDP_IO, ptr %133, i32 0, i32 6
  %135 = load ptr, ptr %134, align 8, !tbaa !22
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._UDP_IO, ptr %136, i32 0, i32 10
  %138 = load ptr, ptr %8, align 8, !tbaa !5
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = call i64 %132(ptr noundef %135, ptr noundef @gEfiUdp6ProtocolGuid, ptr noundef %137, ptr noundef %138, ptr noundef %139, i32 noundef 16)
  store i64 %140, ptr %13, align 8, !tbaa !23
  %141 = load i64, ptr %13, align 8, !tbaa !23
  %142 = icmp slt i64 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %129
  br label %194

144:                                              ; preds = %129
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = load ptr, ptr %12, align 8, !tbaa !5
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = call i64 %145(ptr noundef %146, ptr noundef %147)
  %149 = icmp slt i64 %148, 0
  br i1 %149, label %150, label %151

150:                                              ; preds = %144
  br label %169

151:                                              ; preds = %144
  %152 = load ptr, ptr %12, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._UDP_IO, ptr %152, i32 0, i32 10
  %154 = load ptr, ptr %153, align 8, !tbaa !9
  %155 = getelementptr inbounds %struct._EFI_UDP6_PROTOCOL, ptr %154, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8, !tbaa !29
  %157 = load ptr, ptr %12, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct._UDP_IO, ptr %157, i32 0, i32 10
  %159 = load ptr, ptr %158, align 8, !tbaa !9
  %160 = load ptr, ptr %12, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._UDP_IO, ptr %160, i32 0, i32 7
  %162 = call i64 %156(ptr noundef %159, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef %161)
  store i64 %162, ptr %13, align 8, !tbaa !23
  %163 = load i64, ptr %13, align 8, !tbaa !23
  %164 = icmp slt i64 %163, 0
  br i1 %164, label %165, label %166

165:                                              ; preds = %151
  br label %169

166:                                              ; preds = %151
  br label %167

167:                                              ; preds = %166, %119
  %168 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %168, ptr %6, align 8
  store i32 1, ptr %14, align 4
  br label %215

169:                                              ; preds = %165, %150, %118, %103
  %170 = load i8, ptr %10, align 1, !tbaa !9
  %171 = zext i8 %170 to i32
  %172 = icmp eq i32 %171, 4
  br i1 %172, label %173, label %183

173:                                              ; preds = %169
  %174 = load ptr, ptr @gBS, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %174, i32 0, i32 34
  %176 = load ptr, ptr %175, align 8, !tbaa !31
  %177 = load ptr, ptr %12, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct._UDP_IO, ptr %177, i32 0, i32 6
  %179 = load ptr, ptr %178, align 8, !tbaa !22
  %180 = load ptr, ptr %8, align 8, !tbaa !5
  %181 = load ptr, ptr %7, align 8, !tbaa !5
  %182 = call i64 %176(ptr noundef %179, ptr noundef @gEfiUdp4ProtocolGuid, ptr noundef %180, ptr noundef %181)
  br label %193

183:                                              ; preds = %169
  %184 = load ptr, ptr @gBS, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %184, i32 0, i32 34
  %186 = load ptr, ptr %185, align 8, !tbaa !31
  %187 = load ptr, ptr %12, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct._UDP_IO, ptr %187, i32 0, i32 6
  %189 = load ptr, ptr %188, align 8, !tbaa !22
  %190 = load ptr, ptr %8, align 8, !tbaa !5
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = call i64 %186(ptr noundef %189, ptr noundef @gEfiUdp6ProtocolGuid, ptr noundef %190, ptr noundef %191)
  br label %193

193:                                              ; preds = %183, %173
  br label %194

194:                                              ; preds = %193, %143, %96
  %195 = load i8, ptr %10, align 1, !tbaa !9
  %196 = zext i8 %195 to i32
  %197 = icmp eq i32 %196, 4
  br i1 %197, label %198, label %205

198:                                              ; preds = %194
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = load ptr, ptr %12, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._UDP_IO, ptr %201, i32 0, i32 6
  %203 = load ptr, ptr %202, align 8, !tbaa !22
  %204 = call i64 @NetLibDestroyServiceChild(ptr noundef %199, ptr noundef %200, ptr noundef @gEfiUdp4ServiceBindingProtocolGuid, ptr noundef %203)
  br label %212

205:                                              ; preds = %194
  %206 = load ptr, ptr %7, align 8, !tbaa !5
  %207 = load ptr, ptr %8, align 8, !tbaa !5
  %208 = load ptr, ptr %12, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct._UDP_IO, ptr %208, i32 0, i32 6
  %210 = load ptr, ptr %209, align 8, !tbaa !22
  %211 = call i64 @NetLibDestroyServiceChild(ptr noundef %206, ptr noundef %207, ptr noundef @gEfiUdp6ServiceBindingProtocolGuid, ptr noundef %210)
  br label %212

212:                                              ; preds = %205, %198
  br label %213

213:                                              ; preds = %212, %128, %81
  %214 = load ptr, ptr %12, align 8, !tbaa !5
  call void @FreePool(ptr noundef %214)
  store ptr null, ptr %6, align 8
  store i32 1, ptr %14, align 4
  br label %215

215:                                              ; preds = %213, %167, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %216 = load ptr, ptr %6, align 8
  ret ptr %216
}

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !7, i64 32}
!11 = !{!"_UDP_IO", !12, i64 0, !13, i64 8, !14, i64 24, !7, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !15, i64 64, !13, i64 720, !6, i64 736, !7, i64 744, !7, i64 752}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!14 = !{!"long long", !7, i64 0}
!15 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !7, i64 40, !16, i64 552, !16, i64 584, !16, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!16 = !{!"", !7, i64 0}
!17 = !{!11, !12, i64 0}
!18 = !{!11, !14, i64 24}
!19 = !{!11, !6, i64 40}
!20 = !{!11, !6, i64 48}
!21 = !{!11, !6, i64 736}
!22 = !{!11, !6, i64 56}
!23 = !{!14, !14, i64 0}
!24 = !{!25, !6, i64 280}
!25 = !{!"", !26, 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}
!26 = !{!"", !14, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!27 = !{!28, !6, i64 0}
!28 = !{!"_EFI_UDP4_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}
!29 = !{!30, !6, i64 0}
!30 = !{!"_EFI_UDP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!31 = !{!25, !6, i64 288}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.GUID = type { i32, i16, i16, [8 x i8] }

@gBS = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [148 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [39 x i8], align 1
@gEfiUdp4ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiUdp4ProtocolGuid = external global %struct.GUID, align 4
@gEfiUdp6ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gEfiUdp6ProtocolGuid = external global %struct.GUID, align 4

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

declare void @FreePool(ptr noundef) local_unnamed_addr #0

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #0

declare ptr @InitializeListHead(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @UdpIoCreateIo(ptr noundef %0, ptr noundef %1, ptr noundef readonly %2, i8 noundef zeroext %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = tail call zeroext i8 @DebugAssertEnabled() #2
  %7 = icmp eq i8 %6, 0
  %8 = icmp ne ptr %2, null
  %or.cond4 = or i1 %8, %7
  br i1 %or.cond4, label %10, label %9

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

10:                                               ; preds = %5, %9
  %11 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %11, 0
  %12 = and i8 %3, -3
  %or.cond = icmp eq i8 %12, 4
  %or.cond70 = or i1 %or.cond, %.not
  br i1 %or.cond70, label %14, label %13

13:                                               ; preds = %10
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 590, ptr noundef nonnull @.str.9) #2
  br label %14

14:                                               ; preds = %13, %10
  %15 = tail call ptr @AllocatePool(i64 noundef 808) #2
  %16 = icmp eq ptr %15, null
  br i1 %16, label %77, label %17

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %15, i64 32
  store i8 %3, ptr %18, align 8, !tbaa !5
  store i32 1229997141, ptr %15, align 8, !tbaa !15
  %19 = getelementptr inbounds i8, ptr %15, i64 8
  %20 = tail call ptr @InitializeListHead(ptr noundef nonnull %19) #2
  %21 = getelementptr inbounds i8, ptr %15, i64 24
  store i64 1, ptr %21, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %15, i64 40
  store ptr %0, ptr %22, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %15, i64 48
  store ptr %1, ptr %23, align 8, !tbaa !18
  %24 = getelementptr inbounds i8, ptr %15, i64 720
  %25 = tail call ptr @InitializeListHead(ptr noundef nonnull %24) #2
  %26 = getelementptr inbounds i8, ptr %15, i64 736
  store ptr null, ptr %26, align 8, !tbaa !19
  %27 = getelementptr inbounds i8, ptr %15, i64 56
  store ptr null, ptr %27, align 8, !tbaa !20
  %28 = icmp eq i8 %3, 4
  br i1 %28, label %29, label %49

29:                                               ; preds = %17
  %30 = tail call i64 @NetLibCreateServiceChild(ptr noundef %0, ptr noundef %1, ptr noundef nonnull @gEfiUdp4ServiceBindingProtocolGuid, ptr noundef nonnull %27) #2
  %31 = icmp slt i64 %30, 0
  br i1 %31, label %76, label %32

32:                                               ; preds = %29
  %33 = load ptr, ptr @gBS, align 8, !tbaa !21
  %34 = getelementptr inbounds i8, ptr %33, i64 280
  %35 = load ptr, ptr %34, align 8, !tbaa !22
  %36 = load ptr, ptr %27, align 8, !tbaa !20
  %37 = getelementptr inbounds i8, ptr %15, i64 744
  %38 = tail call i64 %35(ptr noundef %36, ptr noundef nonnull @gEfiUdp4ProtocolGuid, ptr noundef nonnull %37, ptr noundef %1, ptr noundef %0, i32 noundef 16) #2
  %39 = icmp slt i64 %38, 0
  br i1 %39, label %.sink.split, label %40

40:                                               ; preds = %32
  %41 = tail call i64 %2(ptr noundef nonnull %15, ptr noundef %4) #2
  %42 = icmp slt i64 %41, 0
  br i1 %42, label %.sink.split.sink.split, label %43

43:                                               ; preds = %40
  %44 = load ptr, ptr %37, align 8, !tbaa !25
  %45 = load ptr, ptr %44, align 8, !tbaa !26
  %46 = getelementptr inbounds i8, ptr %15, i64 64
  %47 = tail call i64 %45(ptr noundef nonnull %44, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef nonnull %46) #2
  %48 = icmp slt i64 %47, 0
  br i1 %48, label %.sink.split.sink.split, label %77

49:                                               ; preds = %17
  %50 = tail call i64 @NetLibCreateServiceChild(ptr noundef %0, ptr noundef %1, ptr noundef nonnull @gEfiUdp6ServiceBindingProtocolGuid, ptr noundef nonnull %27) #2
  %51 = icmp slt i64 %50, 0
  br i1 %51, label %76, label %52

52:                                               ; preds = %49
  %53 = load ptr, ptr @gBS, align 8, !tbaa !21
  %54 = getelementptr inbounds i8, ptr %53, i64 280
  %55 = load ptr, ptr %54, align 8, !tbaa !22
  %56 = load ptr, ptr %27, align 8, !tbaa !20
  %57 = getelementptr inbounds i8, ptr %15, i64 744
  %58 = tail call i64 %55(ptr noundef %56, ptr noundef nonnull @gEfiUdp6ProtocolGuid, ptr noundef nonnull %57, ptr noundef %1, ptr noundef %0, i32 noundef 16) #2
  %59 = icmp slt i64 %58, 0
  br i1 %59, label %.sink.split, label %60

60:                                               ; preds = %52
  %61 = tail call i64 %2(ptr noundef nonnull %15, ptr noundef %4) #2
  %62 = icmp slt i64 %61, 0
  br i1 %62, label %.sink.split.sink.split, label %63

63:                                               ; preds = %60
  %64 = load ptr, ptr %57, align 8, !tbaa !25
  %65 = load ptr, ptr %64, align 8, !tbaa !28
  %66 = getelementptr inbounds i8, ptr %15, i64 64
  %67 = tail call i64 %65(ptr noundef nonnull %64, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef nonnull %66) #2
  %68 = icmp slt i64 %67, 0
  br i1 %68, label %.sink.split.sink.split, label %77

.sink.split.sink.split:                           ; preds = %63, %60, %40, %43
  %gEfiUdp6ProtocolGuid.sink = phi ptr [ @gEfiUdp4ProtocolGuid, %43 ], [ @gEfiUdp4ProtocolGuid, %40 ], [ @gEfiUdp6ProtocolGuid, %60 ], [ @gEfiUdp6ProtocolGuid, %63 ]
  %gEfiUdp4ServiceBindingProtocolGuid.sink.ph = phi ptr [ @gEfiUdp4ServiceBindingProtocolGuid, %43 ], [ @gEfiUdp4ServiceBindingProtocolGuid, %40 ], [ @gEfiUdp6ServiceBindingProtocolGuid, %60 ], [ @gEfiUdp6ServiceBindingProtocolGuid, %63 ]
  %69 = load ptr, ptr @gBS, align 8, !tbaa !21
  %70 = getelementptr inbounds i8, ptr %69, i64 288
  %71 = load ptr, ptr %70, align 8, !tbaa !30
  %72 = load ptr, ptr %27, align 8, !tbaa !20
  %73 = tail call i64 %71(ptr noundef %72, ptr noundef nonnull %gEfiUdp6ProtocolGuid.sink, ptr noundef %1, ptr noundef %0) #2
  br label %.sink.split

.sink.split:                                      ; preds = %.sink.split.sink.split, %52, %32
  %gEfiUdp4ServiceBindingProtocolGuid.sink = phi ptr [ @gEfiUdp4ServiceBindingProtocolGuid, %32 ], [ @gEfiUdp6ServiceBindingProtocolGuid, %52 ], [ %gEfiUdp4ServiceBindingProtocolGuid.sink.ph, %.sink.split.sink.split ]
  %74 = load ptr, ptr %27, align 8, !tbaa !20
  %75 = tail call i64 @NetLibDestroyServiceChild(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %gEfiUdp4ServiceBindingProtocolGuid.sink, ptr noundef %74) #2
  br label %76

76:                                               ; preds = %.sink.split, %49, %29
  tail call void @FreePool(ptr noundef nonnull %15) #2
  br label %77

77:                                               ; preds = %43, %63, %14, %76
  %.0 = phi ptr [ null, %76 ], [ null, %14 ], [ %15, %63 ], [ %15, %43 ]
  ret ptr %.0
}

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

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

attributes #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 = { 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 #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, !8, i64 32}
!6 = !{!"_UDP_IO", !7, i64 0, !10, i64 8, !12, i64 24, !8, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !13, i64 64, !10, i64 720, !11, i64 736, !8, i64 744, !8, i64 752}
!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 = !{!"long long", !8, i64 0}
!13 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40, !14, i64 552, !14, i64 584, !14, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!14 = !{!"", !8, i64 0}
!15 = !{!6, !7, i64 0}
!16 = !{!6, !12, i64 24}
!17 = !{!6, !11, i64 40}
!18 = !{!6, !11, i64 48}
!19 = !{!6, !11, i64 736}
!20 = !{!6, !11, i64 56}
!21 = !{!11, !11, i64 0}
!22 = !{!23, !11, i64 280}
!23 = !{!"", !24, 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}
!24 = !{!"", !12, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!25 = !{!8, !8, i64 0}
!26 = !{!27, !11, i64 0}
!27 = !{!"_EFI_UDP4_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!28 = !{!29, !11, i64 0}
!29 = !{!"_EFI_UDP6_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48}
!30 = !{!23, !11, i64 288}


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