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

; 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.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_TCP4_CONFIG_DATA = type { i8, i8, %struct.EFI_TCP4_ACCESS_POINT, ptr }
%struct.EFI_TCP4_ACCESS_POINT = type { i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16, i8 }
%struct.EFI_TCP4_OPTION = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i8 }
%struct._TCP4_IO = type { ptr, ptr, ptr, ptr, %struct.EFI_TCP4_CONNECTION_TOKEN, %struct.EFI_TCP4_IO_TOKEN, %struct.EFI_TCP4_IO_TOKEN, %struct.EFI_TCP4_CLOSE_TOKEN, i8, i8, i8, i8 }
%struct.EFI_TCP4_CONNECTION_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN }
%struct.EFI_TCP4_COMPLETION_TOKEN = type { ptr, i64 }
%struct.EFI_TCP4_IO_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN, %union.anon }
%union.anon = type { ptr }
%struct.EFI_TCP4_CLOSE_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN, 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._TCP4_IO_CONFIG_DATA = type { %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16 }
%struct._EFI_TCP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@gEfiTcp4ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gBS = external global ptr, align 8
@gEfiTcp4ProtocolGuid = external global %struct.GUID, align 4
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

; Function Attrs: nounwind uwtable
declare dso_local void @Tcp4IoCommonNotify(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i64 @Tcp4IoCreateSocket(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.EFI_TCP4_CONFIG_DATA, align 8
  %13 = alloca %struct.EFI_TCP4_OPTION, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %16 = load ptr, ptr %9, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct._TCP4_IO, ptr %16, i32 0, i32 2
  store ptr null, ptr %17, align 8, !tbaa !9
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._TCP4_IO, ptr %18, i32 0, i32 4
  %20 = getelementptr inbounds %struct.EFI_TCP4_CONNECTION_TOKEN, ptr %19, i32 0, i32 0
  %21 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %20, i32 0, i32 0
  store ptr null, ptr %21, align 8, !tbaa !15
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._TCP4_IO, ptr %22, i32 0, i32 5
  %24 = getelementptr inbounds %struct.EFI_TCP4_IO_TOKEN, ptr %23, i32 0, i32 0
  %25 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %24, i32 0, i32 0
  store ptr null, ptr %25, align 8, !tbaa !16
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._TCP4_IO, ptr %26, i32 0, i32 6
  %28 = getelementptr inbounds %struct.EFI_TCP4_IO_TOKEN, ptr %27, i32 0, i32 0
  %29 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %28, i32 0, i32 0
  store ptr null, ptr %29, align 8, !tbaa !17
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._TCP4_IO, ptr %30, i32 0, i32 7
  %32 = getelementptr inbounds %struct.EFI_TCP4_CLOSE_TOKEN, ptr %31, i32 0, i32 0
  %33 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %32, i32 0, i32 0
  store ptr null, ptr %33, align 8, !tbaa !18
  store ptr null, ptr %11, align 8, !tbaa !5
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._TCP4_IO, ptr %36, i32 0, i32 2
  %38 = call i64 @NetLibCreateServiceChild(ptr noundef %34, ptr noundef %35, ptr noundef @gEfiTcp4ServiceBindingProtocolGuid, ptr noundef %37)
  store i64 %38, ptr %10, align 8, !tbaa !19
  %39 = load i64, ptr %10, align 8, !tbaa !19
  %40 = icmp slt i64 %39, 0
  br i1 %40, label %41, label %43

41:                                               ; preds = %4
  %42 = load i64, ptr %10, align 8, !tbaa !19
  store i64 %42, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %276

43:                                               ; preds = %4
  %44 = load ptr, ptr @gBS, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %44, i32 0, i32 33
  %46 = load ptr, ptr %45, align 8, !tbaa !20
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._TCP4_IO, ptr %47, i32 0, i32 2
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._TCP4_IO, ptr %50, i32 0, i32 3
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = call i64 %46(ptr noundef %49, ptr noundef @gEfiTcp4ProtocolGuid, ptr noundef %51, ptr noundef %52, ptr noundef %53, i32 noundef 16)
  store i64 %54, ptr %10, align 8, !tbaa !19
  %55 = load i64, ptr %10, align 8, !tbaa !19
  %56 = icmp slt i64 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %43
  br label %199

58:                                               ; preds = %43
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._TCP4_IO, ptr %60, i32 0, i32 0
  store ptr %59, ptr %61, align 8, !tbaa !24
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._TCP4_IO, ptr %63, i32 0, i32 1
  store ptr %62, ptr %64, align 8, !tbaa !25
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._TCP4_IO, ptr %65, i32 0, i32 3
  %67 = load ptr, ptr %66, align 8, !tbaa !26
  store ptr %67, ptr %11, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 0
  store i32 2097152, ptr %68, align 4, !tbaa !27
  %69 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 1
  store i32 2097152, ptr %69, align 4, !tbaa !29
  %70 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 2
  store i32 0, ptr %70, align 4, !tbaa !30
  %71 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 3
  store i32 0, ptr %71, align 4, !tbaa !31
  %72 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 4
  store i32 6, ptr %72, align 4, !tbaa !32
  %73 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 5
  store i32 0, ptr %73, align 4, !tbaa !33
  %74 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 6
  store i32 0, ptr %74, align 4, !tbaa !34
  %75 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 7
  store i32 4, ptr %75, align 4, !tbaa !35
  %76 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 8
  store i32 0, ptr %76, align 4, !tbaa !36
  %77 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 9
  store i32 0, ptr %77, align 4, !tbaa !37
  %78 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 10
  store i8 0, ptr %78, align 4, !tbaa !38
  %79 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 11
  store i8 0, ptr %79, align 1, !tbaa !39
  %80 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 12
  store i8 1, ptr %80, align 2, !tbaa !40
  %81 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 13
  store i8 0, ptr %81, align 1, !tbaa !41
  %82 = getelementptr inbounds %struct.EFI_TCP4_OPTION, ptr %13, i32 0, i32 14
  store i8 0, ptr %82, align 4, !tbaa !42
  %83 = getelementptr inbounds %struct.EFI_TCP4_CONFIG_DATA, ptr %12, i32 0, i32 0
  store i8 8, ptr %83, align 8, !tbaa !43
  %84 = getelementptr inbounds %struct.EFI_TCP4_CONFIG_DATA, ptr %12, i32 0, i32 1
  store i8 -1, ptr %84, align 1, !tbaa !48
  %85 = getelementptr inbounds %struct.EFI_TCP4_CONFIG_DATA, ptr %12, i32 0, i32 3
  store ptr %13, ptr %85, align 8, !tbaa !49
  %86 = getelementptr inbounds %struct.EFI_TCP4_CONFIG_DATA, ptr %12, i32 0, i32 2
  store ptr %86, ptr %14, align 8, !tbaa !5
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.EFI_TCP4_ACCESS_POINT, ptr %87, i32 0, i32 0
  store i8 0, ptr %88, align 2, !tbaa !50
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.EFI_TCP4_ACCESS_POINT, ptr %89, i32 0, i32 3
  store i16 0, ptr %90, align 2, !tbaa !51
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._TCP4_IO_CONFIG_DATA, ptr %91, i32 0, i32 4
  %93 = load i16, ptr %92, align 2, !tbaa !52
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.EFI_TCP4_ACCESS_POINT, ptr %94, i32 0, i32 5
  store i16 %93, ptr %95, align 2, !tbaa !54
  %96 = load ptr, ptr %14, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.EFI_TCP4_ACCESS_POINT, ptr %96, i32 0, i32 6
  store i8 1, ptr %97, align 2, !tbaa !55
  %98 = load ptr, ptr %14, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.EFI_TCP4_ACCESS_POINT, ptr %98, i32 0, i32 1
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._TCP4_IO_CONFIG_DATA, ptr %100, i32 0, i32 0
  %102 = call ptr @CopyMem(ptr noundef %99, ptr noundef %101, i64 noundef 4)
  %103 = load ptr, ptr %14, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.EFI_TCP4_ACCESS_POINT, ptr %103, i32 0, i32 2
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._TCP4_IO_CONFIG_DATA, ptr %105, i32 0, i32 1
  %107 = call ptr @CopyMem(ptr noundef %104, ptr noundef %106, i64 noundef 4)
  %108 = load ptr, ptr %14, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.EFI_TCP4_ACCESS_POINT, ptr %108, i32 0, i32 4
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._TCP4_IO_CONFIG_DATA, ptr %110, i32 0, i32 3
  %112 = call ptr @CopyMem(ptr noundef %109, ptr noundef %111, i64 noundef 4)
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._EFI_TCP4_PROTOCOL, ptr %113, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !56
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = call i64 %115(ptr noundef %116, ptr noundef %12)
  store i64 %117, ptr %10, align 8, !tbaa !19
  %118 = load i64, ptr %10, align 8, !tbaa !19
  %119 = icmp slt i64 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %58
  br label %199

121:                                              ; preds = %58
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._TCP4_IO_CONFIG_DATA, ptr %122, i32 0, i32 2
  %124 = call i64 @CompareMem(ptr noundef %123, ptr noundef @mZeroIp4Addr, i64 noundef 4)
  %125 = icmp eq i64 %124, 0
  br i1 %125, label %138, label %126

126:                                              ; preds = %121
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._EFI_TCP4_PROTOCOL, ptr %127, i32 0, i32 2
  %129 = load ptr, ptr %128, align 8, !tbaa !58
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._TCP4_IO_CONFIG_DATA, ptr %131, i32 0, i32 2
  %133 = call i64 %129(ptr noundef %130, i8 noundef zeroext 0, ptr noundef @mZeroIp4Addr, ptr noundef @mZeroIp4Addr, ptr noundef %132)
  store i64 %133, ptr %10, align 8, !tbaa !19
  %134 = load i64, ptr %10, align 8, !tbaa !19
  %135 = icmp slt i64 %134, 0
  br i1 %135, label %136, label %137

136:                                              ; preds = %126
  br label %199

137:                                              ; preds = %126
  br label %138

138:                                              ; preds = %137, %121
  %139 = load ptr, ptr @gBS, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %139, i32 0, i32 8
  %141 = load ptr, ptr %140, align 8, !tbaa !59
  %142 = load ptr, ptr %9, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._TCP4_IO, ptr %142, i32 0, i32 8
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._TCP4_IO, ptr %144, i32 0, i32 4
  %146 = getelementptr inbounds %struct.EFI_TCP4_CONNECTION_TOKEN, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %146, i32 0, i32 0
  %148 = call i64 %141(i32 noundef 512, i64 noundef 16, ptr noundef @Tcp4IoCommonNotify, ptr noundef %143, ptr noundef %147)
  store i64 %148, ptr %10, align 8, !tbaa !19
  %149 = load i64, ptr %10, align 8, !tbaa !19
  %150 = icmp slt i64 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %138
  br label %199

152:                                              ; preds = %138
  %153 = load ptr, ptr @gBS, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %153, i32 0, i32 8
  %155 = load ptr, ptr %154, align 8, !tbaa !59
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct._TCP4_IO, ptr %156, i32 0, i32 9
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._TCP4_IO, ptr %158, i32 0, i32 5
  %160 = getelementptr inbounds %struct.EFI_TCP4_IO_TOKEN, ptr %159, i32 0, i32 0
  %161 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %160, i32 0, i32 0
  %162 = call i64 %155(i32 noundef 512, i64 noundef 16, ptr noundef @Tcp4IoCommonNotify, ptr noundef %157, ptr noundef %161)
  store i64 %162, ptr %10, align 8, !tbaa !19
  %163 = load i64, ptr %10, align 8, !tbaa !19
  %164 = icmp slt i64 %163, 0
  br i1 %164, label %165, label %166

165:                                              ; preds = %152
  br label %199

166:                                              ; preds = %152
  %167 = load ptr, ptr @gBS, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %167, i32 0, i32 8
  %169 = load ptr, ptr %168, align 8, !tbaa !59
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct._TCP4_IO, ptr %170, i32 0, i32 10
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct._TCP4_IO, ptr %172, i32 0, i32 6
  %174 = getelementptr inbounds %struct.EFI_TCP4_IO_TOKEN, ptr %173, i32 0, i32 0
  %175 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %174, i32 0, i32 0
  %176 = call i64 %169(i32 noundef 512, i64 noundef 16, ptr noundef @Tcp4IoCommonNotify, ptr noundef %171, ptr noundef %175)
  store i64 %176, ptr %10, align 8, !tbaa !19
  %177 = load i64, ptr %10, align 8, !tbaa !19
  %178 = icmp slt i64 %177, 0
  br i1 %178, label %179, label %180

179:                                              ; preds = %166
  br label %199

180:                                              ; preds = %166
  %181 = load ptr, ptr @gBS, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %181, i32 0, i32 8
  %183 = load ptr, ptr %182, align 8, !tbaa !59
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._TCP4_IO, ptr %184, i32 0, i32 11
  %186 = load ptr, ptr %9, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct._TCP4_IO, ptr %186, i32 0, i32 7
  %188 = getelementptr inbounds %struct.EFI_TCP4_CLOSE_TOKEN, ptr %187, i32 0, i32 0
  %189 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %188, i32 0, i32 0
  %190 = call i64 %183(i32 noundef 512, i64 noundef 16, ptr noundef @Tcp4IoCommonNotify, ptr noundef %185, ptr noundef %189)
  store i64 %190, ptr %10, align 8, !tbaa !19
  %191 = load i64, ptr %10, align 8, !tbaa !19
  %192 = icmp slt i64 %191, 0
  br i1 %192, label %193, label %194

193:                                              ; preds = %180
  br label %199

194:                                              ; preds = %180
  %195 = load ptr, ptr %9, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct._TCP4_IO, ptr %195, i32 0, i32 9
  store i8 0, ptr %196, align 1, !tbaa !60
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct._TCP4_IO, ptr %197, i32 0, i32 10
  store i8 0, ptr %198, align 2, !tbaa !61
  store i64 0, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %276

199:                                              ; preds = %193, %179, %165, %151, %136, %120, %57
  %200 = load ptr, ptr %9, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct._TCP4_IO, ptr %200, i32 0, i32 6
  %202 = getelementptr inbounds %struct.EFI_TCP4_IO_TOKEN, ptr %201, i32 0, i32 0
  %203 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %202, i32 0, i32 0
  %204 = load ptr, ptr %203, align 8, !tbaa !17
  %205 = icmp ne ptr %204, null
  br i1 %205, label %206, label %216

206:                                              ; preds = %199
  %207 = load ptr, ptr @gBS, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %207, i32 0, i32 12
  %209 = load ptr, ptr %208, align 8, !tbaa !62
  %210 = load ptr, ptr %9, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct._TCP4_IO, ptr %210, i32 0, i32 6
  %212 = getelementptr inbounds %struct.EFI_TCP4_IO_TOKEN, ptr %211, i32 0, i32 0
  %213 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %212, i32 0, i32 0
  %214 = load ptr, ptr %213, align 8, !tbaa !17
  %215 = call i64 %209(ptr noundef %214)
  br label %216

216:                                              ; preds = %206, %199
  %217 = load ptr, ptr %9, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct._TCP4_IO, ptr %217, i32 0, i32 5
  %219 = getelementptr inbounds %struct.EFI_TCP4_IO_TOKEN, ptr %218, i32 0, i32 0
  %220 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %219, i32 0, i32 0
  %221 = load ptr, ptr %220, align 8, !tbaa !16
  %222 = icmp ne ptr %221, null
  br i1 %222, label %223, label %233

223:                                              ; preds = %216
  %224 = load ptr, ptr @gBS, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %224, i32 0, i32 12
  %226 = load ptr, ptr %225, align 8, !tbaa !62
  %227 = load ptr, ptr %9, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct._TCP4_IO, ptr %227, i32 0, i32 5
  %229 = getelementptr inbounds %struct.EFI_TCP4_IO_TOKEN, ptr %228, i32 0, i32 0
  %230 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %229, i32 0, i32 0
  %231 = load ptr, ptr %230, align 8, !tbaa !16
  %232 = call i64 %226(ptr noundef %231)
  br label %233

233:                                              ; preds = %223, %216
  %234 = load ptr, ptr %9, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct._TCP4_IO, ptr %234, i32 0, i32 4
  %236 = getelementptr inbounds %struct.EFI_TCP4_CONNECTION_TOKEN, ptr %235, i32 0, i32 0
  %237 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %236, i32 0, i32 0
  %238 = load ptr, ptr %237, align 8, !tbaa !15
  %239 = icmp ne ptr %238, null
  br i1 %239, label %240, label %250

240:                                              ; preds = %233
  %241 = load ptr, ptr @gBS, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %241, i32 0, i32 12
  %243 = load ptr, ptr %242, align 8, !tbaa !62
  %244 = load ptr, ptr %9, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct._TCP4_IO, ptr %244, i32 0, i32 4
  %246 = getelementptr inbounds %struct.EFI_TCP4_CONNECTION_TOKEN, ptr %245, i32 0, i32 0
  %247 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %246, i32 0, i32 0
  %248 = load ptr, ptr %247, align 8, !tbaa !15
  %249 = call i64 %243(ptr noundef %248)
  br label %250

250:                                              ; preds = %240, %233
  %251 = load ptr, ptr %11, align 8, !tbaa !5
  %252 = icmp ne ptr %251, null
  br i1 %252, label %253, label %268

253:                                              ; preds = %250
  %254 = load ptr, ptr %11, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct._EFI_TCP4_PROTOCOL, ptr %254, i32 0, i32 1
  %256 = load ptr, ptr %255, align 8, !tbaa !56
  %257 = load ptr, ptr %11, align 8, !tbaa !5
  %258 = call i64 %256(ptr noundef %257, ptr noundef null)
  %259 = load ptr, ptr @gBS, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %259, i32 0, i32 34
  %261 = load ptr, ptr %260, align 8, !tbaa !63
  %262 = load ptr, ptr %9, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct._TCP4_IO, ptr %262, i32 0, i32 2
  %264 = load ptr, ptr %263, align 8, !tbaa !9
  %265 = load ptr, ptr %6, align 8, !tbaa !5
  %266 = load ptr, ptr %7, align 8, !tbaa !5
  %267 = call i64 %261(ptr noundef %264, ptr noundef @gEfiTcp4ProtocolGuid, ptr noundef %265, ptr noundef %266)
  br label %268

268:                                              ; preds = %253, %250
  %269 = load ptr, ptr %7, align 8, !tbaa !5
  %270 = load ptr, ptr %6, align 8, !tbaa !5
  %271 = load ptr, ptr %9, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct._TCP4_IO, ptr %271, i32 0, i32 2
  %273 = load ptr, ptr %272, align 8, !tbaa !9
  %274 = call i64 @NetLibDestroyServiceChild(ptr noundef %269, ptr noundef %270, ptr noundef @gEfiTcp4ServiceBindingProtocolGuid, ptr noundef %273)
  %275 = load i64, ptr %10, align 8, !tbaa !19
  store i64 %275, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %276

276:                                              ; preds = %268, %194, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %277 = load i64, ptr %5, align 8
  ret i64 %277
}

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_TCP4_IO", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !14, i64 48, !14, i64 72, !14, i64 96, !7, i64 120, !7, i64 121, !7, i64 122, !7, i64 123}
!11 = !{!"", !12, i64 0}
!12 = !{!"", !6, i64 0, !13, i64 8}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"", !12, i64 0, !7, i64 16}
!15 = !{!10, !6, i64 32}
!16 = !{!10, !6, i64 48}
!17 = !{!10, !6, i64 72}
!18 = !{!10, !6, i64 96}
!19 = !{!13, !13, i64 0}
!20 = !{!21, !6, i64 280}
!21 = !{!"", !22, 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}
!22 = !{!"", !13, i64 0, !23, i64 8, !23, i64 12, !23, i64 16, !23, i64 20}
!23 = !{!"int", !7, i64 0}
!24 = !{!10, !6, i64 0}
!25 = !{!10, !6, i64 8}
!26 = !{!10, !6, i64 24}
!27 = !{!28, !23, i64 0}
!28 = !{!"", !23, i64 0, !23, i64 4, !23, i64 8, !23, i64 12, !23, i64 16, !23, i64 20, !23, i64 24, !23, i64 28, !23, i64 32, !23, i64 36, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44}
!29 = !{!28, !23, i64 4}
!30 = !{!28, !23, i64 8}
!31 = !{!28, !23, i64 12}
!32 = !{!28, !23, i64 16}
!33 = !{!28, !23, i64 20}
!34 = !{!28, !23, i64 24}
!35 = !{!28, !23, i64 28}
!36 = !{!28, !23, i64 32}
!37 = !{!28, !23, i64 36}
!38 = !{!28, !7, i64 40}
!39 = !{!28, !7, i64 41}
!40 = !{!28, !7, i64 42}
!41 = !{!28, !7, i64 43}
!42 = !{!28, !7, i64 44}
!43 = !{!44, !7, i64 0}
!44 = !{!"", !7, i64 0, !7, i64 1, !45, i64 2, !6, i64 24}
!45 = !{!"", !7, i64 0, !46, i64 1, !46, i64 5, !47, i64 10, !46, i64 12, !47, i64 16, !7, i64 18}
!46 = !{!"", !7, i64 0}
!47 = !{!"short", !7, i64 0}
!48 = !{!44, !7, i64 1}
!49 = !{!44, !6, i64 24}
!50 = !{!45, !7, i64 0}
!51 = !{!45, !47, i64 10}
!52 = !{!53, !47, i64 16}
!53 = !{!"_TCP4_IO_CONFIG_DATA", !46, i64 0, !46, i64 4, !46, i64 8, !46, i64 12, !47, i64 16}
!54 = !{!45, !47, i64 16}
!55 = !{!45, !7, i64 18}
!56 = !{!57, !6, i64 8}
!57 = !{!"_EFI_TCP4_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!58 = !{!57, !6, i64 16}
!59 = !{!21, !6, i64 80}
!60 = !{!10, !7, i64 121}
!61 = !{!10, !7, i64 122}
!62 = !{!21, !6, i64 112}
!63 = !{!21, !6, i64 288}


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

%struct.GUID = type { i32, i16, i16, [8 x i8] }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_TCP4_CONFIG_DATA = type { i8, i8, %struct.EFI_TCP4_ACCESS_POINT, ptr }
%struct.EFI_TCP4_ACCESS_POINT = type { i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16, i8 }
%struct.EFI_TCP4_OPTION = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i8 }

