; LLVM IR from whoiswelliton/Computer_Engineering_UTFPR-PB :: Embedded_Systems/TIVA Connected TM4C1294XL Projects/01 - lwIP_HTTPServer_on_TIVA (abandon)

; 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_pcb = type { %struct.ip4_addr, %struct.ip4_addr, i8, i8, i8, i8, ptr, ptr, i32, i8, i16, i16, i16, i8, i8, i8, i32, i32, i16, i16, i32, i16, i16, i32, i32, i16, i16, i16, i8, i8, i32, i16, i16, i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, i16, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i8, i8, i8, i8 }
%struct.ip4_addr = type { i32 }

@tcp_bound_pcbs = external dso_local global ptr, align 8
@tcp_active_pcbs = external dso_local global ptr, align 8
@tcp_tw_pcbs = external dso_local global ptr, align 8
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [178 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [49 x i8], align 1
@tcp_active_pcbs_changed = external dso_local global i8, align 1

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

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local void @tcp_abandon(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i16, align 2
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, 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
  br label %14

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

17:                                               ; preds = %14
  br label %18

18:                                               ; preds = %17
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.5, i32 noundef 573, ptr noundef @.str.2)
  br label %20

20:                                               ; preds = %18
  br label %21

21:                                               ; preds = %20
  store i32 1, ptr %9, align 4
  br label %164

22:                                               ; preds = %14
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.tcp_pcb, ptr %26, i32 0, i32 8
  %28 = load i32, ptr %27, align 8, !tbaa !11
  %29 = icmp ne i32 %28, 1
  br i1 %29, label %35, label %30

30:                                               ; preds = %25
  br label %31

31:                                               ; preds = %30
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.6, i32 noundef 577, ptr noundef @.str.2)
  br label %33

33:                                               ; preds = %31
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34, %25
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.tcp_pcb, ptr %38, i32 0, i32 8
  %40 = load i32, ptr %39, align 8, !tbaa !11
  %41 = icmp eq i32 %40, 10
  br i1 %41, label %42, label %45

42:                                               ; preds = %37
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  call void @tcp_pcb_remove(ptr noundef @tcp_tw_pcbs, ptr noundef %43)
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  call void @tcp_free(ptr noundef %44)
  br label %163

45:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #3
  store i16 0, ptr %11, align 2, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.tcp_pcb, ptr %46, i32 0, i32 34
  %48 = load i32, ptr %47, align 8, !tbaa !16
  store i32 %48, ptr %5, align 4, !tbaa !9
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.tcp_pcb, ptr %49, i32 0, i32 17
  %51 = load i32, ptr %50, align 4, !tbaa !17
  store i32 %51, ptr %6, align 4, !tbaa !9
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.tcp_pcb, ptr %52, i32 0, i32 52
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  store ptr %54, ptr %7, align 8, !tbaa !5
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.tcp_pcb, ptr %55, i32 0, i32 7
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  store ptr %57, ptr %8, align 8, !tbaa !5
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.tcp_pcb, ptr %58, i32 0, i32 8
  %60 = load i32, ptr %59, align 8, !tbaa !11
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %106

62:                                               ; preds = %45
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.tcp_pcb, ptr %63, i32 0, i32 10
  %65 = load i16, ptr %64, align 2, !tbaa !20
  %66 = zext i16 %65 to i32
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %105

68:                                               ; preds = %62
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr @tcp_bound_pcbs, align 8, !tbaa !5
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = icmp eq ptr %70, %71
  br i1 %72, label %73, label %77

73:                                               ; preds = %69
  %74 = load ptr, ptr @tcp_bound_pcbs, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.tcp_pcb, ptr %74, i32 0, i32 6
  %76 = load ptr, ptr %75, align 8, !tbaa !21
  store ptr %76, ptr @tcp_bound_pcbs, align 8, !tbaa !5
  br label %100

77:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %78 = load ptr, ptr @tcp_bound_pcbs, align 8, !tbaa !5
  store ptr %78, ptr %13, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %95, %77
  %80 = load ptr, ptr %13, align 8, !tbaa !5
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %99

82:                                               ; preds = %79
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.tcp_pcb, ptr %83, i32 0, i32 6
  %85 = load ptr, ptr %84, align 8, !tbaa !21
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = icmp eq ptr %85, %86
  br i1 %87, label %88, label %94

