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

; 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._TCP_CB = type { %struct._LIST_ENTRY, ptr, ptr, %struct._TCP_PEER, %struct._TCP_PEER, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i32, i8, i8, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, i32, i32, i32, i32, i32, i16, i16, [6 x i32], i32, i32, i32, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, i8, i8, i32, i32, i32, i8, i8, i16, i32, i32, i32, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, ptr }
%struct._TCP_PEER = type { i32, i16 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct._SOCKET = type { i32, ptr, ptr, ptr, ptr, %struct._LIST_ENTRY, i8, i32, i8, i16, %struct.EFI_LOCK, %struct._SOCK_BUFFER, %struct._SOCK_BUFFER, i64, i8, i32, i32, ptr, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, ptr, [20 x i8], %union._NET_PROTOCOL, ptr, ptr, ptr }
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct._SOCK_BUFFER = type { i32, i32, ptr }
%union._NET_PROTOCOL = type { %struct._EFI_TCP4_PROTOCOL }
%struct._EFI_TCP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_BUF_QUEUE = type { i32, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i32 }

@.str = external hidden unnamed_addr constant [153 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [50 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

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

declare zeroext i8 @DebugAssertEnabled() #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @TcpGetMaxSndNxt(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @TcpDataToSend(ptr noundef %0, i64 noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._TCP_CB, ptr %12, i32 0, i32 2
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  store ptr %14, ptr %6, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %2
  %16 = call zeroext i8 @DebugAssertEnabled()
  %17 = icmp ne i8 %16, 0
  br i1 %17, label %18, label %23

18:                                               ; preds = %15
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  call void @DebugAssert(ptr noundef @.str, i64 noundef 193, ptr noundef @.str.1)
  br label %22

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

23:                                               ; preds = %22, %15
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  store i32 0, ptr %7, align 4, !tbaa !18
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._TCP_CB, ptr %26, i32 0, i32 20
  %28 = load i32, ptr %27, align 4, !tbaa !19
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._TCP_CB, ptr %29, i32 0, i32 17
  %31 = load i32, ptr %30, align 8, !tbaa !20
  %32 = add i32 %28, %31
  store i32 %32, ptr %10, align 4, !tbaa !18
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._TCP_CB, ptr %33, i32 0, i32 13
  %35 = load i32, ptr %34, align 8, !tbaa !21
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._TCP_CB, ptr %36, i32 0, i32 43
  %38 = load i32, ptr %37, align 8, !tbaa !22
  %39 = add i32 %35, %38
  %40 = load i32, ptr %10, align 4, !tbaa !18
  %41 = sub i32 %39, %40
  %42 = icmp slt i32 %41, 0
  br i1 %42, label %43, label %51

43:                                               ; preds = %25
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._TCP_CB, ptr %44, i32 0, i32 13
  %46 = load i32, ptr %45, align 8, !tbaa !21
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._TCP_CB, ptr %47, i32 0, i32 43
  %49 = load i32, ptr %48, align 8, !tbaa !22
  %50 = add i32 %46, %49
  store i32 %50, ptr %10, align 4, !tbaa !18
  br label %51

51:                                               ; preds = %43, %25
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._TCP_CB, ptr %52, i32 0, i32 14
  %54 = load i32, ptr %53, align 4, !tbaa !23
  %55 = load i32, ptr %10, align 4, !tbaa !18
  %56 = sub i32 %54, %55
  %57 = icmp slt i32 %56, 0
  br i1 %57, label %58, label %64

58:                                               ; preds = %51
  %59 = load i32, ptr %10, align 4, !tbaa !18
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._TCP_CB, ptr %60, i32 0, i32 14
  %62 = load i32, ptr %61, align 4, !tbaa !23
  %63 = sub i32 %59, %62
  store i32 %63, ptr %7, align 4, !tbaa !18
  br label %64

64:                                               ; preds = %58, %51
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._SOCKET, ptr %65, i32 0, i32 11
  %67 = getelementptr inbounds %struct._SOCK_BUFFER, ptr %66, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !24
  %69 = getelementptr inbounds %struct.NET_BUF_QUEUE, ptr %68, i32 0, i32 4
  %70 = load i32, ptr %69, align 8, !tbaa !28
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = call i32 @TcpGetMaxSndNxt(ptr noundef %71)
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._TCP_CB, ptr %73, i32 0, i32 14
  %75 = load i32, ptr %74, align 4, !tbaa !23
  %76 = sub i32 %72, %75
  %77 = add i32 %70, %76
  store i32 %77, ptr %9, align 4, !tbaa !18
  %78 = load i32, ptr %7, align 4, !tbaa !18
  %79 = load i32, ptr %9, align 4, !tbaa !18
  %80 = icmp ult i32 %78, %79
  br i1 %80, label %81, label %83

81:                                               ; preds = %64
  %82 = load i32, ptr %7, align 4, !tbaa !18
  br label %85

83:                                               ; preds = %64
  %84 = load i32, ptr %9, align 4, !tbaa !18
  br label %85

85:                                               ; preds = %83, %81
  %86 = phi i32 [ %82, %81 ], [ %84, %83 ]
  store i32 %86, ptr %8, align 4, !tbaa !18
  %87 = load i32, ptr %8, align 4, !tbaa !18
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._TCP_CB, ptr %88, i32 0, i32 21
  %90 = load i16, ptr %89, align 8, !tbaa !30
  %91 = zext i16 %90 to i32
  %92 = icmp ugt i32 %87, %91
  br i1 %92, label %93, label %98

93:                                               ; preds = %85
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._TCP_CB, ptr %94, i32 0, i32 21
  %96 = load i16, ptr %95, align 8, !tbaa !30
  %97 = zext i16 %96 to i32
  store i32 %97, ptr %8, align 4, !tbaa !18
  br label %98

98:                                               ; preds = %93, %85
  %99 = load i64, ptr %5, align 8, !tbaa !9
  %100 = icmp ne i64 %99, 0
  br i1 %100, label %107, label %101

101:                                              ; preds = %98
  %102 = load i32, ptr %8, align 4, !tbaa !18
  %103 = icmp eq i32 %102, 0
  br i1 %103, label %104, label %109

104:                                              ; preds = %101
  %105 = load i32, ptr %9, align 4, !tbaa !18
  %106 = icmp eq i32 %105, 0
  br i1 %106, label %107, label %109

107:                                              ; preds = %104, %98
  %108 = load i32, ptr %8, align 4, !tbaa !18
  store i32 %108, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %188

109:                                              ; preds = %104, %101
  %110 = load i32, ptr %8, align 4, !tbaa !18
  %111 = icmp eq i32 %110, 0
  br i1 %111, label %112, label %116

112:                                              ; preds = %109
  %113 = load i32, ptr %9, align 4, !tbaa !18
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %116

115:                                              ; preds = %112
  br label %157

116:                                              ; preds = %112, %109
  %117 = load i32, ptr %8, align 4, !tbaa !18
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._TCP_CB, ptr %118, i32 0, i32 21
  %120 = load i16, ptr %119, align 8, !tbaa !30
  %121 = zext i16 %120 to i32
  %122 = icmp eq i32 %117, %121
  br i1 %122, label %130, label %123

123:                                              ; preds = %116
  %124 = load i32, ptr %8, align 4, !tbaa !18
  %125 = mul i32 2, %124
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._TCP_CB, ptr %126, i32 0, i32 18
  %128 = load i32, ptr %127, align 4, !tbaa !31
  %129 = icmp uge i32 %125, %128
  br i1 %129, label %130, label %132

130:                                              ; preds = %123, %116
  %131 = load i32, ptr %8, align 4, !tbaa !18
  store i32 %131, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %188

132:                                              ; preds = %123
  %133 = load i32, ptr %8, align 4, !tbaa !18
  %134 = load i32, ptr %9, align 4, !tbaa !18
  %135 = icmp eq i32 %133, %134
  br i1 %135, label %136, label %156

136:                                              ; preds = %132
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._TCP_CB, ptr %137, i32 0, i32 14
  %139 = load i32, ptr %138, align 4, !tbaa !23
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._TCP_CB, ptr %140, i32 0, i32 13
  %142 = load i32, ptr %141, align 8, !tbaa !21
  %143 = icmp eq i32 %139, %142
  br i1 %143, label %154, label %144

144:                                              ; preds = %136
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct._TCP_CB, ptr %145, i32 0, i32 7
  %147 = load i32, ptr %146, align 8, !tbaa !32
  %148 = and i32 %147, 1
  %149 = icmp ne i32 %148, 0
  %150 = zext i1 %149 to i32
  %151 = trunc i32 %150 to i8
  %152 = zext i8 %151 to i32
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %156

154:                                              ; preds = %144, %136
  %155 = load i32, ptr %8, align 4, !tbaa !18
  store i32 %155, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %188

156:                                              ; preds = %144, %132
  br label %157

157:                                              ; preds = %156, %115
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._TCP_CB, ptr %158, i32 0, i32 28
  %160 = load i16, ptr %159, align 2, !tbaa !33
  %161 = zext i16 %160 to i32
  %162 = and i32 %161, 2
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %187, label %164

164:                                              ; preds = %157
  br label %165

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

168:                                              ; preds = %165
  br label %169

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

172:                                              ; preds = %169
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2, ptr noundef @.str.3, ptr noundef %173)
  br label %174

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

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  br label %177

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

178:                                              ; preds = %177
  br label %179

179:                                              ; preds = %178
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct._TCP_CB, ptr %180, i32 0, i32 33
  %182 = load i8, ptr %181, align 8, !tbaa !34
  %183 = icmp ne i8 %182, 0
  br i1 %183, label %186, label %184

184:                                              ; preds = %179
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  call void @TcpSetProbeTimer(ptr noundef %185)
  br label %186

186:                                              ; preds = %184, %179
  br label %187

187:                                              ; preds = %186, %157
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %188

188:                                              ; preds = %187, %154, %130, %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %189 = load i32, ptr %3, align 4
  ret i32 %189
}

declare zeroext i8 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

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

declare void @TcpSetProbeTimer(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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"_TCP_CB", !13, i64 0, !6, i64 16, !6, i64 24, !14, i64 32, !14, i64 40, !13, i64 48, !13, i64 64, !15, i64 80, !15, i64 84, !7, i64 88, !7, i64 89, !16, i64 90, !15, i64 92, !15, i64 96, !15, i64 100, !15, i64 104, !15, i64 108, !15, i64 112, !15, i64 116, !15, i64 120, !15, i64 124, !16, i64 128, !15, i64 132, !15, i64 136, !15, i64 140, !15, i64 144, !15, i64 148, !16, i64 152, !16, i64 154, !7, i64 156, !15, i64 180, !15, i64 184, !15, i64 188, !7, i64 192, !7, i64 193, !7, i64 194, !15, i64 196, !15, i64 200, !15, i64 204, !15, i64 208, !15, i64 212, !15, i64 216, !15, i64 220, !15, i64 224, !15, i64 228, !15, i64 232, !16, i64 236, !7, i64 238, !7, i64 239, !15, i64 240, !15, i64 244, !15, i64 248, !7, i64 252, !7, i64 253, !16, i64 254, !15, i64 256, !15, i64 260, !15, i64 264, !7, i64 268, !7, i64 269, !7, i64 270, !17, i64 271, !6, i64 280}
!13 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!14 = !{!"_TCP_PEER", !15, i64 0, !16, i64 4}
!15 = !{!"int", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!"", !7, i64 0}
!18 = !{!15, !15, i64 0}
!19 = !{!12, !15, i64 124}
!20 = !{!12, !15, i64 112}
!21 = !{!12, !15, i64 96}
!22 = !{!12, !15, i64 224}
!23 = !{!12, !15, i64 100}
!24 = !{!25, !6, i64 104}
!25 = !{!"_SOCKET", !15, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !7, i64 56, !15, i64 60, !7, i64 64, !16, i64 66, !26, i64 72, !27, i64 96, !27, i64 112, !10, i64 128, !7, i64 136, !15, i64 140, !15, i64 144, !6, i64 152, !13, i64 160, !13, i64 176, !13, i64 192, !13, i64 208, !13, 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}
!26 = !{!"", !10, i64 0, !10, i64 8, !15, i64 16}
!27 = !{!"_SOCK_BUFFER", !15, i64 0, !15, i64 4, !6, i64 8}
!28 = !{!29, !15, i64 48}
!29 = !{!"", !15, i64 0, !10, i64 8, !13, i64 16, !13, i64 32, !15, i64 48, !15, i64 52}
!30 = !{!12, !16, i64 128}
!31 = !{!12, !15, i64 116}
!32 = !{!12, !15, i64 80}
!33 = !{!12, !16, i64 154}
!34 = !{!12, !7, i64 192}


; 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"

@.str = external hidden unnamed_addr constant [153 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [50 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

; Function Attrs: nounwind uwtable
declare dso_local i32 @TcpGetMaxSndNxt(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 65536) i32 @TcpDataToSend(ptr noundef %0, i64 noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = tail call zeroext i8 @DebugAssertEnabled() #3
  %6 = icmp eq i8 %5, 0
  %7 = icmp ne ptr %4, null
  %or.cond5 = select i1 %6, i1 true, i1 %7
  br i1 %or.cond5, label %9, label %8

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

9:                                                ; preds = %8, %2
  %10 = getelementptr inbounds i8, ptr %0, i64 124
  %11 = load i32, ptr %10, align 4, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %0, i64 112
  %13 = load i32, ptr %12, align 8, !tbaa !16
  %14 = add i32 %13, %11
  %15 = getelementptr inbounds i8, ptr %0, i64 96
  %16 = load i32, ptr %15, align 8, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %0, i64 224
  %18 = load i32, ptr %17, align 8, !tbaa !18
  %19 = add i32 %18, %16
  %20 = sub i32 %19, %14
  %21 = icmp slt i32 %20, 0
  %spec.select = select i1 %21, i32 %19, i32 %14
  %22 = getelementptr inbounds i8, ptr %0, i64 100
  %23 = load i32, ptr %22, align 4, !tbaa !19
  %24 = sub i32 %23, %spec.select
  %25 = icmp slt i32 %24, 0
  %26 = sub i32 %spec.select, %23
  %.051 = select i1 %25, i32 %26, i32 0
  %27 = getelementptr inbounds i8, ptr %4, i64 104
  %28 = load ptr, ptr %27, align 8, !tbaa !20
  %29 = getelementptr inbounds i8, ptr %28, i64 48
  %30 = load i32, ptr %29, align 8, !tbaa !25
  %31 = tail call i32 @TcpGetMaxSndNxt(ptr noundef nonnull %0)
  %32 = load i32, ptr %22, align 4, !tbaa !19
  %33 = sub i32 %31, %32
  %34 = add i32 %33, %30
  %35 = tail call i32 @llvm.umin.i32(i32 %.051, i32 %34)
  %36 = getelementptr inbounds i8, ptr %0, i64 128
  %37 = load i16, ptr %36, align 8, !tbaa !27
  %38 = zext i16 %37 to i32
  %.050 = tail call i32 @llvm.umin.i32(i32 %35, i32 %38)
  %.not = icmp ne i64 %1, 0
  %39 = or i32 %.050, %34
  %or.cond = icmp eq i32 %39, 0
  %or.cond60 = select i1 %.not, i1 true, i1 %or.cond
  br i1 %or.cond60, label %70, label %40

40:                                               ; preds = %9
  %41 = icmp eq i32 %.050, 0
  %42 = icmp ne i32 %34, 0
  %or.cond3 = and i1 %42, %41
  br i1 %or.cond3, label %57, label %43

43:                                               ; preds = %40
  %.not61 = icmp ult i32 %35, %38
  br i1 %.not61, label %44, label %70

44:                                               ; preds = %43
  %45 = shl nuw nsw i32 %.050, 1
  %46 = getelementptr inbounds i8, ptr %0, i64 116
  %47 = load i32, ptr %46, align 4, !tbaa !28
  %.not54 = icmp ult i32 %45, %47
  br i1 %.not54, label %48, label %70

48:                                               ; preds = %44
  %49 = icmp eq i32 %.050, %34
  br i1 %49, label %50, label %57

50:                                               ; preds = %48
  %51 = load i32, ptr %15, align 8, !tbaa !17
  %52 = icmp eq i32 %32, %51
  br i1 %52, label %70, label %53

53:                                               ; preds = %50
  %54 = getelementptr inbounds i8, ptr %0, i64 80
  %55 = load i32, ptr %54, align 8, !tbaa !29
  %56 = and i32 %55, 1
  %.not55 = icmp eq i32 %56, 0
  br i1 %.not55, label %57, label %70

57:                                               ; preds = %48, %53, %40
  %58 = getelementptr inbounds i8, ptr %0, i64 154
  %59 = load i16, ptr %58, align 2, !tbaa !30
  %60 = and i16 %59, 2
  %.not56 = icmp eq i16 %60, 0
  br i1 %.not56, label %61, label %70

61:                                               ; preds = %57
  %62 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not57 = icmp eq i8 %62, 0
  br i1 %.not57, label %66, label %63

63:                                               ; preds = %61
  %64 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2) #3
  %.not58 = icmp eq i8 %64, 0
  br i1 %.not58, label %66, label %65

65:                                               ; preds = %63
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2, ptr noundef nonnull @.str.3, ptr noundef nonnull %0) #3
  br label %66

66:                                               ; preds = %63, %65, %61
  %67 = getelementptr inbounds i8, ptr %0, i64 192
  %68 = load i8, ptr %67, align 8, !tbaa !31
  %.not59 = icmp eq i8 %68, 0
  br i1 %.not59, label %69, label %70

69:                                               ; preds = %66
  tail call void @TcpSetProbeTimer(ptr noundef nonnull %0) #3
  br label %70

70:                                               ; preds = %57, %69, %66, %50, %53, %43, %44, %9
  %.049 = phi i32 [ %.050, %9 ], [ %.050, %44 ], [ %.050, %43 ], [ %34, %53 ], [ %34, %50 ], [ 0, %66 ], [ 0, %69 ], [ 0, %57 ]
  ret i32 %.049
}

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 @TcpSetProbeTimer(ptr noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #2

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !8, i64 24}
!6 = !{!"_TCP_CB", !7, i64 0, !8, i64 16, !8, i64 24, !11, i64 32, !11, i64 40, !7, i64 48, !7, i64 64, !12, i64 80, !12, i64 84, !9, i64 88, !9, i64 89, !13, i64 90, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !13, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !13, i64 152, !13, i64 154, !9, i64 156, !12, i64 180, !12, i64 184, !12, i64 188, !9, i64 192, !9, i64 193, !9, i64 194, !12, i64 196, !12, i64 200, !12, i64 204, !12, i64 208, !12, i64 212, !12, i64 216, !12, i64 220, !12, i64 224, !12, i64 228, !12, i64 232, !13, i64 236, !9, i64 238, !9, i64 239, !12, i64 240, !12, i64 244, !12, i64 248, !9, i64 252, !9, i64 253, !13, i64 254, !12, i64 256, !12, i64 260, !12, i64 264, !9, i64 268, !9, i64 269, !9, i64 270, !14, i64 271, !8, i64 280}
!7 = !{!"_LIST_ENTRY", !8, i64 0, !8, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"_TCP_PEER", !12, i64 0, !13, i64 4}
!12 = !{!"int", !9, i64 0}
!13 = !{!"short", !9, i64 0}
!14 = !{!"", !9, i64 0}
!15 = !{!6, !12, i64 124}
!16 = !{!6, !12, i64 112}
!17 = !{!6, !12, i64 96}
!18 = !{!6, !12, i64 224}
!19 = !{!6, !12, i64 100}
!20 = !{!21, !8, i64 104}
!21 = !{!"_SOCKET", !12, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !7, i64 40, !9, i64 56, !12, i64 60, !9, i64 64, !13, i64 66, !22, i64 72, !24, i64 96, !24, i64 112, !23, i64 128, !9, i64 136, !12, i64 140, !12, i64 144, !8, i64 152, !7, i64 160, !7, i64 176, !7, i64 192, !7, i64 208, !7, i64 224, !8, i64 240, !8, i64 248, !8, i64 256, !9, i64 264, !9, i64 288, !8, i64 368, !8, i64 376, !8, i64 384}
!22 = !{!"", !23, i64 0, !23, i64 8, !12, i64 16}
!23 = !{!"long long", !9, i64 0}
!24 = !{!"_SOCK_BUFFER", !12, i64 0, !12, i64 4, !8, i64 8}
!25 = !{!26, !12, i64 48}
!26 = !{!"", !12, i64 0, !23, i64 8, !7, i64 16, !7, i64 32, !12, i64 48, !12, i64 52}
!27 = !{!6, !13, i64 128}
!28 = !{!6, !12, i64 116}
!29 = !{!6, !12, i64 80}
!30 = !{!6, !13, i64 154}
!31 = !{!6, !9, i64 192}


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