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

; 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._SOCK_INIT_DATA = type { i32, i8, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr }
%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
@gBS = external global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [62 x i8], align 1
@gEfiTcp4ProtocolGuid = external global %struct.GUID, align 4
@.str.21 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [70 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 void @FreePool(ptr noundef) #1

declare ptr @InsertTailList(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @SockCreate(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = 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
  br label %8

8:                                                ; preds = %1
  %9 = call zeroext i8 @DebugAssertEnabled()
  %10 = icmp ne i8 %9, 0
  br i1 %10, label %11, label %21

11:                                               ; preds = %8
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %19

14:                                               ; preds = %11
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %15, i32 0, i32 12
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = icmp ne ptr %17, null
  br i1 %18, label %20, label %19

19:                                               ; preds = %14, %11
  call void @DebugAssert(ptr noundef @.str, i64 noundef 560, ptr noundef @.str.14)
  br label %20

20:                                               ; preds = %19, %14
  br label %21

21:                                               ; preds = %20, %8
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  %25 = call zeroext i8 @DebugAssertEnabled()
  %26 = icmp ne i8 %25, 0
  br i1 %26, label %27, label %34

27:                                               ; preds = %24
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !12
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  call void @DebugAssert(ptr noundef @.str, i64 noundef 561, ptr noundef @.str.15)
  br label %33

33:                                               ; preds = %32, %27
  br label %34

34:                                               ; preds = %33, %24
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = call zeroext i8 @DebugAssertEnabled()
  %39 = icmp ne i8 %38, 0
  br i1 %39, label %40, label %52

40:                                               ; preds = %37
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %41, i32 0, i32 10
  %43 = load ptr, ptr %42, align 8, !tbaa !13
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %50

45:                                               ; preds = %40
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %46, i32 0, i32 11
  %48 = load i32, ptr %47, align 8, !tbaa !14
  %49 = icmp ule i32 %48, 20
  br i1 %49, label %51, label %50

50:                                               ; preds = %45, %40
  call void @DebugAssert(ptr noundef @.str, i64 noundef 562, ptr noundef @.str.16)
  br label %51

51:                                               ; preds = %50, %45
  br label %52

52:                                               ; preds = %51, %37
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %55, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !15
  store ptr %57, ptr %5, align 8, !tbaa !5
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %89

60:                                               ; preds = %54
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._SOCKET, ptr %61, i32 0, i32 16
  %63 = load i32, ptr %62, align 8, !tbaa !16
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._SOCKET, ptr %64, i32 0, i32 15
  %66 = load i32, ptr %65, align 4, !tbaa !23
  %67 = icmp eq i32 %63, %66
  br i1 %67, label %68, label %89

68:                                               ; preds = %60
  br label %69

69:                                               ; preds = %68
  %70 = call zeroext i8 @DebugPrintEnabled()
  %71 = icmp ne i8 %70, 0
  br i1 %71, label %72, label %86

72:                                               ; preds = %69
  br label %73

73:                                               ; preds = %72
  %74 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %75 = icmp ne i8 %74, 0
  br i1 %75, label %76, label %83

76:                                               ; preds = %73
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._SOCKET, ptr %77, i32 0, i32 16
  %79 = load i32, ptr %78, align 8, !tbaa !16
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._SOCKET, ptr %80, i32 0, i32 15
  %82 = load i32, ptr %81, align 4, !tbaa !23
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.17, i32 noundef %79, i32 noundef %82)
  br label %83

83:                                               ; preds = %76, %73
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85, %69
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  store ptr null, ptr %2, align 8
  store i32 1, ptr %7, align 4
  br label %404

89:                                               ; preds = %60, %54
  %90 = call ptr @AllocateZeroPool(i64 noundef 392)
  store ptr %90, ptr %4, align 8, !tbaa !5
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = icmp eq ptr null, %91
  br i1 %92, label %93, label %108

93:                                               ; preds = %89
  br label %94

94:                                               ; preds = %93
  %95 = call zeroext i8 @DebugPrintEnabled()
  %96 = icmp ne i8 %95, 0
  br i1 %96, label %97, label %105

97:                                               ; preds = %94
  br label %98

98:                                               ; preds = %97
  %99 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %100 = icmp ne i8 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %98
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.18)
  br label %102

102:                                              ; preds = %101, %98
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104, %94
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  store ptr null, ptr %2, align 8
  store i32 1, ptr %7, align 4
  br label %404

108:                                              ; preds = %89
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct._SOCKET, ptr %109, i32 0, i32 5
  %111 = call ptr @InitializeListHead(ptr noundef %110)
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._SOCKET, ptr %112, i32 0, i32 18
  %114 = call ptr @InitializeListHead(ptr noundef %113)
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._SOCKET, ptr %115, i32 0, i32 19
  %117 = call ptr @InitializeListHead(ptr noundef %116)
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._SOCKET, ptr %118, i32 0, i32 20
  %120 = call ptr @InitializeListHead(ptr noundef %119)
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._SOCKET, ptr %121, i32 0, i32 21
  %123 = call ptr @InitializeListHead(ptr noundef %122)
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._SOCKET, ptr %124, i32 0, i32 22
  %126 = call ptr @InitializeListHead(ptr noundef %125)
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._SOCKET, ptr %127, i32 0, i32 10
  %129 = call ptr @EfiInitializeLock(ptr noundef %128, i64 noundef 8)
  %130 = call ptr @NetbufQueAlloc()
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._SOCKET, ptr %131, i32 0, i32 11
  %133 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %132, i32 0, i32 2
  store ptr %130, ptr %133, align 8, !tbaa !24
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._SOCKET, ptr %134, i32 0, i32 11
  %136 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %135, i32 0, i32 2
  %137 = load ptr, ptr %136, align 8, !tbaa !24
  %138 = icmp eq ptr null, %137
  br i1 %138, label %139, label %154

139:                                              ; preds = %108
  br label %140

140:                                              ; preds = %139
  %141 = call zeroext i8 @DebugPrintEnabled()
  %142 = icmp ne i8 %141, 0
  br i1 %142, label %143, label %151

143:                                              ; preds = %140
  br label %144

144:                                              ; preds = %143
  %145 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %146 = icmp ne i8 %145, 0
  br i1 %146, label %147, label %148

147:                                              ; preds = %144
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.19)
  br label %148