88:                                               ; preds = %82
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.tcp_pcb, ptr %89, i32 0, i32 6
  %91 = load ptr, ptr %90, align 8, !tbaa !21
  %92 = load ptr, ptr %13, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.tcp_pcb, ptr %92, i32 0, i32 6
  store ptr %91, ptr %93, align 8, !tbaa !21
  br label %99

94:                                               ; preds = %82
  br label %95

95:                                               ; preds = %94
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.tcp_pcb, ptr %96, i32 0, i32 6
  %98 = load ptr, ptr %97, align 8, !tbaa !21
  store ptr %98, ptr %13, align 8, !tbaa !5
  br label %79, !llvm.loop !22

99:                                               ; preds = %88, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %100

100:                                              ; preds = %99, %73
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.tcp_pcb, ptr %101, i32 0, i32 6
  store ptr null, ptr %102, align 8, !tbaa !21
  br label %103

103:                                              ; preds = %100
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104, %62
  br label %115

106:                                              ; preds = %45
  %107 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %107, ptr %10, align 4, !tbaa !9
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.tcp_pcb, ptr %108, i32 0, i32 10
  %110 = load i16, ptr %109, align 2, !tbaa !20
  store i16 %110, ptr %11, align 2, !tbaa !15
  br label %111

111:                                              ; preds = %106
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  call void @tcp_pcb_remove(ptr noundef @tcp_active_pcbs, ptr noundef %112)
  store i8 1, ptr @tcp_active_pcbs_changed, align 1, !tbaa !24
  br label %113

113:                                              ; preds = %111
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114, %105
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.tcp_pcb, ptr %116, i32 0, i32 45
  %118 = load ptr, ptr %117, align 8, !tbaa !25
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %124

120:                                              ; preds = %115
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.tcp_pcb, ptr %121, i32 0, i32 45
  %123 = load ptr, ptr %122, align 8, !tbaa !25
  call void @tcp_segs_free(ptr noundef %123)
  br label %124

124:                                              ; preds = %120, %115
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.tcp_pcb, ptr %125, i32 0, i32 44
  %127 = load ptr, ptr %126, align 8, !tbaa !26
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %133

129:                                              ; preds = %124
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.tcp_pcb, ptr %130, i32 0, i32 44
  %132 = load ptr, ptr %131, align 8, !tbaa !26
  call void @tcp_segs_free(ptr noundef %132)
  br label %133

133:                                              ; preds = %129, %124
  %134 = load i32, ptr %10, align 4, !tbaa !9
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %148

136:                                              ; preds = %133
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = load i32, ptr %5, align 4, !tbaa !9
  %139 = load i32, ptr %6, align 4, !tbaa !9
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.tcp_pcb, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.tcp_pcb, ptr %142, i32 0, i32 1
  %144 = load i16, ptr %11, align 2, !tbaa !15
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.tcp_pcb, ptr %145, i32 0, i32 11
  %147 = load i16, ptr %146, align 8, !tbaa !27
  call void @tcp_rst(ptr noundef %137, i32 noundef %138, i32 noundef %139, ptr noundef %141, ptr noundef %143, i16 noundef zeroext %144, i16 noundef zeroext %147)
  br label %148

148:                                              ; preds = %136, %133
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.tcp_pcb, ptr %149, i32 0, i32 8
  %151 = load i32, ptr %150, align 8, !tbaa !11
  store i32 %151, ptr %12, align 4, !tbaa !9
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  call void @tcp_free(ptr noundef %152)
  br label %153

153:                                              ; preds = %148
  %154 = load i32, ptr %12, align 4, !tbaa !9
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = icmp ne ptr %155, null
  br i1 %156, label %157, label %160

157:                                              ; preds = %153
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = load ptr, ptr %8, align 8, !tbaa !5
  call void %158(ptr noundef %159, i8 noundef signext -13)
  br label %160

160:                                              ; preds = %157, %153
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %163

163:                                              ; preds = %162, %42
  store i32 0, ptr %9, align 4
  br label %164

164:                                              ; preds = %163, %21
  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 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  %165 = load i32, ptr %9, align 4
  switch i32 %165, label %167 [
    i32 0, label %166
    i32 1, label %166
  ]

166:                                              ; preds = %164, %164
  ret void

167:                                              ; preds = %164
  unreachable
}

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

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

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

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

