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

; 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.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 }

@.str = external hidden unnamed_addr constant [151 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@gBS = external global ptr, align 8
@gEfiTcp4ProtocolGuid = external global %struct.GUID, align 4
@.str.25 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [63 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() #1

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

; 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 ptr @RemoveEntryList(ptr noundef) #1

declare void @FreePool(ptr noundef) #1

declare void @NetbufQueFree(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @SockDestroy(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  br label %6

6:                                                ; preds = %1
  %7 = call zeroext i8 @DebugAssertEnabled()
  %8 = icmp ne i8 %7, 0
  br i1 %8, label %9, label %16

9:                                                ; preds = %6
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct._SOCKET, ptr %10, i32 0, i32 7
  %12 = load i32, ptr %11, align 4, !tbaa !9
  %13 = icmp eq i32 1, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %9
  call void @DebugAssert(ptr noundef @.str, i64 noundef 724, ptr noundef @.str.5)
  br label %15

15:                                               ; preds = %14, %9
  br label %16

16:                                               ; preds = %15, %6
  br label %17

17:                                               ; preds = %16
  br label %18

18:                                               ; preds = %17
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct._SOCKET, ptr %19, i32 0, i32 29
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %31

23:                                               ; preds = %18
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct._SOCKET, ptr %24, i32 0, i32 29
  %26 = load ptr, ptr %25, align 8, !tbaa !17
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._SOCKET, ptr %28, i32 0, i32 30
  %30 = load ptr, ptr %29, align 8, !tbaa !18
  call void %26(ptr noundef %27, ptr noundef %30)
  br label %31

31:                                               ; preds = %23, %18
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._SOCKET, ptr %32, i32 0, i32 6
  %34 = load i8, ptr %33, align 8, !tbaa !19
  %35 = zext i8 %34 to i32
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %42, label %37

37:                                               ; preds = %31
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  call void @SockConnFlush(ptr noundef %38)
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  call void @SockSetState(ptr noundef %39, i8 noundef zeroext 0)
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct._SOCKET, ptr %40, i32 0, i32 6
  store i8 0, ptr %41, align 8, !tbaa !19
  br label %42

42:                                               ; preds = %37, %31
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._SOCKET, ptr %43, i32 0, i32 12
  %45 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %44, i32 0, i32 2
  %46 = load ptr, ptr %45, align 8, !tbaa !20
  call void @NetbufQueFree(ptr noundef %46)
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._SOCKET, ptr %47, i32 0, i32 11
  %49 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !21
  call void @NetbufQueFree(ptr noundef %50)
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._SOCKET, ptr %51, i32 0, i32 17
  %53 = load ptr, ptr %52, align 8, !tbaa !22
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %86

55:                                               ; preds = %42
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._SOCKET, ptr %56, i32 0, i32 18
  %58 = call ptr @RemoveEntryList(ptr noundef %57)
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._SOCKET, ptr %59, i32 0, i32 17
  %61 = load ptr, ptr %60, align 8, !tbaa !22
  %62 = getelementptr inbounds %struct._SOCKET, ptr %61, i32 0, i32 16
  %63 = load i32, ptr %62, align 8, !tbaa !23
  %64 = add i32 %63, -1
  store i32 %64, ptr %62, align 8, !tbaa !23
  br label %65

65:                                               ; preds = %55
  %66 = call zeroext i8 @DebugPrintEnabled()
  %67 = icmp ne i8 %66, 0
  br i1 %67, label %68, label %81

68:                                               ; preds = %65
  br label %69

69:                                               ; preds = %68
  %70 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64)
  %71 = icmp ne i8 %70, 0
  br i1 %71, label %72, label %78

72:                                               ; preds = %69
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._SOCKET, ptr %73, i32 0, i32 17
  %75 = load ptr, ptr %74, align 8, !tbaa !22
  %76 = getelementptr inbounds %struct._SOCKET, ptr %75, i32 0, i32 16
  %77 = load i32, ptr %76, align 8, !tbaa !23
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef @.str.25, i32 noundef %77)
  br label %78

78:                                               ; preds = %72, %69
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80, %65
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._SOCKET, ptr %84, i32 0, i32 17
  store ptr null, ptr %85, align 8, !tbaa !22
  br label %86

86:                                               ; preds = %83, %42
  store ptr @gEfiTcp4ProtocolGuid, ptr %4, align 8, !tbaa !5
  %87 = load ptr, ptr @gBS, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %87, i32 0, i32 33
  %89 = load ptr, ptr %88, align 8, !tbaa !24
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._SOCKET, ptr %90, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !27
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = load ptr, ptr %2, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._SOCKET, ptr %94, i32 0, i32 2
  %96 = load ptr, ptr %95, align 8, !tbaa !28
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._SOCKET, ptr %97, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !27
  %100 = call i64 %89(ptr noundef %92, ptr noundef %93, ptr noundef %3, ptr noundef %96, ptr noundef %99, i32 noundef 2)
  store i64 %100, ptr %5, align 8, !tbaa !29
  %101 = load i64, ptr %5, align 8, !tbaa !29
  %102 = icmp slt i64 %101, 0
  br i1 %102, label %103, label %119

103:                                              ; preds = %86
  br label %104

104:                                              ; preds = %103
  %105 = call zeroext i8 @DebugPrintEnabled()
  %106 = icmp ne i8 %105, 0
  br i1 %106, label %107, label %116

107:                                              ; preds = %104
  br label %108

108:                                              ; preds = %107
  %109 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %110 = icmp ne i8 %109, 0
  br i1 %110, label %111, label %113

111:                                              ; preds = %108
  %112 = load i64, ptr %5, align 8, !tbaa !29
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.26, i64 noundef %112)
  br label %113

113:                                              ; preds = %111, %108
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114
  br label %116

116:                                              ; preds = %115, %104
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  br label %129

119:                                              ; preds = %86
  %120 = load ptr, ptr @gBS, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %120, i32 0, i32 40
  %122 = load ptr, ptr %121, align 8, !tbaa !30
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._SOCKET, ptr %123, i32 0, i32 1
  %125 = load ptr, ptr %124, align 8, !tbaa !27
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = call i64 (ptr, ...) %122(ptr noundef %125, ptr noundef %126, ptr noundef %127, ptr noundef null)
  br label %129

129:                                              ; preds = %119, %118
  %130 = load ptr, ptr %2, align 8, !tbaa !5
  call void @FreePool(ptr noundef %130)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @SockConnFlush(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @SockSetState(ptr noundef, i8 noundef zeroext) #2

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, !11, i64 60}
!10 = !{!"_SOCKET", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !7, i64 56, !11, i64 60, !7, i64 64, !13, i64 66, !14, i64 72, !16, i64 96, !16, i64 112, !15, i64 128, !7, i64 136, !11, i64 140, !11, i64 144, !6, i64 152, !12, i64 160, !12, i64 176, !12, i64 192, !12, i64 208, !12, 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}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !15, i64 0, !15, i64 8, !11, i64 16}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_SOCK_BUFFER", !11, i64 0, !11, i64 4, !6, i64 8}
!17 = !{!10, !6, i64 376}
!18 = !{!10, !6, i64 384}
!19 = !{!10, !7, i64 56}
!20 = !{!10, !6, i64 120}
!21 = !{!10, !6, i64 104}
!22 = !{!10, !6, i64 152}
!23 = !{!10, !11, i64 144}
!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 = !{!"", !15, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!27 = !{!10, !6, i64 8}
!28 = !{!10, !6, i64 16}
!29 = !{!15, !15, i64 0}
!30 = !{!25, !6, i64 336}


; 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] }