148:                                              ; preds = %147, %144
  br label %149

149:                                              ; preds = %148
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150, %140
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152
  br label %365

154:                                              ; preds = %108
  %155 = call ptr @NetbufQueAlloc()
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct._SOCKET, ptr %156, i32 0, i32 12
  %158 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %157, i32 0, i32 2
  store ptr %155, ptr %158, align 8, !tbaa !25
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct._SOCKET, ptr %159, i32 0, i32 12
  %161 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %160, i32 0, i32 2
  %162 = load ptr, ptr %161, align 8, !tbaa !25
  %163 = icmp eq ptr null, %162
  br i1 %163, label %164, label %179

164:                                              ; preds = %154
  br label %165

165:                                              ; preds = %164
  %166 = call zeroext i8 @DebugPrintEnabled()
  %167 = icmp ne i8 %166, 0
  br i1 %167, label %168, label %176

168:                                              ; preds = %165
  br label %169

169:                                              ; preds = %168
  %170 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %171 = icmp ne i8 %170, 0
  br i1 %171, label %172, label %173

172:                                              ; preds = %169
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.20)
  br label %173

173:                                              ; preds = %172, %169
  br label %174

174:                                              ; preds = %173
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175, %165
  br label %177

177:                                              ; preds = %176
  br label %178

178:                                              ; preds = %177
  br label %365

179:                                              ; preds = %154
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct._SOCKET, ptr %180, i32 0, i32 0
  store i32 1262702419, ptr %181, align 8, !tbaa !26
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct._SOCKET, ptr %183, i32 0, i32 17
  store ptr %182, ptr %184, align 8, !tbaa !27
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %185, i32 0, i32 3
  %187 = load i32, ptr %186, align 8, !tbaa !28
  %188 = load ptr, ptr %4, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct._SOCKET, ptr %188, i32 0, i32 15
  store i32 %187, ptr %189, align 4, !tbaa !23
  %190 = load ptr, ptr %3, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %190, i32 0, i32 12
  %192 = load ptr, ptr %191, align 8, !tbaa !9
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct._SOCKET, ptr %193, i32 0, i32 25
  store ptr %192, ptr %194, align 8, !tbaa !29
  %195 = load ptr, ptr %3, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %195, i32 0, i32 4
  %197 = load i32, ptr %196, align 4, !tbaa !30
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct._SOCKET, ptr %198, i32 0, i32 11
  %200 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %199, i32 0, i32 0
  store i32 %197, ptr %200, align 8, !tbaa !31
  %201 = load ptr, ptr %3, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %201, i32 0, i32 5
  %203 = load i32, ptr %202, align 8, !tbaa !32
  %204 = load ptr, ptr %4, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct._SOCKET, ptr %204, i32 0, i32 12
  %206 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %205, i32 0, i32 0
  store i32 %203, ptr %206, align 8, !tbaa !33
  %207 = load ptr, ptr %3, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %207, i32 0, i32 0
  %209 = load i32, ptr %208, align 8, !tbaa !12
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct._SOCKET, ptr %210, i32 0, i32 7
  store i32 %209, ptr %211, align 4, !tbaa !34
  %212 = load ptr, ptr %3, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %212, i32 0, i32 13
  %214 = load ptr, ptr %213, align 8, !tbaa !35
  %215 = load ptr, ptr %4, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct._SOCKET, ptr %215, i32 0, i32 2
  store ptr %214, ptr %216, align 8, !tbaa !36
  %217 = load ptr, ptr %3, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %217, i32 0, i32 1
  %219 = load i8, ptr %218, align 4, !tbaa !37
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct._SOCKET, ptr %220, i32 0, i32 8
  store i8 %219, ptr %221, align 8, !tbaa !38
  %222 = load ptr, ptr %3, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %222, i32 0, i32 7
  %224 = load ptr, ptr %223, align 8, !tbaa !39
  %225 = load ptr, ptr %4, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct._SOCKET, ptr %225, i32 0, i32 28
  store ptr %224, ptr %226, align 8, !tbaa !40
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %227, i32 0, i32 8
  %229 = load ptr, ptr %228, align 8, !tbaa !41
  %230 = load ptr, ptr %4, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct._SOCKET, ptr %230, i32 0, i32 29
  store ptr %229, ptr %231, align 8, !tbaa !42
  %232 = load ptr, ptr %3, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %232, i32 0, i32 9
  %234 = load ptr, ptr %233, align 8, !tbaa !43
  %235 = load ptr, ptr %4, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct._SOCKET, ptr %235, i32 0, i32 30
  store ptr %234, ptr %236, align 8, !tbaa !44
  %237 = load ptr, ptr %4, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct._SOCKET, ptr %237, i32 0, i32 13
  store i64 -9223372036854775787, ptr %238, align 8, !tbaa !45
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct._SOCKET, ptr %239, i32 0, i32 11
  %241 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %240, i32 0, i32 1
  store i32 2048, ptr %241, align 4, !tbaa !46
  %242 = load ptr, ptr %4, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct._SOCKET, ptr %242, i32 0, i32 12
  %244 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %243, i32 0, i32 1
  store i32 2048, ptr %244, align 4, !tbaa !47
  %245 = load ptr, ptr %4, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct._SOCKET, ptr %245, i32 0, i32 27
  %247 = load ptr, ptr %3, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %247, i32 0, i32 6
  %249 = load ptr, ptr %248, align 8, !tbaa !48
  %250 = call ptr @CopyMem(ptr noundef %246, ptr noundef %249, i64 noundef 80)
  %251 = load ptr, ptr %4, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct._SOCKET, ptr %251, i32 0, i32 26
  %253 = getelementptr inbounds [20 x i8], ptr %252, i64 0, i64 0
  %254 = load ptr, ptr %3, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %254, i32 0, i32 10
  %256 = load ptr, ptr %255, align 8, !tbaa !13
  %257 = load ptr, ptr %3, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct._SOCK_INIT_DATA, ptr %257, i32 0, i32 11
  %259 = load i32, ptr %258, align 8, !tbaa !14
  %260 = zext i32 %259 to i64
  %261 = call ptr @CopyMem(ptr noundef %253, ptr noundef %256, i64 noundef %260)
  %262 = load ptr, ptr @gBS, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %262, i32 0, i32 39
  %264 = load ptr, ptr %263, align 8, !tbaa !49
  %265 = load ptr, ptr %4, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct._SOCKET, ptr %265, i32 0, i32 1
  %267 = load ptr, ptr %4, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct._SOCKET, ptr %267, i32 0, i32 27
  %269 = call i64 (ptr, ...) %264(ptr noundef %266, ptr noundef @gEfiTcp4ProtocolGuid, ptr noundef %268, ptr noundef null)
  store i64 %269, ptr %6, align 8, !tbaa !52
  %270 = load i64, ptr %6, align 8, !tbaa !52
  %271 = icmp slt i64 %270, 0
  br i1 %271, label %272, label %288

