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

; 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.NET_BUF = type { i32, i64, %struct._LIST_ENTRY, %union.NET_IP_HEAD, ptr, ptr, [64 x i8], ptr, i32, i32, [1 x %struct.NET_BLOCK_OP] }
%struct._LIST_ENTRY = type { ptr, ptr }
%union.NET_IP_HEAD = type { ptr }
%struct.NET_BLOCK_OP = type { ptr, ptr, ptr, ptr, i32 }
%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.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct._TCP_SEG = type { i32, i32, i32, i8, i16, i32 }

@.str.7 = external hidden unnamed_addr constant [152 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [79 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

; Function Attrs: nounwind uwtable
declare dso_local void @TcpTrimSegment(ptr noundef, i32 noundef, i32 noundef) #1

declare zeroext i8 @DebugAssertEnabled() #2

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

declare zeroext i8 @IsListEmpty(ptr noundef) #2

declare ptr @RemoveEntryList(ptr noundef) #2

declare void @NetbufFree(ptr noundef) #2

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

11:                                               ; preds = %2
  %12 = call zeroext i8 @DebugAssertEnabled()
  %13 = icmp ne i8 %12, 0
  br i1 %13, label %14, label %27

14:                                               ; preds = %11
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %25

17:                                               ; preds = %14
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %25

20:                                               ; preds = %17
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.NET_BUF, ptr %21, i32 0, i32 4
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = icmp eq ptr %23, null
  br i1 %24, label %26, label %25

25:                                               ; preds = %20, %17, %14
  call void @DebugAssert(ptr noundef @.str.7, i64 noundef 545, ptr noundef @.str.14)
  br label %26

26:                                               ; preds = %25, %20
  br label %27

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

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.NET_BUF, ptr %30, i32 0, i32 1
  %32 = load i64, ptr %31, align 8, !tbaa !14
  %33 = add nsw i64 %32, 1
  store i64 %33, ptr %31, align 8, !tbaa !14
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.NET_BUF, ptr %34, i32 0, i32 6
  %36 = getelementptr inbounds [64 x i8], ptr %35, i64 0, i64 0
  store ptr %36, ptr %5, align 8, !tbaa !5
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._TCP_CB, ptr %37, i32 0, i32 6
  store ptr %38, ptr %6, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = call zeroext i8 @IsListEmpty(ptr noundef %39)
  %41 = icmp ne i8 %40, 0
  br i1 %41, label %42, label %47

42:                                               ; preds = %29
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.NET_BUF, ptr %44, i32 0, i32 2
  %46 = call ptr @InsertTailList(ptr noundef %43, ptr noundef %45)
  store i32 1, ptr %10, align 4
  br label %199

47:                                               ; preds = %29
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %48, ptr %7, align 8, !tbaa !5
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._LIST_ENTRY, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !15
  store ptr %51, ptr %8, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %73, %47
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = icmp ne ptr %53, %54
  br i1 %55, label %56, label %78

56:                                               ; preds = %52
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = ptrtoint ptr %57 to i64
  %59 = sub i64 %58, ptrtoint (ptr getelementptr inbounds (%struct.NET_BUF, ptr null, i32 0, i32 2) to i64)
  %60 = inttoptr i64 %59 to ptr
  store ptr %60, ptr %9, align 8, !tbaa !5
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._TCP_SEG, ptr %61, i32 0, i32 0
  %63 = load i32, ptr %62, align 4, !tbaa !16
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.NET_BUF, ptr %64, i32 0, i32 6
  %66 = getelementptr inbounds [64 x i8], ptr %65, i64 0, i64 0
  %67 = getelementptr inbounds %struct._TCP_SEG, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !16
  %69 = sub i32 %63, %68
  %70 = icmp slt i32 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %56
  br label %78

72:                                               ; preds = %56
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %74, ptr %7, align 8, !tbaa !5
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._LIST_ENTRY, ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !15
  store ptr %77, ptr %8, align 8, !tbaa !5
  br label %52, !llvm.loop !19

78:                                               ; preds = %71, %52
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = icmp ne ptr %79, %80
  br i1 %81, label %82, label %121

82:                                               ; preds = %78
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = ptrtoint ptr %83 to i64
  %85 = sub i64 %84, ptrtoint (ptr getelementptr inbounds (%struct.NET_BUF, ptr null, i32 0, i32 2) to i64)
  %86 = inttoptr i64 %85 to ptr
  store ptr %86, ptr %9, align 8, !tbaa !5
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._TCP_SEG, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 4, !tbaa !16
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.NET_BUF, ptr %90, i32 0, i32 6
  %92 = getelementptr inbounds [64 x i8], ptr %91, i64 0, i64 0
  %93 = getelementptr inbounds %struct._TCP_SEG, ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !21
  %95 = sub i32 %89, %94
  %96 = icmp slt i32 %95, 0
  br i1 %96, label %97, label %120

97:                                               ; preds = %82
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._TCP_SEG, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !21
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.NET_BUF, ptr %101, i32 0, i32 6
  %103 = getelementptr inbounds [64 x i8], ptr %102, i64 0, i64 0
  %104 = getelementptr inbounds %struct._TCP_SEG, ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !21
  %106 = sub i32 %100, %105
  %107 = icmp sle i32 %106, 0
  br i1 %107, label %108, label %110

108:                                              ; preds = %97
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %109)
  store i32 1, ptr %10, align 4
  br label %199

110:                                              ; preds = %97
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.NET_BUF, ptr %112, i32 0, i32 6
  %114 = getelementptr inbounds [64 x i8], ptr %113, i64 0, i64 0
  %115 = getelementptr inbounds %struct._TCP_SEG, ptr %114, i32 0, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !21
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._TCP_SEG, ptr %117, i32 0, i32 1
  %119 = load i32, ptr %118, align 4, !tbaa !21
  call void @TcpTrimSegment(ptr noundef %111, i32 noundef %116, i32 noundef %119)
  br label %120

120:                                              ; preds = %110, %82
  br label %121

121:                                              ; preds = %120, %78
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.NET_BUF, ptr %123, i32 0, i32 2
  %125 = call ptr @InsertHeadList(ptr noundef %122, ptr noundef %124)
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._TCP_CB, ptr %126, i32 0, i32 7
  %128 = load i32, ptr %127, align 8, !tbaa !22
  %129 = or i32 %128, 16384
  store i32 %129, ptr %127, align 8, !tbaa !22
  br label %130

130:                                              ; preds = %194, %149, %121
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = icmp ne ptr %131, %132
  br i1 %133, label %134, label %198

134:                                              ; preds = %130
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = ptrtoint ptr %135 to i64
  %137 = sub i64 %136, ptrtoint (ptr getelementptr inbounds (%struct.NET_BUF, ptr null, i32 0, i32 2) to i64)
  %138 = inttoptr i64 %137 to ptr
  store ptr %138, ptr %9, align 8, !tbaa !5
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.NET_BUF, ptr %139, i32 0, i32 6
  %141 = getelementptr inbounds [64 x i8], ptr %140, i64 0, i64 0
  %142 = getelementptr inbounds %struct._TCP_SEG, ptr %141, i32 0, i32 1
  %143 = load i32, ptr %142, align 4, !tbaa !21
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._TCP_SEG, ptr %144, i32 0, i32 1
  %146 = load i32, ptr %145, align 4, !tbaa !21
  %147 = sub i32 %143, %146
  %148 = icmp sle i32 %147, 0
  br i1 %148, label %149, label %157

149:                                              ; preds = %134
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct._LIST_ENTRY, ptr %150, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !15
  store ptr %152, ptr %8, align 8, !tbaa !5
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.NET_BUF, ptr %153, i32 0, i32 2
  %155 = call ptr @RemoveEntryList(ptr noundef %154)
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %156)
  br label %130, !llvm.loop !26