@gEfiTcp4ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@gBS = external local_unnamed_addr global ptr, align 8
@gEfiTcp4ProtocolGuid = external global %struct.GUID, align 4
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

; Function Attrs: nounwind uwtable
declare dso_local void @Tcp4IoCommonNotify(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @Tcp4IoCreateSocket(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca %struct.EFI_TCP4_CONFIG_DATA, align 8
  %6 = alloca %struct.EFI_TCP4_OPTION, align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #4
  %7 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr null, ptr %7, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %3, i64 32
  store ptr null, ptr %8, align 8, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %3, i64 48
  store ptr null, ptr %9, align 8, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %3, i64 72
  store ptr null, ptr %10, align 8, !tbaa !16
  %11 = getelementptr inbounds i8, ptr %3, i64 96
  store ptr null, ptr %11, align 8, !tbaa !17
  %12 = tail call i64 @NetLibCreateServiceChild(ptr noundef %1, ptr noundef %0, ptr noundef nonnull @gEfiTcp4ServiceBindingProtocolGuid, ptr noundef nonnull %7) #4
  %13 = icmp slt i64 %12, 0
  br i1 %13, label %122, label %14

14:                                               ; preds = %4
  %15 = load ptr, ptr @gBS, align 8, !tbaa !18
  %16 = getelementptr inbounds i8, ptr %15, i64 280
  %17 = load ptr, ptr %16, align 8, !tbaa !19
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %3, i64 24
  %20 = tail call i64 %17(ptr noundef %18, ptr noundef nonnull @gEfiTcp4ProtocolGuid, ptr noundef nonnull %19, ptr noundef %0, ptr noundef %1, i32 noundef 16) #4
  %21 = icmp slt i64 %20, 0
  br i1 %21, label %88, label %22

22:                                               ; preds = %14
  store ptr %0, ptr %3, align 8, !tbaa !23
  %23 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %1, ptr %23, align 8, !tbaa !24
  %24 = load ptr, ptr %19, align 8, !tbaa !25
  store <4 x i32> <i32 2097152, i32 2097152, i32 0, i32 0>, ptr %6, align 16, !tbaa !26
  %25 = getelementptr inbounds i8, ptr %6, i64 16
  store <4 x i32> <i32 6, i32 0, i32 0, i32 4>, ptr %25, align 16, !tbaa !26
  %26 = getelementptr inbounds i8, ptr %6, i64 32
  %27 = getelementptr inbounds i8, ptr %6, i64 42
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10) %26, i8 0, i64 10, i1 false)
  store i8 1, ptr %27, align 2, !tbaa !27
  %28 = getelementptr inbounds i8, ptr %6, i64 43
  store i8 0, ptr %28, align 1, !tbaa !29
  %29 = getelementptr inbounds i8, ptr %6, i64 44
  store i8 0, ptr %29, align 4, !tbaa !30
  store i8 8, ptr %5, align 8, !tbaa !31
  %30 = getelementptr inbounds i8, ptr %5, i64 1
  store i8 -1, ptr %30, align 1, !tbaa !36
  %31 = getelementptr inbounds i8, ptr %5, i64 24
  store ptr %6, ptr %31, align 8, !tbaa !37
  %32 = getelementptr inbounds i8, ptr %5, i64 2
  store i8 0, ptr %32, align 2, !tbaa !38
  %33 = getelementptr inbounds i8, ptr %5, i64 12
  store i16 0, ptr %33, align 4, !tbaa !39
  %34 = getelementptr inbounds i8, ptr %2, i64 16
  %35 = load i16, ptr %34, align 2, !tbaa !40
  %36 = getelementptr inbounds i8, ptr %5, i64 18
  store i16 %35, ptr %36, align 2, !tbaa !42
  %37 = getelementptr inbounds i8, ptr %5, i64 20
  store i8 1, ptr %37, align 4, !tbaa !43
  %38 = getelementptr inbounds i8, ptr %5, i64 3
  %39 = call ptr @CopyMem(ptr noundef nonnull %38, ptr noundef %2, i64 noundef 4) #4
  %40 = getelementptr inbounds i8, ptr %5, i64 7
  %41 = getelementptr inbounds i8, ptr %2, i64 4
  %42 = call ptr @CopyMem(ptr noundef nonnull %40, ptr noundef nonnull %41, i64 noundef 4) #4
  %43 = getelementptr inbounds i8, ptr %5, i64 14
  %44 = getelementptr inbounds i8, ptr %2, i64 12
  %45 = call ptr @CopyMem(ptr noundef nonnull %43, ptr noundef nonnull %44, i64 noundef 4) #4
  %46 = getelementptr inbounds i8, ptr %24, i64 8
  %47 = load ptr, ptr %46, align 8, !tbaa !44
  %48 = call i64 %47(ptr noundef %24, ptr noundef nonnull %5) #4
  %49 = icmp slt i64 %48, 0
  br i1 %49, label %88, label %50

50:                                               ; preds = %22
  %51 = getelementptr inbounds i8, ptr %2, i64 8
  %52 = call i64 @CompareMem(ptr noundef nonnull %51, ptr noundef nonnull @mZeroIp4Addr, i64 noundef 4) #4
  %53 = icmp eq i64 %52, 0
  br i1 %53, label %59, label %54

54:                                               ; preds = %50
  %55 = getelementptr inbounds i8, ptr %24, i64 16
  %56 = load ptr, ptr %55, align 8, !tbaa !46
  %57 = call i64 %56(ptr noundef nonnull %24, i8 noundef zeroext 0, ptr noundef nonnull @mZeroIp4Addr, ptr noundef nonnull @mZeroIp4Addr, ptr noundef nonnull %51) #4
  %58 = icmp slt i64 %57, 0
  br i1 %58, label %88, label %59

59:                                               ; preds = %54, %50
  %60 = load ptr, ptr @gBS, align 8, !tbaa !18
  %61 = getelementptr inbounds i8, ptr %60, i64 80
  %62 = load ptr, ptr %61, align 8, !tbaa !47
  %63 = getelementptr inbounds i8, ptr %3, i64 120
  %64 = call i64 %62(i32 noundef 512, i64 noundef 16, ptr noundef nonnull @Tcp4IoCommonNotify, ptr noundef nonnull %63, ptr noundef nonnull %8) #4
  %65 = icmp slt i64 %64, 0
  br i1 %65, label %88, label %66