272:                                              ; preds = %179
  br label %273

273:                                              ; preds = %272
  %274 = call zeroext i8 @DebugPrintEnabled()
  %275 = icmp ne i8 %274, 0
  br i1 %275, label %276, label %285

276:                                              ; preds = %273
  br label %277

277:                                              ; preds = %276
  %278 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %279 = icmp ne i8 %278, 0
  br i1 %279, label %280, label %282

280:                                              ; preds = %277
  %281 = load i64, ptr %6, align 8, !tbaa !52
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.21, i64 noundef %281)
  br label %282

282:                                              ; preds = %280, %277
  br label %283

283:                                              ; preds = %282
  br label %284

284:                                              ; preds = %283
  br label %285

285:                                              ; preds = %284, %273
  br label %286

286:                                              ; preds = %285
  br label %287

287:                                              ; preds = %286
  br label %365

288:                                              ; preds = %179
  %289 = load ptr, ptr %5, align 8, !tbaa !5
  %290 = icmp ne ptr %289, null
  br i1 %290, label %291, label %345

291:                                              ; preds = %288
  br label %292

292:                                              ; preds = %291
  %293 = call zeroext i8 @DebugAssertEnabled()
  %294 = icmp ne i8 %293, 0
  br i1 %294, label %295, label %302

295:                                              ; preds = %292
  %296 = load ptr, ptr %5, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct._SOCKET, ptr %296, i32 0, i32 15
  %298 = load i32, ptr %297, align 4, !tbaa !23
  %299 = icmp ugt i32 %298, 0
  br i1 %299, label %301, label %300

300:                                              ; preds = %295
  call void @DebugAssert(ptr noundef @.str, i64 noundef 657, ptr noundef @.str.22)
  br label %301

301:                                              ; preds = %300, %295
  br label %302

302:                                              ; preds = %301, %292
  br label %303

303:                                              ; preds = %302
  br label %304

304:                                              ; preds = %303
  br label %305

305:                                              ; preds = %304
  %306 = call zeroext i8 @DebugAssertEnabled()
  %307 = icmp ne i8 %306, 0
  br i1 %307, label %308, label %316

308:                                              ; preds = %305
  %309 = load ptr, ptr %5, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct._SOCKET, ptr %309, i32 0, i32 8
  %311 = load i8, ptr %310, align 8, !tbaa !38
  %312 = zext i8 %311 to i32
  %313 = icmp eq i32 %312, 1
  br i1 %313, label %315, label %314

314:                                              ; preds = %308
  call void @DebugAssert(ptr noundef @.str, i64 noundef 658, ptr noundef @.str.23)
  br label %315

315:                                              ; preds = %314, %308
  br label %316