157:                                              ; preds = %134
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.NET_BUF, ptr %158, i32 0, i32 6
  %160 = getelementptr inbounds [64 x i8], ptr %159, i64 0, i64 0
  %161 = getelementptr inbounds %struct._TCP_SEG, ptr %160, i32 0, i32 0
  %162 = load i32, ptr %161, align 8, !tbaa !16
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._TCP_SEG, ptr %163, i32 0, i32 1
  %165 = load i32, ptr %164, align 4, !tbaa !21
  %166 = sub i32 %162, %165
  %167 = icmp slt i32 %166, 0
  br i1 %167, label %168, label %194

168:                                              ; preds = %157
  %169 = load ptr, ptr %9, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.NET_BUF, ptr %169, i32 0, i32 6
  %171 = getelementptr inbounds [64 x i8], ptr %170, i64 0, i64 0
  %172 = getelementptr inbounds %struct._TCP_SEG, ptr %171, i32 0, i32 0
  %173 = load i32, ptr %172, align 8, !tbaa !16
  %174 = load ptr, ptr %5, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct._TCP_SEG, ptr %174, i32 0, i32 0
  %176 = load i32, ptr %175, align 4, !tbaa !16
  %177 = sub i32 %173, %176
  %178 = icmp sle i32 %177, 0
  br i1 %178, label %179, label %184

