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

; 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._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.GUID = type { i32, i16, i16, [8 x i8] }
%struct.EFI_IP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8, i32, i32 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct._IP_IO_OPEN_DATA = type { %union.IP_IO_IP_CONFIG_DATA, ptr, ptr, ptr, ptr }
%union.IP_IO_IP_CONFIG_DATA = type { %struct.EFI_IP6_CONFIG_DATA }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct._EFI_DRIVER_BINDING_PROTOCOL = type { ptr, ptr, ptr, i32, ptr, ptr }
%struct._TCP4_SERVICE_DATA = type { i32, ptr, ptr, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, %struct._LIST_ENTRY }
%struct._LIST_ENTRY = type { 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 }

@mTcp4ServiceBinding = external dso_local global %struct._EFI_SERVICE_BINDING_PROTOCOL, align 8
@gBS = external global ptr, align 8
@gEfiTcp4ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@.str.5 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [68 x i8], align 1
@mIp4IoDefaultIpConfigData = external global %struct.EFI_IP4_CONFIG_DATA, align 4
@.str.7 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [77 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @Tcp4DriverBindingStart(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct._IP_IO_OPEN_DATA, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 88, ptr %10) #4
  %12 = call ptr @AllocateZeroPool(i64 noundef 64)
  store ptr %12, ptr %9, align 8, !tbaa !5
  %13 = load ptr, ptr %9, align 8, !tbaa !5
  %14 = icmp eq ptr null, %13
  br i1 %14, label %15, label %30

15:                                               ; preds = %3
  br label %16

16:                                               ; preds = %15
  %17 = call zeroext i8 @DebugPrintEnabled()
  %18 = icmp ne i8 %17, 0
  br i1 %18, label %19, label %27

19:                                               ; preds = %16
  br label %20

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

23:                                               ; preds = %20
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.5)
  br label %24

24:                                               ; preds = %23, %20
  br label %25

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25
  br label %27

27:                                               ; preds = %26, %16
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  store i64 -9223372036854775799, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %147

30:                                               ; preds = %3
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %31, i32 0, i32 5
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = call ptr @IpIoCreate(ptr noundef %33, ptr noundef %34, i8 noundef zeroext 4)
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %36, i32 0, i32 2
  store ptr %35, ptr %37, align 8, !tbaa !12
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %38, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !12
  %41 = icmp eq ptr null, %40
  br i1 %41, label %42, label %57

42:                                               ; preds = %30
  br label %43

43:                                               ; preds = %42
  %44 = call zeroext i8 @DebugPrintEnabled()
  %45 = icmp ne i8 %44, 0
  br i1 %45, label %46, label %54

46:                                               ; preds = %43
  br label %47

47:                                               ; preds = %46
  %48 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %49 = icmp ne i8 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.6)
  br label %51

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

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53, %43
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  store i64 -9223372036854775799, ptr %8, align 8, !tbaa !16
  br label %132

57:                                               ; preds = %30
  %58 = call ptr @ZeroMem(ptr noundef %10, i64 noundef 88)
  %59 = getelementptr inbounds %struct._IP_IO_OPEN_DATA, ptr %10, i32 0, i32 0
  %60 = call ptr @CopyMem(ptr noundef %59, ptr noundef @mIp4IoDefaultIpConfigData, i64 noundef 28)
  %61 = getelementptr inbounds %struct._IP_IO_OPEN_DATA, ptr %10, i32 0, i32 0
  %62 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %61, i32 0, i32 0
  store i8 6, ptr %62, align 8, !tbaa !18
  %63 = getelementptr inbounds %struct._IP_IO_OPEN_DATA, ptr %10, i32 0, i32 3
  store ptr @Tcp4RxCallback, ptr %63, align 8, !tbaa !19
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %64, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !12
  %67 = call i64 @IpIoOpen(ptr noundef %66, ptr noundef %10)
  store i64 %67, ptr %8, align 8, !tbaa !16
  %68 = load i64, ptr %8, align 8, !tbaa !16
  %69 = icmp slt i64 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %57
  br label %132