316:                                              ; preds = %315, %305
  br label %317

317:                                              ; preds = %316
  br label %318

318:                                              ; preds = %317
  %319 = load ptr, ptr %5, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct._SOCKET, ptr %319, i32 0, i32 16
  %321 = load i32, ptr %320, align 8, !tbaa !16
  %322 = add i32 %321, 1
  store i32 %322, ptr %320, align 8, !tbaa !16
  br label %323

323:                                              ; preds = %318
  %324 = call zeroext i8 @DebugPrintEnabled()
  %325 = icmp ne i8 %324, 0
  br i1 %325, label %326, label %337

326:                                              ; preds = %323
  br label %327

327:                                              ; preds = %326
  %328 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64)
  %329 = icmp ne i8 %328, 0
  br i1 %329, label %330, label %334

330:                                              ; preds = %327
  %331 = load ptr, ptr %5, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct._SOCKET, ptr %331, i32 0, i32 16
  %333 = load i32, ptr %332, align 8, !tbaa !16
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef @.str.24, i32 noundef %333)
  br label %334

334:                                              ; preds = %330, %327
  br label %335

335:                                              ; preds = %334
  br label %336

336:                                              ; preds = %335
  br label %337

337:                                              ; preds = %336, %323
  br label %338

338:                                              ; preds = %337
  br label %339

339:                                              ; preds = %338
  %340 = load ptr, ptr %5, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct._SOCKET, ptr %340, i32 0, i32 18
  %342 = load ptr, ptr %4, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct._SOCKET, ptr %342, i32 0, i32 18
  %344 = call ptr @InsertTailList(ptr noundef %341, ptr noundef %343)
  br label %345

345:                                              ; preds = %339, %288
  %346 = load ptr, ptr %4, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct._SOCKET, ptr %346, i32 0, i32 28
  %348 = load ptr, ptr %347, align 8, !tbaa !40
  %349 = icmp ne ptr %348, null
  br i1 %349, label %350, label %363

350:                                              ; preds = %345
  %351 = load ptr, ptr %4, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct._SOCKET, ptr %351, i32 0, i32 28
  %353 = load ptr, ptr %352, align 8, !tbaa !40
  %354 = load ptr, ptr %4, align 8, !tbaa !5
  %355 = load ptr, ptr %4, align 8, !tbaa !5
  %356 = getelementptr inbounds %struct._SOCKET, ptr %355, i32 0, i32 30
  %357 = load ptr, ptr %356, align 8, !tbaa !44
  %358 = call i64 %353(ptr noundef %354, ptr noundef %357)
  store i64 %358, ptr %6, align 8, !tbaa !52
  %359 = load i64, ptr %6, align 8, !tbaa !52
  %360 = icmp slt i64 %359, 0
  br i1 %360, label %361, label %362

361:                                              ; preds = %350
  br label %365

362:                                              ; preds = %350
  br label %363

363:                                              ; preds = %362, %345
  %364 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %364, ptr %2, align 8
  store i32 1, ptr %7, align 4
  br label %404

365:                                              ; preds = %361, %287, %178, %153
  %366 = load ptr, ptr %4, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct._SOCKET, ptr %366, i32 0, i32 1
  %368 = load ptr, ptr %367, align 8, !tbaa !53
  %369 = icmp ne ptr %368, null
  br i1 %369, label %370, label %380

370:                                              ; preds = %365
  %371 = load ptr, ptr @gBS, align 8, !tbaa !5
  %372 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %371, i32 0, i32 40
  %373 = load ptr, ptr %372, align 8, !tbaa !54
  %374 = load ptr, ptr %4, align 8, !tbaa !5
  %375 = getelementptr inbounds %struct._SOCKET, ptr %374, i32 0, i32 1
  %376 = load ptr, ptr %375, align 8, !tbaa !53
  %377 = load ptr, ptr %4, align 8, !tbaa !5
  %378 = getelementptr inbounds %struct._SOCKET, ptr %377, i32 0, i32 27
  %379 = call i64 (ptr, ...) %373(ptr noundef %376, ptr noundef @gEfiTcp4ProtocolGuid, ptr noundef %378, ptr noundef null)
  br label %380

380:                                              ; preds = %370, %365
  %381 = load ptr, ptr %4, align 8, !tbaa !5
  %382 = getelementptr inbounds %struct._SOCKET, ptr %381, i32 0, i32 11
  %383 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %382, i32 0, i32 2
  %384 = load ptr, ptr %383, align 8, !tbaa !24
  %385 = icmp ne ptr null, %384
  br i1 %385, label %386, label %391

386:                                              ; preds = %380
  %387 = load ptr, ptr %4, align 8, !tbaa !5
  %388 = getelementptr inbounds %struct._SOCKET, ptr %387, i32 0, i32 11
  %389 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %388, i32 0, i32 2
  %390 = load ptr, ptr %389, align 8, !tbaa !24
  call void @NetbufQueFree(ptr noundef %390)
  br label %391

391:                                              ; preds = %386, %380
  %392 = load ptr, ptr %4, align 8, !tbaa !5
  %393 = getelementptr inbounds %struct._SOCKET, ptr %392, i32 0, i32 12
  %394 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %393, i32 0, i32 2
  %395 = load ptr, ptr %394, align 8, !tbaa !25
  %396 = icmp ne ptr null, %395
  br i1 %396, label %397, label %402