179:                                              ; preds = %168
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.NET_BUF, ptr %180, i32 0, i32 2
  %182 = call ptr @RemoveEntryList(ptr noundef %181)
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %183)
  store i32 1, ptr %10, align 4
  br label %199

184:                                              ; preds = %168
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct._TCP_SEG, ptr %186, i32 0, i32 0
  %188 = load i32, ptr %187, align 4, !tbaa !16
  %189 = load ptr, ptr %9, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.NET_BUF, ptr %189, i32 0, i32 6
  %191 = getelementptr inbounds [64 x i8], ptr %190, i64 0, i64 0
  %192 = getelementptr inbounds %struct._TCP_SEG, ptr %191, i32 0, i32 0
  %193 = load i32, ptr %192, align 8, !tbaa !16
  call void @TcpTrimSegment(ptr noundef %185, i32 noundef %188, i32 noundef %193)
  br label %198

194:                                              ; preds = %157
  %195 = load ptr, ptr %8, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct._LIST_ENTRY, ptr %195, i32 0, i32 0
  %197 = load ptr, ptr %196, align 8, !tbaa !15
  store ptr %197, ptr %8, align 8, !tbaa !5
  br label %130, !llvm.loop !26

198:                                              ; preds = %184, %130
  store i32 0, ptr %10, align 4
  br label %199

199:                                              ; preds = %198, %179, %108, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %200 = load i32, ptr %10, align 4
  switch i32 %200, label %202 [
    i32 0, label %201
    i32 1, label %201
  ]

201:                                              ; preds = %199, %199
  ret void

202:                                              ; preds = %199
  unreachable
}

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

declare ptr @InsertHeadList(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 40}
!10 = !{!"", !11, i64 0, !12, i64 8, !13, i64 16, !7, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !11, i64 128, !11, i64 132, !7, i64 136}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!14 = !{!10, !12, i64 8}
!15 = !{!13, !6, i64 0}
!16 = !{!17, !11, i64 0}
!17 = !{!"_TCP_SEG", !11, i64 0, !11, i64 4, !11, i64 8, !7, i64 12, !18, i64 14, !11, i64 16}
!18 = !{!"short", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!17, !11, i64 4}
!22 = !{!23, !11, i64 80}
!23 = !{!"_TCP_CB", !13, i64 0, !6, i64 16, !6, i64 24, !24, i64 32, !24, i64 40, !13, i64 48, !13, i64 64, !11, i64 80, !11, i64 84, !7, i64 88, !7, i64 89, !18, i64 90, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !18, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !18, i64 152, !18, i64 154, !7, i64 156, !11, i64 180, !11, i64 184, !11, i64 188, !7, i64 192, !7, i64 193, !7, i64 194, !11, i64 196, !11, i64 200, !11, i64 204, !11, i64 208, !11, i64 212, !11, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !11, i64 232, !18, i64 236, !7, i64 238, !7, i64 239, !11, i64 240, !11, i64 244, !11, i64 248, !7, i64 252, !7, i64 253, !18, i64 254, !11, i64 256, !11, i64 260, !11, i64 264, !7, i64 268, !7, i64 269, !7, i64 270, !25, i64 271, !6, i64 280}
!24 = !{!"_TCP_PEER", !11, i64 0, !18, i64 4}
!25 = !{!"", !7, i64 0}
!26 = distinct !{!26, !20}