66:                                               ; preds = %59
  %67 = load ptr, ptr @gBS, align 8, !tbaa !18
  %68 = getelementptr inbounds i8, ptr %67, i64 80
  %69 = load ptr, ptr %68, align 8, !tbaa !47
  %70 = getelementptr inbounds i8, ptr %3, i64 121
  %71 = call i64 %69(i32 noundef 512, i64 noundef 16, ptr noundef nonnull @Tcp4IoCommonNotify, ptr noundef nonnull %70, ptr noundef nonnull %9) #4
  %72 = icmp slt i64 %71, 0
  br i1 %72, label %88, label %73

73:                                               ; preds = %66
  %74 = load ptr, ptr @gBS, align 8, !tbaa !18
  %75 = getelementptr inbounds i8, ptr %74, i64 80
  %76 = load ptr, ptr %75, align 8, !tbaa !47
  %77 = getelementptr inbounds i8, ptr %3, i64 122
  %78 = call i64 %76(i32 noundef 512, i64 noundef 16, ptr noundef nonnull @Tcp4IoCommonNotify, ptr noundef nonnull %77, ptr noundef nonnull %10) #4
  %79 = icmp slt i64 %78, 0
  br i1 %79, label %88, label %80

80:                                               ; preds = %73
  %81 = load ptr, ptr @gBS, align 8, !tbaa !18
  %82 = getelementptr inbounds i8, ptr %81, i64 80
  %83 = load ptr, ptr %82, align 8, !tbaa !47
  %84 = getelementptr inbounds i8, ptr %3, i64 123
  %85 = call i64 %83(i32 noundef 512, i64 noundef 16, ptr noundef nonnull @Tcp4IoCommonNotify, ptr noundef nonnull %84, ptr noundef nonnull %11) #4
  %86 = icmp slt i64 %85, 0
  br i1 %86, label %88, label %87