397:                                              ; preds = %391
  %398 = load ptr, ptr %4, align 8, !tbaa !5
  %399 = getelementptr inbounds %struct._SOCKET, ptr %398, i32 0, i32 12
  %400 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %399, i32 0, i32 2
  %401 = load ptr, ptr %400, align 8, !tbaa !25
  call void @NetbufQueFree(ptr noundef %401)
  br label %402

402:                                              ; preds = %397, %391
  %403 = load ptr, ptr %4, align 8, !tbaa !5
  call void @FreePool(ptr noundef %403)
  store ptr null, ptr %2, align 8
  store i32 1, ptr %7, align 4
  br label %404

404:                                              ; preds = %402, %363, %107, %88
  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
  %405 = load ptr, ptr %2, align 8
  ret ptr %405
}

declare ptr @AllocateZeroPool(i64 noundef) #1

declare ptr @InitializeListHead(ptr noundef) #1

declare ptr @EfiInitializeLock(ptr noundef, i64 noundef) #1

declare ptr @NetbufQueAlloc() #1

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

declare void @NetbufQueFree(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 80}
!10 = !{!"_SOCK_INIT_DATA", !11, i64 0, !7, i64 4, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !6, i64 80, !6, i64 88}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 0}
!13 = !{!10, !6, i64 64}
!14 = !{!10, !11, i64 72}
!15 = !{!10, !6, i64 8}
!16 = !{!17, !11, i64 144}
!17 = !{!"_SOCKET", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !18, i64 40, !7, i64 56, !11, i64 60, !7, i64 64, !19, i64 66, !20, i64 72, !22, i64 96, !22, i64 112, !21, i64 128, !7, i64 136, !11, i64 140, !11, i64 144, !6, i64 152, !18, i64 160, !18, i64 176, !18, i64 192, !18, i64 208, !18, 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}
!18 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!19 = !{!"short", !7, i64 0}
!20 = !{!"", !21, i64 0, !21, i64 8, !11, i64 16}
!21 = !{!"long long", !7, i64 0}
!22 = !{!"_SOCK_BUFFER", !11, i64 0, !11, i64 4, !6, i64 8}
!23 = !{!17, !11, i64 140}
!24 = !{!17, !6, i64 104}
!25 = !{!17, !6, i64 120}
!26 = !{!17, !11, i64 0}
!27 = !{!17, !6, i64 152}
!28 = !{!10, !11, i64 16}
!29 = !{!17, !6, i64 256}
!30 = !{!10, !11, i64 20}
!31 = !{!17, !11, i64 96}
!32 = !{!10, !11, i64 24}
!33 = !{!17, !11, i64 112}
!34 = !{!17, !11, i64 60}
!35 = !{!10, !6, i64 88}
!36 = !{!17, !6, i64 16}
!37 = !{!10, !7, i64 4}
!38 = !{!17, !7, i64 64}
!39 = !{!10, !6, i64 40}
!40 = !{!17, !6, i64 368}
!41 = !{!10, !6, i64 48}
!42 = !{!17, !6, i64 376}
!43 = !{!10, !6, i64 56}
!44 = !{!17, !6, i64 384}
!45 = !{!17, !21, i64 128}
!46 = !{!17, !11, i64 100}
!47 = !{!17, !11, i64 116}
!48 = !{!10, !6, i64 32}
!49 = !{!50, !6, i64 328}
!50 = !{!"", !51, 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}
!51 = !{!"", !21, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!52 = !{!21, !21, i64 0}
!53 = !{!17, !6, i64 8}
!54 = !{!50, !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
@gBS = external local_unnamed_addr global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [62 x i8], align 1
@gEfiTcp4ProtocolGuid = external global %struct.GUID, align 4
@.str.21 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [70 x i8], align 1

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #0

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

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

declare void @FreePool(ptr noundef) local_unnamed_addr #0

declare ptr @InsertTailList(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @SockCreate(ptr noundef readonly %0) local_unnamed_addr #1 {
  %2 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %2, 0
  br i1 %.not, label %8, label %3

3:                                                ; preds = %1
  %.not87 = icmp eq ptr %0, null
  br i1 %.not87, label %7, label %4

4:                                                ; preds = %3
  %5 = getelementptr inbounds i8, ptr %0, i64 80
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %.not88 = icmp eq ptr %6, null
  br i1 %.not88, label %7, label %8

7:                                                ; preds = %4, %3
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 560, ptr noundef nonnull @.str.14) #2
  br label %8

8:                                                ; preds = %1, %7, %4
  %9 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not89 = icmp eq i8 %9, 0
  br i1 %.not89, label %14, label %10

10:                                               ; preds = %8
  %11 = load i32, ptr %0, align 8, !tbaa !11
  %12 = icmp eq i32 %11, 1
  br i1 %12, label %14, label %13

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

14:                                               ; preds = %8, %13, %10
  %15 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not90 = icmp eq i8 %15, 0
  br i1 %.not90, label %24, label %16

16:                                               ; preds = %14
  %17 = getelementptr inbounds i8, ptr %0, i64 64
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  %.not91 = icmp eq ptr %18, null
  br i1 %.not91, label %23, label %19

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %0, i64 72
  %21 = load i32, ptr %20, align 8, !tbaa !13
  %22 = icmp ult i32 %21, 21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19, %16
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 562, ptr noundef nonnull @.str.16) #2
  br label %24

24:                                               ; preds = %19, %23, %14
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  %26 = load ptr, ptr %25, align 8, !tbaa !14
  %.not92 = icmp eq ptr %26, null
  br i1 %.not92, label %40, label %27

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %26, i64 144
  %29 = load i32, ptr %28, align 8, !tbaa !15
  %30 = getelementptr inbounds i8, ptr %26, i64 140
  %31 = load i32, ptr %30, align 4, !tbaa !22
  %32 = icmp eq i32 %29, %31
  br i1 %32, label %33, label %40

33:                                               ; preds = %27
  %34 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not110 = icmp eq i8 %34, 0
  br i1 %.not110, label %182, label %35

35:                                               ; preds = %33
  %36 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #2
  %.not111 = icmp eq i8 %36, 0
  br i1 %.not111, label %182, label %37

37:                                               ; preds = %35
  %38 = load i32, ptr %28, align 8, !tbaa !15
  %39 = load i32, ptr %30, align 4, !tbaa !22
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.17, i32 noundef %38, i32 noundef %39) #2
  br label %182