declare void @tcp_rst(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i16 noundef zeroext, i16 noundef zeroext) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 32}
!12 = !{!"tcp_pcb", !13, i64 0, !13, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !6, i64 16, !6, i64 24, !10, i64 32, !7, i64 36, !14, i64 38, !14, i64 40, !14, i64 42, !7, i64 44, !7, i64 45, !7, i64 46, !10, i64 48, !10, i64 52, !14, i64 56, !14, i64 58, !10, i64 60, !14, i64 64, !14, i64 66, !10, i64 68, !10, i64 72, !14, i64 76, !14, i64 78, !14, i64 80, !7, i64 82, !7, i64 83, !10, i64 84, !14, i64 88, !14, i64 90, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !14, i64 112, !14, i64 114, !14, i64 116, !14, i64 118, !14, i64 120, !14, i64 122, !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, !10, i64 200, !7, i64 204, !7, i64 205, !7, i64 206, !7, i64 207}
!13 = !{!"ip4_addr", !10, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!14, !14, i64 0}
!16 = !{!12, !10, i64 96}
!17 = !{!12, !10, i64 52}
!18 = !{!12, !6, i64 192}
!19 = !{!12, !6, i64 24}
!20 = !{!12, !14, i64 38}
!21 = !{!12, !6, i64 16}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!7, !7, i64 0}
!25 = !{!12, !6, i64 136}
!26 = !{!12, !6, i64 128}
!27 = !{!12, !14, 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"

@tcp_bound_pcbs = external dso_local local_unnamed_addr global ptr, align 8
@tcp_active_pcbs = external dso_local global ptr, align 8
@tcp_tw_pcbs = external dso_local global ptr, align 8
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [178 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [49 x i8], align 1
@tcp_active_pcbs_changed = external dso_local local_unnamed_addr global i8, align 1

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @tcp_abandon(ptr noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %3, label %5

3:                                                ; preds = %2
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.5, i32 noundef 573, ptr noundef nonnull @.str.2)
  br label %56

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %.not48 = icmp eq i32 %7, 1
  br i1 %.not48, label %8, label %10

8:                                                ; preds = %5
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.6, i32 noundef 577, ptr noundef nonnull @.str.2)
  %.pr = load i32, ptr %6, align 8, !tbaa !5
  br label %10

10:                                               ; preds = %8, %5
  %11 = phi i32 [ %.pr, %8 ], [ %7, %5 ]
  %12 = icmp eq i32 %11, 10
  br i1 %12, label %13, label %14

13:                                               ; preds = %10
  tail call void @tcp_pcb_remove(ptr noundef nonnull @tcp_tw_pcbs, ptr noundef nonnull %0)
  tail call void @tcp_free(ptr noundef nonnull %0)
  br label %56

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 96
  %16 = load i32, ptr %15, align 8, !tbaa !13
  %17 = getelementptr inbounds i8, ptr %0, i64 52
  %18 = load i32, ptr %17, align 4, !tbaa !14
  %19 = getelementptr inbounds i8, ptr %0, i64 192
  %20 = load ptr, ptr %19, align 8, !tbaa !15
  %21 = getelementptr inbounds i8, ptr %0, i64 24
  %22 = load ptr, ptr %21, align 8, !tbaa !16
  %23 = icmp eq i32 %11, 0
  %24 = getelementptr inbounds i8, ptr %0, i64 38
  %25 = load i16, ptr %24, align 2, !tbaa !17
  br i1 %23, label %26, label %39

26:                                               ; preds = %14
  %.not49 = icmp eq i16 %25, 0
  br i1 %.not49, label %41, label %27

27:                                               ; preds = %26
  %28 = load ptr, ptr @tcp_bound_pcbs, align 8, !tbaa !18
  %29 = icmp eq ptr %28, %0
  br i1 %29, label %.loopexit.sink.split, label %.preheader

.preheader:                                       ; preds = %27, %30
  %.0 = phi ptr [ %32, %30 ], [ %28, %27 ]
  %.not50 = icmp eq ptr %.0, null
  br i1 %.not50, label %.loopexit, label %30

30:                                               ; preds = %.preheader
  %31 = getelementptr inbounds i8, ptr %.0, i64 16
  %32 = load ptr, ptr %31, align 8, !tbaa !19
  %33 = icmp eq ptr %32, %0
  br i1 %33, label %34, label %.preheader, !llvm.loop !20

34:                                               ; preds = %30
  %35 = getelementptr inbounds i8, ptr %.0, i64 16
  br label %.loopexit.sink.split

.loopexit.sink.split:                             ; preds = %27, %34
  %.sink = phi ptr [ %0, %34 ], [ %28, %27 ]
  %.sink56 = phi ptr [ %35, %34 ], [ @tcp_bound_pcbs, %27 ]
  %36 = getelementptr inbounds i8, ptr %.sink, i64 16
  %37 = load ptr, ptr %36, align 8, !tbaa !19
  store ptr %37, ptr %.sink56, align 8, !tbaa !18
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %.loopexit.sink.split
  %38 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr null, ptr %38, align 8, !tbaa !19
  br label %41

39:                                               ; preds = %14
  tail call void @tcp_pcb_remove(ptr noundef nonnull @tcp_active_pcbs, ptr noundef nonnull %0)
  store i8 1, ptr @tcp_active_pcbs_changed, align 1, !tbaa !22
  %40 = icmp eq i32 %1, 0
  br label %41

41:                                               ; preds = %26, %.loopexit, %39
  %.040 = phi i1 [ true, %.loopexit ], [ true, %26 ], [ %40, %39 ]
  %.039 = phi i16 [ 0, %.loopexit ], [ 0, %26 ], [ %25, %39 ]
  %42 = getelementptr inbounds i8, ptr %0, i64 136
  %43 = load ptr, ptr %42, align 8, !tbaa !23
  %.not51 = icmp eq ptr %43, null
  br i1 %.not51, label %45, label %44

44:                                               ; preds = %41
  tail call void @tcp_segs_free(ptr noundef nonnull %43)
  br label %45

45:                                               ; preds = %44, %41
  %46 = getelementptr inbounds i8, ptr %0, i64 128
  %47 = load ptr, ptr %46, align 8, !tbaa !24
  %.not52 = icmp eq ptr %47, null
  br i1 %.not52, label %49, label %48

48:                                               ; preds = %45
  tail call void @tcp_segs_free(ptr noundef nonnull %47)
  br label %49

49:                                               ; preds = %48, %45
  br i1 %.040, label %54, label %50

50:                                               ; preds = %49
  %51 = getelementptr inbounds i8, ptr %0, i64 4
  %52 = getelementptr inbounds i8, ptr %0, i64 40
  %53 = load i16, ptr %52, align 8, !tbaa !25
  tail call void @tcp_rst(ptr noundef nonnull %0, i32 noundef %16, i32 noundef %18, ptr noundef nonnull %0, ptr noundef nonnull %51, i16 noundef zeroext %.039, i16 noundef zeroext %53) #3
  br label %54

54:                                               ; preds = %50, %49
  tail call void @tcp_free(ptr noundef nonnull %0)
  %.not54 = icmp eq ptr %20, null
  br i1 %.not54, label %56, label %55

55:                                               ; preds = %54
  tail call void %20(ptr noundef %22, i8 noundef signext -13) #3
  br label %56

56:                                               ; preds = %13, %55, %54, %3
  ret void
}

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

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