71:                                               ; preds = %57
  %72 = call i64 @Tcp4CreateTimer()
  store i64 %72, ptr %8, align 8, !tbaa !16
  %73 = load i64, ptr %8, align 8, !tbaa !16
  %74 = icmp slt i64 %73, 0
  br i1 %74, label %75, label %91

75:                                               ; preds = %71
  br label %76

76:                                               ; preds = %75
  %77 = call zeroext i8 @DebugPrintEnabled()
  %78 = icmp ne i8 %77, 0
  br i1 %78, label %79, label %88

79:                                               ; preds = %76
  br label %80

80:                                               ; preds = %79
  %81 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %82 = icmp ne i8 %81, 0
  br i1 %82, label %83, label %85

83:                                               ; preds = %80
  %84 = load i64, ptr %8, align 8, !tbaa !16
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.7, i64 noundef %84)
  br label %85

85:                                               ; preds = %83, %80
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87, %76
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  br label %132

91:                                               ; preds = %71
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %92, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %93, ptr align 8 @mTcp4ServiceBinding, i64 16, i1 false), !tbaa.struct !21
  %94 = load ptr, ptr @gBS, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %94, i32 0, i32 39
  %96 = load ptr, ptr %95, align 8, !tbaa !22
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %97, i32 0, i32 3
  %99 = call i64 (ptr, ...) %96(ptr noundef %6, ptr noundef @gEfiTcp4ServiceBindingProtocolGuid, ptr noundef %98, ptr noundef null)
  store i64 %99, ptr %8, align 8, !tbaa !16
  %100 = load i64, ptr %8, align 8, !tbaa !16
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %102, label %118

102:                                              ; preds = %91
  br label %103

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

106:                                              ; preds = %103
  br label %107

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

110:                                              ; preds = %107
  %111 = load i64, ptr %8, align 8, !tbaa !16
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.8, i64 noundef %111)
  br label %112

112:                                              ; preds = %110, %107
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114, %103
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116
  call void @Tcp4DestroyTimer()
  br label %132

118:                                              ; preds = %91
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %120, i32 0, i32 1
  store ptr %119, ptr %121, align 8, !tbaa !25
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %122, i32 0, i32 0
  store i32 877675348, ptr %123, align 8, !tbaa !26
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._EFI_DRIVER_BINDING_PROTOCOL, ptr %124, i32 0, i32 5
  %126 = load ptr, ptr %125, align 8, !tbaa !9
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %127, i32 0, i32 4
  store ptr %126, ptr %128, align 8, !tbaa !27
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %129, i32 0, i32 5
  %131 = call ptr @InitializeListHead(ptr noundef %130)
  store i64 0, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %147

132:                                              ; preds = %117, %90, %70, %56
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %133, i32 0, i32 2
  %135 = load ptr, ptr %134, align 8, !tbaa !12
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %144

137:                                              ; preds = %132
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %138, i32 0, i32 2
  %140 = load ptr, ptr %139, align 8, !tbaa !12
  %141 = call i64 @IpIoDestroy(ptr noundef %140)
  %142 = load ptr, ptr %9, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._TCP4_SERVICE_DATA, ptr %142, i32 0, i32 2
  store ptr null, ptr %143, align 8, !tbaa !12
  br label %144

144:                                              ; preds = %137, %132
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  call void @FreePool(ptr noundef %145)
  %146 = load i64, ptr %8, align 8, !tbaa !16
  store i64 %146, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %147

147:                                              ; preds = %144, %118, %29
  call void @llvm.lifetime.end.p0(i64 88, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %148 = load i64, ptr %4, align 8
  ret i64 %148
}

; Function Attrs: nounwind uwtable
declare dso_local i64 @Tcp4CreateTimer() #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @Tcp4DestroyTimer() #0

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

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

declare ptr @AllocateZeroPool(i64 noundef) #2

declare ptr @IpIoCreate(ptr noundef, ptr noundef, i8 noundef zeroext) #2

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

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