40:                                               ; preds = %27, %24
  %41 = tail call ptr @AllocateZeroPool(i64 noundef 392) #2
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %48

43:                                               ; preds = %40
  %44 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not108 = icmp eq i8 %44, 0
  br i1 %.not108, label %182, label %45

45:                                               ; preds = %43
  %46 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #2
  %.not109 = icmp eq i8 %46, 0
  br i1 %.not109, label %182, label %47

47:                                               ; preds = %45
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.18) #2
  br label %182

48:                                               ; preds = %40
  %49 = getelementptr inbounds i8, ptr %41, i64 40
  %50 = tail call ptr @InitializeListHead(ptr noundef nonnull %49) #2
  %51 = getelementptr inbounds i8, ptr %41, i64 160
  %52 = tail call ptr @InitializeListHead(ptr noundef nonnull %51) #2
  %53 = getelementptr inbounds i8, ptr %41, i64 176
  %54 = tail call ptr @InitializeListHead(ptr noundef nonnull %53) #2
  %55 = getelementptr inbounds i8, ptr %41, i64 192
  %56 = tail call ptr @InitializeListHead(ptr noundef nonnull %55) #2
  %57 = getelementptr inbounds i8, ptr %41, i64 208
  %58 = tail call ptr @InitializeListHead(ptr noundef nonnull %57) #2
  %59 = getelementptr inbounds i8, ptr %41, i64 224
  %60 = tail call ptr @InitializeListHead(ptr noundef nonnull %59) #2
  %61 = getelementptr inbounds i8, ptr %41, i64 72
  %62 = tail call ptr @EfiInitializeLock(ptr noundef nonnull %61, i64 noundef 8) #2
  %63 = tail call ptr @NetbufQueAlloc() #2
  %64 = getelementptr inbounds i8, ptr %41, i64 96
  %65 = getelementptr inbounds i8, ptr %41, i64 104
  store ptr %63, ptr %65, align 8, !tbaa !23
  %66 = icmp eq ptr %63, null
  br i1 %66, label %67, label %72

67:                                               ; preds = %48
  %68 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not103 = icmp eq i8 %68, 0
  br i1 %.not103, label %165, label %69

69:                                               ; preds = %67
  %70 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #2
  %.not104 = icmp eq i8 %70, 0
  br i1 %.not104, label %165, label %71

71:                                               ; preds = %69
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.19) #2
  br label %165

72:                                               ; preds = %48
  %73 = tail call ptr @NetbufQueAlloc() #2
  %74 = getelementptr inbounds i8, ptr %41, i64 120
  store ptr %73, ptr %74, align 8, !tbaa !24
  %75 = icmp eq ptr %73, null
  br i1 %75, label %76, label %81

76:                                               ; preds = %72
  %77 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not101 = icmp eq i8 %77, 0
  br i1 %.not101, label %165, label %78

78:                                               ; preds = %76
  %79 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #2
  %.not102 = icmp eq i8 %79, 0
  br i1 %.not102, label %165, label %80

80:                                               ; preds = %78
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.20) #2
  br label %165