87:                                               ; preds = %80
  store i8 0, ptr %70, align 1, !tbaa !48
  store i8 0, ptr %77, align 2, !tbaa !49
  br label %122

88:                                               ; preds = %80, %73, %66, %59, %54, %22, %14
  %.070 = phi i64 [ %20, %14 ], [ %48, %22 ], [ %64, %59 ], [ %71, %66 ], [ %78, %73 ], [ %85, %80 ], [ %57, %54 ]
  %.069 = phi ptr [ null, %14 ], [ %24, %22 ], [ %24, %59 ], [ %24, %66 ], [ %24, %73 ], [ %24, %80 ], [ %24, %54 ]
  %89 = load ptr, ptr %10, align 8, !tbaa !16
  %.not = icmp eq ptr %89, null
  br i1 %.not, label %95, label %90

90:                                               ; preds = %88
  %91 = load ptr, ptr @gBS, align 8, !tbaa !18
  %92 = getelementptr inbounds i8, ptr %91, i64 112
  %93 = load ptr, ptr %92, align 8, !tbaa !50
  %94 = call i64 %93(ptr noundef nonnull %89) #4
  br label %95

95:                                               ; preds = %90, %88
  %96 = load ptr, ptr %9, align 8, !tbaa !15
  %.not82 = icmp eq ptr %96, null
  br i1 %.not82, label %102, label %97