declare void @Tcp4RxCallback(i64 noundef, i8 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare ptr @InitializeListHead(ptr noundef) #2

declare i64 @IpIoDestroy(ptr noundef) #2

declare void @FreePool(ptr noundef) #2

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 40}
!10 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !6, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 16}
!13 = !{!"_TCP4_SERVICE_DATA", !11, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !6, i64 40, !15, i64 48}
!14 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!15 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !6, i64 72}
!20 = !{!"_IP_IO_OPEN_DATA", !7, i64 0, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!21 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!22 = !{!23, !6, i64 328}
!23 = !{!"", !24, 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}
!24 = !{!"", !17, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!25 = !{!13, !6, i64 8}
!26 = !{!13, !11, i64 0}
!27 = !{!13, !6, i64 40}


; 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._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.GUID = type { i32, i16, i16, [8 x i8] }
%struct.EFI_IP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8, i32, i32 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct._IP_IO_OPEN_DATA = type { %union.IP_IO_IP_CONFIG_DATA, ptr, ptr, ptr, ptr }
%union.IP_IO_IP_CONFIG_DATA = type { %struct.EFI_IP6_CONFIG_DATA }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }

@mTcp4ServiceBinding = external dso_local local_unnamed_addr global %struct._EFI_SERVICE_BINDING_PROTOCOL, align 8
@gBS = external local_unnamed_addr global ptr, align 8
@gEfiTcp4ServiceBindingProtocolGuid = external global %struct.GUID, align 4
@.str.5 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [68 x i8], align 1
@mIp4IoDefaultIpConfigData = external global %struct.EFI_IP4_CONFIG_DATA, align 4
@.str.7 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [77 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @Tcp4DriverBindingStart(ptr nocapture noundef readonly %0, ptr noundef %1, ptr nocapture noundef readnone %2) local_unnamed_addr #0 {
  %4 = alloca ptr, align 8
  %5 = alloca %struct._IP_IO_OPEN_DATA, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %5) #4
  %6 = tail call ptr @AllocateZeroPool(i64 noundef 64) #4
  %7 = icmp eq ptr %6, null
  br i1 %7, label %8, label %13

8:                                                ; preds = %3
  %9 = tail call zeroext i8 @DebugPrintEnabled() #4
  %.not34 = icmp eq i8 %9, 0
  br i1 %.not34, label %64, label %10

10:                                               ; preds = %8
  %11 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #4
  %.not35 = icmp eq i8 %11, 0
  br i1 %.not35, label %64, label %12

12:                                               ; preds = %10
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.5) #4
  br label %64

13:                                               ; preds = %3
  %14 = getelementptr inbounds i8, ptr %0, i64 40
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = tail call ptr @IpIoCreate(ptr noundef %15, ptr noundef %1, i8 noundef zeroext 4) #4
  %17 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %16, ptr %17, align 8, !tbaa !12
  %18 = icmp eq ptr %16, null
  br i1 %18, label %19, label %24

19:                                               ; preds = %13
  %20 = tail call zeroext i8 @DebugPrintEnabled() #4
  %.not31 = icmp eq i8 %20, 0
  br i1 %.not31, label %59, label %21

21:                                               ; preds = %19
  %22 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #4
  %.not32 = icmp eq i8 %22, 0
  br i1 %.not32, label %59, label %23

23:                                               ; preds = %21
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.6) #4
  br label %59

24:                                               ; preds = %13
  %25 = call ptr @ZeroMem(ptr noundef nonnull %5, i64 noundef 88) #4
  %26 = call ptr @CopyMem(ptr noundef nonnull %5, ptr noundef nonnull @mIp4IoDefaultIpConfigData, i64 noundef 28) #4
  store i8 6, ptr %5, align 8, !tbaa !16
  %27 = getelementptr inbounds i8, ptr %5, i64 72
  store ptr @Tcp4RxCallback, ptr %27, align 8, !tbaa !17
  %28 = load ptr, ptr %17, align 8, !tbaa !12
  %29 = call i64 @IpIoOpen(ptr noundef %28, ptr noundef nonnull %5) #4
  %30 = icmp slt i64 %29, 0
  br i1 %30, label %59, label %31

31:                                               ; preds = %24
  %32 = call i64 @Tcp4CreateTimer()
  %33 = icmp slt i64 %32, 0
  br i1 %33, label %34, label %39

34:                                               ; preds = %31
  %35 = call zeroext i8 @DebugPrintEnabled() #4
  %.not29 = icmp eq i8 %35, 0
  br i1 %.not29, label %59, label %36