81:                                               ; preds = %72
  %82 = getelementptr inbounds i8, ptr %41, i64 112
  store i32 1262702419, ptr %41, align 8, !tbaa !25
  %83 = getelementptr inbounds i8, ptr %41, i64 152
  store ptr %26, ptr %83, align 8, !tbaa !26
  %84 = getelementptr inbounds i8, ptr %0, i64 16
  %85 = load i32, ptr %84, align 8, !tbaa !27
  %86 = getelementptr inbounds i8, ptr %41, i64 140
  store i32 %85, ptr %86, align 4, !tbaa !22
  %87 = getelementptr inbounds i8, ptr %0, i64 80
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %41, i64 256
  store ptr %88, ptr %89, align 8, !tbaa !28
  %90 = getelementptr inbounds i8, ptr %0, i64 20
  %91 = load i32, ptr %90, align 4, !tbaa !29
  store i32 %91, ptr %64, align 8, !tbaa !30
  %92 = getelementptr inbounds i8, ptr %0, i64 24
  %93 = load i32, ptr %92, align 8, !tbaa !31
  store i32 %93, ptr %82, align 8, !tbaa !32
  %94 = load i32, ptr %0, align 8, !tbaa !11
  %95 = getelementptr inbounds i8, ptr %41, i64 60
  store i32 %94, ptr %95, align 4, !tbaa !33
  %96 = getelementptr inbounds i8, ptr %0, i64 88
  %97 = load ptr, ptr %96, align 8, !tbaa !34
  %98 = getelementptr inbounds i8, ptr %41, i64 16
  store ptr %97, ptr %98, align 8, !tbaa !35
  %99 = getelementptr inbounds i8, ptr %0, i64 4
  %100 = load i8, ptr %99, align 4, !tbaa !36
  %101 = getelementptr inbounds i8, ptr %41, i64 64
  store i8 %100, ptr %101, align 8, !tbaa !37
  %102 = getelementptr inbounds i8, ptr %0, i64 40
  %103 = getelementptr inbounds i8, ptr %41, i64 368
  %104 = load <2 x ptr>, ptr %102, align 8, !tbaa !38
  store <2 x ptr> %104, ptr %103, align 8, !tbaa !38
  %105 = getelementptr inbounds i8, ptr %0, i64 56
  %106 = load ptr, ptr %105, align 8, !tbaa !39
  %107 = getelementptr inbounds i8, ptr %41, i64 384
  store ptr %106, ptr %107, align 8, !tbaa !40
  %108 = getelementptr inbounds i8, ptr %41, i64 128
  store i64 -9223372036854775787, ptr %108, align 8, !tbaa !41
  %109 = getelementptr inbounds i8, ptr %41, i64 100
  store i32 2048, ptr %109, align 4, !tbaa !42
  %110 = getelementptr inbounds i8, ptr %41, i64 116
  store i32 2048, ptr %110, align 4, !tbaa !43
  %111 = getelementptr inbounds i8, ptr %41, i64 288
  %112 = getelementptr inbounds i8, ptr %0, i64 32
  %113 = load ptr, ptr %112, align 8, !tbaa !44
  %114 = tail call ptr @CopyMem(ptr noundef nonnull %111, ptr noundef %113, i64 noundef 80) #2
  %115 = getelementptr inbounds i8, ptr %41, i64 264
  %116 = getelementptr inbounds i8, ptr %0, i64 64
  %117 = load ptr, ptr %116, align 8, !tbaa !12
  %118 = getelementptr inbounds i8, ptr %0, i64 72
  %119 = load i32, ptr %118, align 8, !tbaa !13
  %120 = zext i32 %119 to i64
  %121 = tail call ptr @CopyMem(ptr noundef nonnull %115, ptr noundef %117, i64 noundef %120) #2
  %122 = load ptr, ptr @gBS, align 8, !tbaa !38
  %123 = getelementptr inbounds i8, ptr %122, i64 328
  %124 = load ptr, ptr %123, align 8, !tbaa !45
  %125 = getelementptr inbounds i8, ptr %41, i64 8
  %126 = tail call i64 (ptr, ...) %124(ptr noundef nonnull %125, ptr noundef nonnull @gEfiTcp4ProtocolGuid, ptr noundef nonnull %111, ptr noundef null) #2
  %127 = icmp slt i64 %126, 0
  br i1 %127, label %128, label %133

128:                                              ; preds = %81
  %129 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not99 = icmp eq i8 %129, 0
  br i1 %.not99, label %165, label %130

130:                                              ; preds = %128
  %131 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #2
  %.not100 = icmp eq i8 %131, 0
  br i1 %.not100, label %165, label %132

132:                                              ; preds = %130
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.21, i64 noundef %126) #2
  br label %165

133:                                              ; preds = %81
  br i1 %.not92, label %159, label %134

134:                                              ; preds = %133
  %135 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not93 = icmp eq i8 %135, 0
  br i1 %.not93, label %140, label %136

136:                                              ; preds = %134
  %137 = getelementptr inbounds i8, ptr %26, i64 140
  %138 = load i32, ptr %137, align 4, !tbaa !22
  %.not94 = icmp eq i32 %138, 0
  br i1 %.not94, label %139, label %140

139:                                              ; preds = %136
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 657, ptr noundef nonnull @.str.22) #2
  br label %140

140:                                              ; preds = %134, %139, %136
  %141 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not95 = icmp eq i8 %141, 0
  br i1 %.not95, label %147, label %142

142:                                              ; preds = %140
  %143 = getelementptr inbounds i8, ptr %26, i64 64
  %144 = load i8, ptr %143, align 8, !tbaa !37
  %145 = icmp eq i8 %144, 1
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 658, ptr noundef nonnull @.str.23) #2
  br label %147

147:                                              ; preds = %142, %146, %140
  %148 = getelementptr inbounds i8, ptr %26, i64 144
  %149 = load i32, ptr %148, align 8, !tbaa !15
  %150 = add i32 %149, 1
  store i32 %150, ptr %148, align 8, !tbaa !15
  %151 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not96 = icmp eq i8 %151, 0
  br i1 %.not96, label %156, label %152

152:                                              ; preds = %147
  %153 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64) #2
  %.not97 = icmp eq i8 %153, 0
  br i1 %.not97, label %156, label %154

154:                                              ; preds = %152
  %155 = load i32, ptr %148, align 8, !tbaa !15
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef nonnull @.str.24, i32 noundef %155) #2
  br label %156