97:                                               ; preds = %95
  %98 = load ptr, ptr @gBS, align 8, !tbaa !18
  %99 = getelementptr inbounds i8, ptr %98, i64 112
  %100 = load ptr, ptr %99, align 8, !tbaa !50
  %101 = call i64 %100(ptr noundef nonnull %96) #4
  br label %102

102:                                              ; preds = %97, %95
  %103 = load ptr, ptr %8, align 8, !tbaa !14
  %.not83 = icmp eq ptr %103, null
  br i1 %.not83, label %109, label %104

104:                                              ; preds = %102
  %105 = load ptr, ptr @gBS, align 8, !tbaa !18
  %106 = getelementptr inbounds i8, ptr %105, i64 112
  %107 = load ptr, ptr %106, align 8, !tbaa !50
  %108 = call i64 %107(ptr noundef nonnull %103) #4
  br label %109

109:                                              ; preds = %104, %102
  %.not84 = icmp eq ptr %.069, null
  br i1 %.not84, label %119, label %110

110:                                              ; preds = %109
  %111 = getelementptr inbounds i8, ptr %.069, i64 8
  %112 = load ptr, ptr %111, align 8, !tbaa !44
  %113 = call i64 %112(ptr noundef nonnull %.069, ptr noundef null) #4
  %114 = load ptr, ptr @gBS, align 8, !tbaa !18
  %115 = getelementptr inbounds i8, ptr %114, i64 288
  %116 = load ptr, ptr %115, align 8, !tbaa !51
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = call i64 %116(ptr noundef %117, ptr noundef nonnull @gEfiTcp4ProtocolGuid, ptr noundef %0, ptr noundef %1) #4
  br label %119