declare void @tcp_rst(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i16 noundef zeroext, i16 noundef zeroext) 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 = { nofree nounwind "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, !8, i64 32}
!6 = !{!"tcp_pcb", !7, i64 0, !7, i64 4, !9, i64 8, !9, i64 9, !9, i64 10, !9, i64 11, !11, i64 16, !11, i64 24, !8, i64 32, !9, i64 36, !12, i64 38, !12, i64 40, !12, i64 42, !9, i64 44, !9, i64 45, !9, i64 46, !8, i64 48, !8, i64 52, !12, i64 56, !12, i64 58, !8, i64 60, !12, i64 64, !12, i64 66, !8, i64 68, !8, i64 72, !12, i64 76, !12, i64 78, !12, i64 80, !9, i64 82, !9, i64 83, !8, i64 84, !12, i64 88, !12, i64 90, !8, i64 92, !8, i64 96, !8, i64 100, !8, i64 104, !8, i64 108, !12, i64 112, !12, i64 114, !12, i64 116, !12, i64 118, !12, i64 120, !12, i64 122, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !8, i64 200, !9, i64 204, !9, i64 205, !9, i64 206, !9, i64 207}
!7 = !{!"ip4_addr", !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"short", !9, i64 0}
!13 = !{!6, !8, i64 96}
!14 = !{!6, !8, i64 52}
!15 = !{!6, !11, i64 192}
!16 = !{!6, !11, i64 24}
!17 = !{!6, !12, i64 38}
!18 = !{!11, !11, i64 0}
!19 = !{!6, !11, i64 16}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!9, !9, i64 0}
!23 = !{!6, !11, i64 136}
!24 = !{!6, !11, i64 128}
!25 = !{!6, !12, i64 40}


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