36:                                               ; preds = %34
  %37 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #4
  %.not30 = icmp eq i8 %37, 0
  br i1 %.not30, label %59, label %38

38:                                               ; preds = %36
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.7, i64 noundef %32) #4
  br label %59

39:                                               ; preds = %31
  %40 = getelementptr inbounds i8, ptr %6, i64 24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(16) @mTcp4ServiceBinding, i64 16, i1 false), !tbaa.struct !19
  %41 = load ptr, ptr @gBS, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 328
  %43 = load ptr, ptr %42, align 8, !tbaa !20
  %44 = call i64 (ptr, ...) %43(ptr noundef nonnull %4, ptr noundef nonnull @gEfiTcp4ServiceBindingProtocolGuid, ptr noundef nonnull %40, ptr noundef null) #4
  %45 = icmp slt i64 %44, 0
  br i1 %45, label %46, label %52

46:                                               ; preds = %39
  %47 = call zeroext i8 @DebugPrintEnabled() #4
  %.not = icmp eq i8 %47, 0
  br i1 %.not, label %51, label %48

48:                                               ; preds = %46
  %49 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #4
  %.not28 = icmp eq i8 %49, 0
  br i1 %.not28, label %51, label %50

50:                                               ; preds = %48
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.8, i64 noundef %44) #4
  br label %51

51:                                               ; preds = %48, %50, %46
  call void @Tcp4DestroyTimer()
  br label %59

52:                                               ; preds = %39
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %53, ptr %54, align 8, !tbaa !24
  store i32 877675348, ptr %6, align 8, !tbaa !25
  %55 = load ptr, ptr %14, align 8, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %6, i64 40
  store ptr %55, ptr %56, align 8, !tbaa !26
  %57 = getelementptr inbounds i8, ptr %6, i64 48
  %58 = call ptr @InitializeListHead(ptr noundef nonnull %57) #4
  br label %64

59:                                               ; preds = %19, %23, %21, %34, %38, %36, %24, %51
  %.022 = phi i64 [ %29, %24 ], [ %32, %38 ], [ %32, %36 ], [ %32, %34 ], [ %44, %51 ], [ -9223372036854775799, %21 ], [ -9223372036854775799, %23 ], [ -9223372036854775799, %19 ]
  %60 = load ptr, ptr %17, align 8, !tbaa !12
  %.not33 = icmp eq ptr %60, null
  br i1 %.not33, label %63, label %61

61:                                               ; preds = %59
  %62 = call i64 @IpIoDestroy(ptr noundef nonnull %60) #4
  store ptr null, ptr %17, align 8, !tbaa !12
  br label %63

63:                                               ; preds = %61, %59
  call void @FreePool(ptr noundef nonnull %6) #4
  br label %64

64:                                               ; preds = %8, %12, %10, %63, %52
  %.0 = phi i64 [ %.022, %63 ], [ 0, %52 ], [ -9223372036854775799, %10 ], [ -9223372036854775799, %12 ], [ -9223372036854775799, %8 ]
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %5) #4
  ret i64 %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i64 @Tcp4CreateTimer() local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @Tcp4DestroyTimer() local_unnamed_addr #0

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #2

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

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

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #2

declare ptr @IpIoCreate(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #2

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

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

declare void @Tcp4RxCallback(i64 noundef, i8 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare ptr @InitializeListHead(ptr noundef) local_unnamed_addr #2

declare i64 @IpIoDestroy(ptr noundef) local_unnamed_addr #2

declare void @FreePool(ptr noundef) local_unnamed_addr #2

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 40}
!10 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !6, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 16}
!13 = !{!"_TCP4_SERVICE_DATA", !11, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !6, i64 40, !15, i64 48}
!14 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!15 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !6, i64 72}
!18 = !{!"_IP_IO_OPEN_DATA", !7, i64 0, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!19 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!20 = !{!21, !6, i64 328}
!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 = !{!"", !23, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!23 = !{!"long long", !7, i64 0}
!24 = !{!13, !6, i64 8}
!25 = !{!13, !11, i64 0}
!26 = !{!13, !6, i64 40}


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