156:                                              ; preds = %152, %154, %147
  %157 = getelementptr inbounds i8, ptr %26, i64 160
  %158 = tail call ptr @InsertTailList(ptr noundef nonnull %157, ptr noundef nonnull %51) #2
  br label %159

159:                                              ; preds = %156, %133
  %160 = load ptr, ptr %103, align 8, !tbaa !48
  %.not98 = icmp eq ptr %160, null
  br i1 %.not98, label %182, label %161

161:                                              ; preds = %159
  %162 = load ptr, ptr %107, align 8, !tbaa !40
  %163 = tail call i64 %160(ptr noundef nonnull %41, ptr noundef %162) #2
  %164 = icmp slt i64 %163, 0
  br i1 %164, label %165, label %182

165:                                              ; preds = %161, %128, %132, %130, %76, %80, %78, %67, %71, %69
  %166 = getelementptr inbounds i8, ptr %41, i64 8
  %167 = load ptr, ptr %166, align 8, !tbaa !49
  %.not105 = icmp eq ptr %167, null
  br i1 %.not105, label %174, label %168

168:                                              ; preds = %165
  %169 = load ptr, ptr @gBS, align 8, !tbaa !38
  %170 = getelementptr inbounds i8, ptr %169, i64 336
  %171 = load ptr, ptr %170, align 8, !tbaa !50
  %172 = getelementptr inbounds i8, ptr %41, i64 288
  %173 = tail call i64 (ptr, ...) %171(ptr noundef nonnull %167, ptr noundef nonnull @gEfiTcp4ProtocolGuid, ptr noundef nonnull %172, ptr noundef null) #2
  br label %174

174:                                              ; preds = %168, %165
  %175 = load ptr, ptr %65, align 8, !tbaa !23
  %.not106 = icmp eq ptr %175, null
  br i1 %.not106, label %177, label %176

176:                                              ; preds = %174
  tail call void @NetbufQueFree(ptr noundef nonnull %175) #2
  br label %177

177:                                              ; preds = %176, %174
  %178 = getelementptr inbounds i8, ptr %41, i64 120
  %179 = load ptr, ptr %178, align 8, !tbaa !24
  %.not107 = icmp eq ptr %179, null
  br i1 %.not107, label %181, label %180

180:                                              ; preds = %177
  tail call void @NetbufQueFree(ptr noundef nonnull %179) #2
  br label %181

181:                                              ; preds = %180, %177
  tail call void @FreePool(ptr noundef nonnull %41) #2
  br label %182

182:                                              ; preds = %159, %161, %43, %47, %45, %33, %37, %35, %181
  %.0 = phi ptr [ null, %181 ], [ null, %35 ], [ null, %37 ], [ null, %33 ], [ null, %45 ], [ null, %47 ], [ null, %43 ], [ %41, %161 ], [ %41, %159 ]
  ret ptr %.0
}

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #0

declare ptr @InitializeListHead(ptr noundef) local_unnamed_addr #0

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

declare ptr @NetbufQueAlloc() local_unnamed_addr #0

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

declare void @NetbufQueFree(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, !10, i64 80}
!6 = !{!"_SOCK_INIT_DATA", !7, i64 0, !8, i64 4, !10, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !10, i64 80, !10, i64 88}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !10, i64 64}
!13 = !{!6, !7, i64 72}
!14 = !{!6, !10, i64 8}
!15 = !{!16, !7, i64 144}
!16 = !{!"_SOCKET", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !17, i64 40, !8, i64 56, !7, i64 60, !8, i64 64, !18, i64 66, !19, i64 72, !21, i64 96, !21, i64 112, !20, i64 128, !8, i64 136, !7, i64 140, !7, i64 144, !10, i64 152, !17, i64 160, !17, i64 176, !17, i64 192, !17, i64 208, !17, 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}
!17 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!18 = !{!"short", !8, i64 0}
!19 = !{!"", !20, i64 0, !20, i64 8, !7, i64 16}
!20 = !{!"long long", !8, i64 0}
!21 = !{!"_SOCK_BUFFER", !7, i64 0, !7, i64 4, !10, i64 8}
!22 = !{!16, !7, i64 140}
!23 = !{!16, !10, i64 104}
!24 = !{!16, !10, i64 120}
!25 = !{!16, !7, i64 0}
!26 = !{!16, !10, i64 152}
!27 = !{!6, !7, i64 16}
!28 = !{!16, !10, i64 256}
!29 = !{!6, !7, i64 20}
!30 = !{!16, !7, i64 96}
!31 = !{!6, !7, i64 24}
!32 = !{!16, !7, i64 112}
!33 = !{!16, !7, i64 60}
!34 = !{!6, !10, i64 88}
!35 = !{!16, !10, i64 16}
!36 = !{!6, !8, i64 4}
!37 = !{!16, !8, i64 64}
!38 = !{!10, !10, i64 0}
!39 = !{!6, !10, i64 56}
!40 = !{!16, !10, i64 384}
!41 = !{!16, !20, i64 128}
!42 = !{!16, !7, i64 100}
!43 = !{!16, !7, i64 116}
!44 = !{!6, !10, i64 32}
!45 = !{!46, !10, i64 328}
!46 = !{!"", !47, 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}
!47 = !{!"", !20, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!48 = !{!16, !10, i64 368}
!49 = !{!16, !10, i64 8}
!50 = !{!46, !10, i64 336}


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