@.str = external hidden unnamed_addr constant [151 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@gEfiTcp4ProtocolGuid = external global %struct.GUID, align 4
@.str.25 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [63 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

; 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 ptr @RemoveEntryList(ptr noundef) local_unnamed_addr #1

declare void @FreePool(ptr noundef) local_unnamed_addr #1

declare void @NetbufQueFree(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @SockDestroy(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 zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %3, 0
  br i1 %.not, label %9, label %4

4:                                                ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 60
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = icmp eq i32 %6, 1
  br i1 %7, label %9, label %8

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

9:                                                ; preds = %4, %8, %1
  %10 = getelementptr inbounds i8, ptr %0, i64 376
  %11 = load ptr, ptr %10, align 8, !tbaa !16
  %.not25 = icmp eq ptr %11, null
  br i1 %.not25, label %15, label %12

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %0, i64 384
  %14 = load ptr, ptr %13, align 8, !tbaa !17
  tail call void %11(ptr noundef nonnull %0, ptr noundef %14) #3
  br label %15

15:                                               ; preds = %12, %9
  %16 = getelementptr inbounds i8, ptr %0, i64 56
  %17 = load i8, ptr %16, align 8, !tbaa !18
  %18 = icmp eq i8 %17, 0
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  tail call void @SockConnFlush(ptr noundef nonnull %0)
  tail call void @SockSetState(ptr noundef nonnull %0, i8 noundef zeroext 0)
  store i8 0, ptr %16, align 8, !tbaa !18
  br label %20

20:                                               ; preds = %19, %15
  %21 = getelementptr inbounds i8, ptr %0, i64 120
  %22 = load ptr, ptr %21, align 8, !tbaa !19
  tail call void @NetbufQueFree(ptr noundef %22) #3
  %23 = getelementptr inbounds i8, ptr %0, i64 104
  %24 = load ptr, ptr %23, align 8, !tbaa !20
  tail call void @NetbufQueFree(ptr noundef %24) #3
  %25 = getelementptr inbounds i8, ptr %0, i64 152
  %26 = load ptr, ptr %25, align 8, !tbaa !21
  %.not26 = icmp eq ptr %26, null
  br i1 %.not26, label %42, label %27

27:                                               ; preds = %20
  %28 = getelementptr inbounds i8, ptr %0, i64 160
  %29 = tail call ptr @RemoveEntryList(ptr noundef nonnull %28) #3
  %30 = load ptr, ptr %25, align 8, !tbaa !21
  %31 = getelementptr inbounds i8, ptr %30, i64 144
  %32 = load i32, ptr %31, align 8, !tbaa !22
  %33 = add i32 %32, -1
  store i32 %33, ptr %31, align 8, !tbaa !22
  %34 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not27 = icmp eq i8 %34, 0
  br i1 %.not27, label %41, label %35

35:                                               ; preds = %27
  %36 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64) #3
  %.not28 = icmp eq i8 %36, 0
  br i1 %.not28, label %41, label %37

37:                                               ; preds = %35
  %38 = load ptr, ptr %25, align 8, !tbaa !21
  %39 = getelementptr inbounds i8, ptr %38, i64 144
  %40 = load i32, ptr %39, align 8, !tbaa !22
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef nonnull @.str.25, i32 noundef %40) #3
  br label %41

41:                                               ; preds = %35, %37, %27
  store ptr null, ptr %25, align 8, !tbaa !21
  br label %42

42:                                               ; preds = %41, %20
  %43 = load ptr, ptr @gBS, align 8, !tbaa !23
  %44 = getelementptr inbounds i8, ptr %43, i64 280
  %45 = load ptr, ptr %44, align 8, !tbaa !24
  %46 = getelementptr inbounds i8, ptr %0, i64 8
  %47 = load ptr, ptr %46, align 8, !tbaa !27
  %48 = getelementptr inbounds i8, ptr %0, i64 16
  %49 = load ptr, ptr %48, align 8, !tbaa !28
  %50 = call i64 %45(ptr noundef %47, ptr noundef nonnull @gEfiTcp4ProtocolGuid, ptr noundef nonnull %2, ptr noundef %49, ptr noundef %47, i32 noundef 2) #3
  %51 = icmp slt i64 %50, 0
  br i1 %51, label %52, label %57

52:                                               ; preds = %42
  %53 = call zeroext i8 @DebugPrintEnabled() #3
  %.not29 = icmp eq i8 %53, 0
  br i1 %.not29, label %64, label %54

54:                                               ; preds = %52
  %55 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not30 = icmp eq i8 %55, 0
  br i1 %.not30, label %64, label %56

56:                                               ; preds = %54
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.26, i64 noundef %50) #3
  br label %64

57:                                               ; preds = %42
  %58 = load ptr, ptr @gBS, align 8, !tbaa !23
  %59 = getelementptr inbounds i8, ptr %58, i64 336
  %60 = load ptr, ptr %59, align 8, !tbaa !29
  %61 = load ptr, ptr %46, align 8, !tbaa !27
  %62 = load ptr, ptr %2, align 8, !tbaa !23
  %63 = call i64 (ptr, ...) %60(ptr noundef %61, ptr noundef nonnull @gEfiTcp4ProtocolGuid, ptr noundef %62, ptr noundef null) #3
  br label %64

64:                                               ; preds = %52, %56, %54, %57
  call void @FreePool(ptr noundef nonnull %0) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @SockConnFlush(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @SockSetState(ptr noundef, i8 noundef zeroext) local_unnamed_addr #2

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 60}
!6 = !{!"_SOCKET", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !11, i64 40, !8, i64 56, !7, i64 60, !8, i64 64, !12, i64 66, !13, i64 72, !15, i64 96, !15, i64 112, !14, i64 128, !8, i64 136, !7, i64 140, !7, i64 144, !10, i64 152, !11, i64 160, !11, i64 176, !11, i64 192, !11, i64 208, !11, i64 224, !10, i64 240, !10, i64 248, !10, i64 256, !8, i64 264, !8, i64 288, !10, i64 368, !10, i64 376, !10, i64 384}
!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 = !{!"short", !8, i64 0}
!13 = !{!"", !14, i64 0, !14, i64 8, !7, i64 16}
!14 = !{!"long long", !8, i64 0}
!15 = !{!"_SOCK_BUFFER", !7, i64 0, !7, i64 4, !10, i64 8}
!16 = !{!6, !10, i64 376}
!17 = !{!6, !10, i64 384}
!18 = !{!6, !8, i64 56}
!19 = !{!6, !10, i64 120}
!20 = !{!6, !10, i64 104}
!21 = !{!6, !10, i64 152}
!22 = !{!6, !7, i64 144}
!23 = !{!10, !10, i64 0}
!24 = !{!25, !10, i64 280}
!25 = !{!"", !26, 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}
!26 = !{!"", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!27 = !{!6, !10, i64 8}
!28 = !{!6, !10, i64 16}
!29 = !{!25, !10, i64 336}


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