119:                                              ; preds = %110, %109
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = call i64 @NetLibDestroyServiceChild(ptr noundef %1, ptr noundef %0, ptr noundef nonnull @gEfiTcp4ServiceBindingProtocolGuid, ptr noundef %120) #4
  br label %122

122:                                              ; preds = %4, %119, %87
  %.0 = phi i64 [ %.070, %119 ], [ 0, %87 ], [ %12, %4 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  ret i64 %.0
}

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

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 16}
!6 = !{!"_TCP4_IO", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !13, i64 48, !13, i64 72, !13, i64 96, !8, i64 120, !8, i64 121, !8, i64 122, !8, i64 123}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0}
!11 = !{!"", !7, i64 0, !12, i64 8}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"", !11, i64 0, !8, i64 16}
!14 = !{!6, !7, i64 32}
!15 = !{!6, !7, i64 48}
!16 = !{!6, !7, i64 72}
!17 = !{!6, !7, i64 96}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !7, i64 280}
!20 = !{!"", !21, 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}
!21 = !{!"", !12, i64 0, !22, i64 8, !22, i64 12, !22, i64 16, !22, i64 20}
!22 = !{!"int", !8, i64 0}
!23 = !{!6, !7, i64 0}
!24 = !{!6, !7, i64 8}
!25 = !{!6, !7, i64 24}
!26 = !{!22, !22, i64 0}
!27 = !{!28, !8, i64 42}
!28 = !{!"", !22, i64 0, !22, i64 4, !22, i64 8, !22, i64 12, !22, i64 16, !22, i64 20, !22, i64 24, !22, i64 28, !22, i64 32, !22, i64 36, !8, i64 40, !8, i64 41, !8, i64 42, !8, i64 43, !8, i64 44}
!29 = !{!28, !8, i64 43}
!30 = !{!28, !8, i64 44}
!31 = !{!32, !8, i64 0}
!32 = !{!"", !8, i64 0, !8, i64 1, !33, i64 2, !7, i64 24}
!33 = !{!"", !8, i64 0, !34, i64 1, !34, i64 5, !35, i64 10, !34, i64 12, !35, i64 16, !8, i64 18}
!34 = !{!"", !8, i64 0}
!35 = !{!"short", !8, i64 0}
!36 = !{!32, !8, i64 1}
!37 = !{!32, !7, i64 24}
!38 = !{!33, !8, i64 0}
!39 = !{!33, !35, i64 10}
!40 = !{!41, !35, i64 16}
!41 = !{!"_TCP4_IO_CONFIG_DATA", !34, i64 0, !34, i64 4, !34, i64 8, !34, i64 12, !35, i64 16}
!42 = !{!33, !35, i64 16}
!43 = !{!33, !8, i64 18}
!44 = !{!45, !7, i64 8}
!45 = !{!"_EFI_TCP4_PROTOCOL", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72}
!46 = !{!45, !7, i64 16}
!47 = !{!20, !7, i64 80}
!48 = !{!6, !8, i64 121}
!49 = !{!6, !8, i64 122}
!50 = !{!20, !7, i64 112}
!51 = !{!20, !7, i64 288}


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