; 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.7 = external hidden unnamed_addr constant [152 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [79 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

declare zeroext i8 @IsListEmpty(ptr noundef) local_unnamed_addr #1

declare ptr @RemoveEntryList(ptr noundef) local_unnamed_addr #1

declare void @NetbufFree(ptr noundef) local_unnamed_addr #1

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

4:                                                ; preds = %2
  %5 = icmp ne ptr %0, null
  %6 = icmp ne ptr %1, null
  %or.cond = and i1 %5, %6
  br i1 %or.cond, label %7, label %11

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %1, i64 40
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %7, %11, %2
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = load i64, ptr %13, align 8, !tbaa !13
  %15 = add nsw i64 %14, 1
  store i64 %15, ptr %13, align 8, !tbaa !13
  %16 = getelementptr inbounds i8, ptr %1, i64 56
  %17 = getelementptr inbounds i8, ptr %0, i64 64
  %18 = tail call zeroext i8 @IsListEmpty(ptr noundef nonnull %17) #2
  %.not53 = icmp eq i8 %18, 0
  br i1 %.not53, label %.preheader, label %19

19:                                               ; preds = %12
  %20 = getelementptr inbounds i8, ptr %1, i64 16
  %21 = tail call ptr @InsertTailList(ptr noundef nonnull %17, ptr noundef nonnull %20) #2
  br label %.loopexit

.preheader:                                       ; preds = %12, %22
  %.051 = phi ptr [ %.0, %22 ], [ %17, %12 ]
  %.0 = load ptr, ptr %.051, align 8, !tbaa !14
  %.not54 = icmp eq ptr %.0, %17
  br i1 %.not54, label %31, label %22

22:                                               ; preds = %.preheader
  %23 = ptrtoint ptr %.0 to i64
  %24 = add i64 %23, -16
  %25 = inttoptr i64 %24 to ptr
  %26 = load i32, ptr %16, align 4, !tbaa !15
  %27 = getelementptr inbounds i8, ptr %25, i64 56
  %28 = load i32, ptr %27, align 8, !tbaa !15
  %29 = sub i32 %26, %28
  %30 = icmp slt i32 %29, 0
  br i1 %30, label %31, label %.preheader, !llvm.loop !18

31:                                               ; preds = %22, %.preheader
  %.not55 = icmp eq ptr %.051, %17
  br i1 %.not55, label %48, label %32

32:                                               ; preds = %31
  %33 = ptrtoint ptr %.051 to i64
  %34 = add i64 %33, -16
  %35 = inttoptr i64 %34 to ptr
  %36 = load i32, ptr %16, align 4, !tbaa !15
  %37 = getelementptr inbounds i8, ptr %35, i64 60
  %38 = load i32, ptr %37, align 4, !tbaa !20
  %39 = sub i32 %36, %38
  %40 = icmp slt i32 %39, 0
  br i1 %40, label %41, label %48

41:                                               ; preds = %32
  %42 = getelementptr inbounds i8, ptr %1, i64 60
  %43 = load i32, ptr %42, align 4, !tbaa !20
  %44 = sub i32 %43, %38
  %45 = icmp slt i32 %44, 1
  br i1 %45, label %46, label %47

46:                                               ; preds = %41
  tail call void @NetbufFree(ptr noundef nonnull %1) #2
  br label %.loopexit

47:                                               ; preds = %41
  tail call void @TcpTrimSegment(ptr noundef nonnull %1, i32 noundef %38, i32 noundef %43)
  br label %48

48:                                               ; preds = %32, %47, %31
  %49 = getelementptr inbounds i8, ptr %1, i64 16
  %50 = tail call ptr @InsertHeadList(ptr noundef nonnull %.051, ptr noundef nonnull %49) #2
  %51 = getelementptr inbounds i8, ptr %0, i64 80
  %52 = load i32, ptr %51, align 8, !tbaa !21
  %53 = or i32 %52, 16384
  store i32 %53, ptr %51, align 8, !tbaa !21
  br i1 %.not54, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %48
  %54 = getelementptr inbounds i8, ptr %1, i64 60
  br label %55

55:                                               ; preds = %.lr.ph, %.backedge
  %.158 = phi ptr [ %.0, %.lr.ph ], [ %.1.be, %.backedge ]
  %56 = ptrtoint ptr %.158 to i64
  %57 = add i64 %56, -16
  %58 = inttoptr i64 %57 to ptr
  %59 = getelementptr inbounds i8, ptr %58, i64 60
  %60 = load i32, ptr %59, align 4, !tbaa !20
  %61 = load i32, ptr %54, align 4, !tbaa !20
  %62 = sub i32 %60, %61
  %63 = icmp slt i32 %62, 1
  br i1 %63, label %64, label %68

64:                                               ; preds = %55
  %65 = load ptr, ptr %.158, align 8, !tbaa !14
  %66 = getelementptr inbounds i8, ptr %58, i64 16
  %67 = tail call ptr @RemoveEntryList(ptr noundef nonnull %66) #2
  tail call void @NetbufFree(ptr noundef nonnull %58) #2
  br label %.backedge

.backedge:                                        ; preds = %64, %80
  %.1.be = phi ptr [ %65, %64 ], [ %81, %80 ]
  %.not56 = icmp eq ptr %.1.be, %17
  br i1 %.not56, label %.loopexit, label %55, !llvm.loop !25

68:                                               ; preds = %55
  %69 = getelementptr inbounds i8, ptr %58, i64 56
  %70 = load i32, ptr %69, align 8, !tbaa !15
  %71 = sub i32 %70, %61
  %72 = icmp slt i32 %71, 0
  br i1 %72, label %73, label %80

73:                                               ; preds = %68
  %74 = load i32, ptr %16, align 4, !tbaa !15
  %75 = sub i32 %70, %74
  %76 = icmp slt i32 %75, 1
  br i1 %76, label %77, label %79

77:                                               ; preds = %73
  %78 = tail call ptr @RemoveEntryList(ptr noundef nonnull %49) #2
  tail call void @NetbufFree(ptr noundef nonnull %1) #2
  br label %.loopexit

79:                                               ; preds = %73
  tail call void @TcpTrimSegment(ptr noundef nonnull %1, i32 noundef %74, i32 noundef %70)
  br label %.loopexit

80:                                               ; preds = %68
  %81 = load ptr, ptr %.158, align 8, !tbaa !14
  br label %.backedge

.loopexit:                                        ; preds = %.backedge, %48, %79, %77, %46, %19
  ret void
}

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

declare ptr @InsertHeadList(ptr noundef, ptr noundef) local_unnamed_addr #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !12, i64 40}
!6 = !{!"", !7, i64 0, !10, i64 8, !11, i64 16, !8, i64 32, !12, i64 40, !12, i64 48, !8, i64 56, !12, i64 120, !7, i64 128, !7, i64 132, !8, i64 136}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!"_LIST_ENTRY", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !10, i64 8}
!14 = !{!11, !12, i64 0}
!15 = !{!16, !7, i64 0}
!16 = !{!"_TCP_SEG", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 12, !17, i64 14, !7, i64 16}
!17 = !{!"short", !8, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!16, !7, i64 4}
!21 = !{!22, !7, i64 80}
!22 = !{!"_TCP_CB", !11, i64 0, !12, i64 16, !12, i64 24, !23, i64 32, !23, i64 40, !11, i64 48, !11, i64 64, !7, i64 80, !7, i64 84, !8, i64 88, !8, i64 89, !17, i64 90, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !17, i64 128, !7, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !17, i64 152, !17, i64 154, !8, i64 156, !7, i64 180, !7, i64 184, !7, i64 188, !8, i64 192, !8, i64 193, !8, i64 194, !7, i64 196, !7, i64 200, !7, i64 204, !7, i64 208, !7, i64 212, !7, i64 216, !7, i64 220, !7, i64 224, !7, i64 228, !7, i64 232, !17, i64 236, !8, i64 238, !8, i64 239, !7, i64 240, !7, i64 244, !7, i64 248, !8, i64 252, !8, i64 253, !17, i64 254, !7, i64 256, !7, i64 260, !7, i64 264, !8, i64 268, !8, i64 269, !8, i64 270, !24, i64 271, !12, i64 280}
!23 = !{!"_TCP_PEER", !7, i64 0, !17, i64 4}
!24 = !{!"", !8, i64 0}
!25 = distinct !{!25, !19}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass