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

; 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._SOCKET = type { i32, ptr, ptr, ptr, ptr, %struct._LIST_ENTRY, i8, i32, i8, i16, %struct.EFI_LOCK, %struct._SOCK_BUFFER, %struct._SOCK_BUFFER, i64, i8, i32, i32, ptr, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, ptr, [20 x i8], %union._NET_PROTOCOL, ptr, ptr, ptr }
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct._SOCK_BUFFER = type { i32, i32, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%union._NET_PROTOCOL = type { %struct._EFI_TCP4_PROTOCOL }
%struct._EFI_TCP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._TCP4_PROTO_DATA = type { ptr, ptr }
%struct._TCP4_SERVICE_DATA = type { i32, ptr, ptr, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, %struct._LIST_ENTRY }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct._TCP_CB = type { %struct._LIST_ENTRY, ptr, ptr, %struct._TCP_PEER, %struct._TCP_PEER, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i32, i8, i8, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, i32, i32, i32, i32, i32, i16, i16, [6 x i32], i32, i32, i32, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, i8, i8, i32, i32, i32, i8, i8, i16, i32, i32, i32, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, ptr }
%struct._TCP_PEER = type { i32, i16 }
%struct.EFI_IPv4_ADDRESS = type { [4 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._IP_IO_IP_INFO = type { %union.EFI_IP_ADDRESS, %union.IP_IO_IP_MASK, %struct._LIST_ENTRY, ptr, %union.IP_IO_IP_PROTOCOL, %union.IP_IO_IP_COMPLETION_TOKEN, i64, i8 }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%union.IP_IO_IP_MASK = type { i32 }
%union.IP_IO_IP_PROTOCOL = type { ptr }
%union.IP_IO_IP_COMPLETION_TOKEN = type { %struct.EFI_IP4_COMPLETION_TOKEN }
%struct.EFI_IP4_COMPLETION_TOKEN = type { ptr, i64, %union.anon }
%union.anon = type { ptr }
%struct._IP_IO = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, ptr, %union.IP_IO_IP_PROTOCOL, i8, i8, %union.IP_IO_IP_COMPLETION_TOKEN, %struct._LIST_ENTRY, ptr, ptr, ptr, ptr, i8 }

@gBS = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [44 x i8], align 1
@gEfiIp4ProtocolGuid = external global %struct.GUID, align 4

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

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

declare zeroext i8 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

declare void @DebugPrint(i64 noundef, ptr noundef, ...) #1

declare void @FreePool(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Tcp4AttachPcb(ptr noundef %0) #2 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  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
  %10 = call ptr @AllocateZeroPool(i64 noundef 288)
  store ptr %10, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %28

13:                                               ; preds = %1
  br label %14

14:                                               ; preds = %13
  %15 = call zeroext i8 @DebugPrintEnabled()
  %16 = icmp ne i8 %15, 0
  br i1 %16, label %17, label %25

17:                                               ; preds = %14
  br label %18

18:                                               ; preds = %17
  %19 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %20 = icmp ne i8 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %18
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.4)
  br label %22

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

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24, %14
  br label %26

26:                                               ; preds = %25
  br label %27

27:                                               ; preds = %26
  store i64 -9223372036854775799, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %89

28:                                               ; preds = %1
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._SOCKET, ptr %29, i32 0, i32 26
  %31 = getelementptr inbounds [20 x i8], ptr %30, i64 0, i64 0
  store ptr %31, ptr %5, align 8, !tbaa !5
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._TCP4_PROTO_DATA, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  store ptr %36, ptr %6, align 8, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = call ptr @IpIoAddIp(ptr noundef %37)
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._TCP_CB, ptr %39, i32 0, i32 62
  store ptr %38, ptr %40, align 8, !tbaa !16
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._TCP_CB, ptr %41, i32 0, i32 62
  %43 = load ptr, ptr %42, align 8, !tbaa !16
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %47

45:                                               ; preds = %28
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  call void @FreePool(ptr noundef %46)
  store i64 -9223372036854775799, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %89

47:                                               ; preds = %28
  %48 = load ptr, ptr @gBS, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %48, i32 0, i32 33
  %50 = load ptr, ptr %49, align 8, !tbaa !21
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._TCP_CB, ptr %51, i32 0, i32 62
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %53, i32 0, i32 3
  %55 = load ptr, ptr %54, align 8, !tbaa !25
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._IP_IO, ptr %56, i32 0, i32 3
  %58 = load ptr, ptr %57, align 8, !tbaa !27
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._SOCKET, ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !29
  %62 = call i64 %50(ptr noundef %55, ptr noundef @gEfiIp4ProtocolGuid, ptr noundef %8, ptr noundef %58, ptr noundef %61, i32 noundef 8)
  store i64 %62, ptr %7, align 8, !tbaa !33
  %63 = load i64, ptr %7, align 8, !tbaa !33
  %64 = icmp slt i64 %63, 0
  br i1 %64, label %65, label %71

65:                                               ; preds = %47
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._TCP_CB, ptr %67, i32 0, i32 62
  %69 = load ptr, ptr %68, align 8, !tbaa !16
  call void @IpIoRemoveIp(ptr noundef %66, ptr noundef %69)
  %70 = load i64, ptr %7, align 8, !tbaa !33
  store i64 %70, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %89

71:                                               ; preds = %47
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._TCP_CB, ptr %72, i32 0, i32 0
  %74 = call ptr @InitializeListHead(ptr noundef %73)
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._TCP_CB, ptr %75, i32 0, i32 5
  %77 = call ptr @InitializeListHead(ptr noundef %76)
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._TCP_CB, ptr %78, i32 0, i32 6
  %80 = call ptr @InitializeListHead(ptr noundef %79)
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._TCP_CB, ptr %81, i32 0, i32 9
  store i8 0, ptr %82, align 8, !tbaa !34
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._TCP_CB, ptr %84, i32 0, i32 2
  store ptr %83, ptr %85, align 8, !tbaa !35
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._TCP4_PROTO_DATA, ptr %87, i32 0, i32 1
  store ptr %86, ptr %88, align 8, !tbaa !36
  store i64 0, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %89

89:                                               ; preds = %71, %65, %45, %27
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %90 = load i64, ptr %2, align 8
  ret i64 %90
}

declare ptr @AllocateZeroPool(i64 noundef) #1

declare ptr @IpIoAddIp(ptr noundef) #1

declare void @IpIoRemoveIp(ptr noundef, ptr noundef) #1

declare ptr @InitializeListHead(ptr noundef) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_TCP4_PROTO_DATA", !6, i64 0, !6, i64 8}
!11 = !{!12, !6, i64 16}
!12 = !{!"_TCP4_SERVICE_DATA", !13, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !6, i64 40, !15, i64 48}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!15 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!16 = !{!17, !6, i64 280}
!17 = !{!"_TCP_CB", !15, i64 0, !6, i64 16, !6, i64 24, !18, i64 32, !18, i64 40, !15, i64 48, !15, i64 64, !13, i64 80, !13, i64 84, !7, i64 88, !7, i64 89, !19, i64 90, !13, i64 92, !13, i64 96, !13, i64 100, !13, i64 104, !13, i64 108, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124, !19, i64 128, !13, i64 132, !13, i64 136, !13, i64 140, !13, i64 144, !13, i64 148, !19, i64 152, !19, i64 154, !7, i64 156, !13, i64 180, !13, i64 184, !13, i64 188, !7, i64 192, !7, i64 193, !7, i64 194, !13, i64 196, !13, i64 200, !13, i64 204, !13, i64 208, !13, i64 212, !13, i64 216, !13, i64 220, !13, i64 224, !13, i64 228, !13, i64 232, !19, i64 236, !7, i64 238, !7, i64 239, !13, i64 240, !13, i64 244, !13, i64 248, !7, i64 252, !7, i64 253, !19, i64 254, !13, i64 256, !13, i64 260, !13, i64 264, !7, i64 268, !7, i64 269, !7, i64 270, !20, i64 271, !6, i64 280}
!18 = !{!"_TCP_PEER", !13, i64 0, !19, i64 4}
!19 = !{!"short", !7, i64 0}
!20 = !{!"", !7, i64 0}
!21 = !{!22, !6, i64 280}
!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 = !{!"", !24, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!24 = !{!"long long", !7, i64 0}
!25 = !{!26, !6, i64 40}
!26 = !{!"_IP_IO_IP_INFO", !7, i64 0, !7, i64 16, !15, i64 24, !6, i64 40, !7, i64 48, !7, i64 56, !24, i64 80, !7, i64 88}
!27 = !{!28, !6, i64 40}
!28 = !{!"_IP_IO", !15, i64 0, !15, i64 16, !6, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !7, i64 64, !7, i64 65, !7, i64 72, !15, i64 96, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !7, i64 144}
!29 = !{!30, !6, i64 8}
!30 = !{!"_SOCKET", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !15, i64 40, !7, i64 56, !13, i64 60, !7, i64 64, !19, i64 66, !31, i64 72, !32, i64 96, !32, i64 112, !24, i64 128, !7, i64 136, !13, i64 140, !13, i64 144, !6, i64 152, !15, i64 160, !15, i64 176, !15, i64 192, !15, i64 208, !15, i64 224, !6, i64 240, !6, i64 248, !6, i64 256, !7, i64 264, !7, i64 288, !6, i64 368, !6, i64 376, !6, i64 384}
!31 = !{!"", !24, i64 0, !24, i64 8, !13, i64 16}
!32 = !{!"_SOCK_BUFFER", !13, i64 0, !13, i64 4, !6, i64 8}
!33 = !{!24, !24, i64 0}
!34 = !{!17, !7, i64 88}
!35 = !{!17, !6, i64 24}
!36 = !{!10, !6, i64 8}


; 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.4 = external hidden unnamed_addr constant [44 x i8], align 1
@gEfiIp4ProtocolGuid = external global %struct.GUID, align 4

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

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

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) local_unnamed_addr #1

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

declare void @FreePool(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @Tcp4AttachPcb(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %3 = tail call ptr @AllocateZeroPool(i64 noundef 288) #3
  %4 = icmp eq ptr %3, null
  br i1 %4, label %5, label %10

5:                                                ; preds = %1
  %6 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not = icmp eq i8 %6, 0
  br i1 %.not, label %42, label %7

7:                                                ; preds = %5
  %8 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not25 = icmp eq i8 %8, 0
  br i1 %.not25, label %42, label %9

9:                                                ; preds = %7
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.4) #3
  br label %42

10:                                               ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 264
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !10
  %15 = tail call ptr @IpIoAddIp(ptr noundef %14) #3
  %16 = getelementptr inbounds i8, ptr %3, i64 280
  store ptr %15, ptr %16, align 8, !tbaa !15
  %17 = icmp eq ptr %15, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %10
  tail call void @FreePool(ptr noundef nonnull %3) #3
  br label %42

19:                                               ; preds = %10
  %20 = load ptr, ptr @gBS, align 8, !tbaa !20
  %21 = getelementptr inbounds i8, ptr %20, i64 280
  %22 = load ptr, ptr %21, align 8, !tbaa !21
  %23 = getelementptr inbounds i8, ptr %15, i64 40
  %24 = load ptr, ptr %23, align 8, !tbaa !25
  %25 = getelementptr inbounds i8, ptr %14, i64 40
  %26 = load ptr, ptr %25, align 8, !tbaa !27
  %27 = getelementptr inbounds i8, ptr %0, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !29
  %29 = call i64 %22(ptr noundef %24, ptr noundef nonnull @gEfiIp4ProtocolGuid, ptr noundef nonnull %2, ptr noundef %26, ptr noundef %28, i32 noundef 8) #3
  %30 = icmp slt i64 %29, 0
  br i1 %30, label %31, label %33

31:                                               ; preds = %19
  %32 = load ptr, ptr %16, align 8, !tbaa !15
  call void @IpIoRemoveIp(ptr noundef nonnull %14, ptr noundef %32) #3
  br label %42

33:                                               ; preds = %19
  %34 = call ptr @InitializeListHead(ptr noundef nonnull %3) #3
  %35 = getelementptr inbounds i8, ptr %3, i64 48
  %36 = call ptr @InitializeListHead(ptr noundef nonnull %35) #3
  %37 = getelementptr inbounds i8, ptr %3, i64 64
  %38 = call ptr @InitializeListHead(ptr noundef nonnull %37) #3
  %39 = getelementptr inbounds i8, ptr %3, i64 88
  store i8 0, ptr %39, align 8, !tbaa !33
  %40 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %0, ptr %40, align 8, !tbaa !34
  %41 = getelementptr inbounds i8, ptr %0, i64 272
  store ptr %3, ptr %41, align 8, !tbaa !35
  br label %42

42:                                               ; preds = %5, %9, %7, %33, %31, %18
  %.0 = phi i64 [ -9223372036854775799, %18 ], [ %29, %31 ], [ 0, %33 ], [ -9223372036854775799, %7 ], [ -9223372036854775799, %9 ], [ -9223372036854775799, %5 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret i64 %.0
}

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #1

declare ptr @IpIoAddIp(ptr noundef) local_unnamed_addr #1

declare void @IpIoRemoveIp(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @InitializeListHead(ptr noundef) local_unnamed_addr #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_TCP4_PROTO_DATA", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 16}
!11 = !{!"_TCP4_SERVICE_DATA", !12, i64 0, !7, i64 8, !7, i64 16, !13, i64 24, !7, i64 40, !14, i64 48}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !7, i64 0, !7, i64 8}
!14 = !{!"_LIST_ENTRY", !7, i64 0, !7, i64 8}
!15 = !{!16, !7, i64 280}
!16 = !{!"_TCP_CB", !14, i64 0, !7, i64 16, !7, i64 24, !17, i64 32, !17, i64 40, !14, i64 48, !14, i64 64, !12, i64 80, !12, i64 84, !8, i64 88, !8, i64 89, !18, i64 90, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !18, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !18, i64 152, !18, i64 154, !8, i64 156, !12, i64 180, !12, i64 184, !12, i64 188, !8, i64 192, !8, i64 193, !8, i64 194, !12, i64 196, !12, i64 200, !12, i64 204, !12, i64 208, !12, i64 212, !12, i64 216, !12, i64 220, !12, i64 224, !12, i64 228, !12, i64 232, !18, i64 236, !8, i64 238, !8, i64 239, !12, i64 240, !12, i64 244, !12, i64 248, !8, i64 252, !8, i64 253, !18, i64 254, !12, i64 256, !12, i64 260, !12, i64 264, !8, i64 268, !8, i64 269, !8, i64 270, !19, i64 271, !7, i64 280}
!17 = !{!"_TCP_PEER", !12, i64 0, !18, i64 4}
!18 = !{!"short", !8, i64 0}
!19 = !{!"", !8, i64 0}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !7, i64 280}
!22 = !{!"", !23, i64 0, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368}
!23 = !{!"", !24, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!24 = !{!"long long", !8, i64 0}
!25 = !{!26, !7, i64 40}
!26 = !{!"_IP_IO_IP_INFO", !8, i64 0, !8, i64 16, !14, i64 24, !7, i64 40, !8, i64 48, !8, i64 56, !24, i64 80, !8, i64 88}
!27 = !{!28, !7, i64 40}
!28 = !{!"_IP_IO", !14, i64 0, !14, i64 16, !7, i64 32, !7, i64 40, !7, i64 48, !8, i64 56, !8, i64 64, !8, i64 65, !8, i64 72, !14, i64 96, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !8, i64 144}
!29 = !{!30, !7, i64 8}
!30 = !{!"_SOCKET", !12, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !14, i64 40, !8, i64 56, !12, i64 60, !8, i64 64, !18, i64 66, !31, i64 72, !32, i64 96, !32, i64 112, !24, i64 128, !8, i64 136, !12, i64 140, !12, i64 144, !7, i64 152, !14, i64 160, !14, i64 176, !14, i64 192, !14, i64 208, !14, i64 224, !7, i64 240, !7, i64 248, !7, i64 256, !8, i64 264, !8, i64 288, !7, i64 368, !7, i64 376, !7, i64 384}
!31 = !{!"", !24, i64 0, !24, i64 8, !12, i64 16}
!32 = !{!"_SOCK_BUFFER", !12, i64 0, !12, i64 4, !7, i64 8}
!33 = !{!16, !8, i64 88}
!34 = !{!16, !7, i64 24}
!35 = !{!6, !7, i64 8}


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