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

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

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

@tcp_listen_pcbs = external dso_local global %union.tcp_listen_pcbs_t, align 8
@tcp_bound_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.9 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [55 x i8], align 1

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

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

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

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

declare void @tcp_timer_needed() #1

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

11:                                               ; preds = %3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %19, label %14

14:                                               ; preds = %11
  br label %15

15:                                               ; preds = %14
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.9, i32 noundef 857, ptr noundef @.str.2)
  br label %17

17:                                               ; preds = %15
  br label %18

18:                                               ; preds = %17
  store i8 -16, ptr %8, align 1, !tbaa !9
  br label %180

19:                                               ; preds = %11
  br label %20

20:                                               ; preds = %19
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.tcp_pcb, ptr %23, i32 0, i32 8
  %25 = load i32, ptr %24, align 8, !tbaa !10
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %32, label %27

27:                                               ; preds = %22
  br label %28

28:                                               ; preds = %27
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.10, i32 noundef 858, ptr noundef @.str.2)
  br label %30

30:                                               ; preds = %28
  br label %31

31:                                               ; preds = %30
  store i8 -15, ptr %8, align 1, !tbaa !9
  br label %180

32:                                               ; preds = %22
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.tcp_pcb, ptr %35, i32 0, i32 8
  %37 = load i32, ptr %36, align 8, !tbaa !10
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %39, label %41

39:                                               ; preds = %34
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %40, ptr %7, align 8, !tbaa !5
  store i8 -9, ptr %8, align 1, !tbaa !9
  br label %180

41:                                               ; preds = %34
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.tcp_pcb, ptr %42, i32 0, i32 3
  %44 = load i8, ptr %43, align 1, !tbaa !15
  %45 = zext i8 %44 to i32
  %46 = and i32 %45, 4
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %80

48:                                               ; preds = %41
  %49 = load ptr, ptr @tcp_listen_pcbs, align 8, !tbaa !9
  store ptr %49, ptr %7, align 8, !tbaa !5
  br label %50

50:                                               ; preds = %75, %48
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %79

53:                                               ; preds = %50
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %54, i32 0, i32 10
  %56 = load i16, ptr %55, align 2, !tbaa !16
  %57 = zext i16 %56 to i32
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.tcp_pcb, ptr %58, i32 0, i32 10
  %60 = load i16, ptr %59, align 2, !tbaa !18
  %61 = zext i16 %60 to i32
  %62 = icmp eq i32 %57, %61
  br i1 %62, label %63, label %74

63:                                               ; preds = %53
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds %struct.ip4_addr, ptr %65, i32 0, i32 0
  %67 = load i32, ptr %66, align 8, !tbaa !19
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.tcp_pcb, ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds %struct.ip4_addr, ptr %69, i32 0, i32 0
  %71 = load i32, ptr %70, align 8, !tbaa !20
  %72 = icmp eq i32 %67, %71
  br i1 %72, label %73, label %74

73:                                               ; preds = %63
  store ptr null, ptr %7, align 8, !tbaa !5
  store i8 -8, ptr %8, align 1, !tbaa !9
  br label %180

74:                                               ; preds = %63, %53
  br label %75

75:                                               ; preds = %74
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %76, i32 0, i32 6
  %78 = load ptr, ptr %77, align 8, !tbaa !21
  store ptr %78, ptr %7, align 8, !tbaa !5
  br label %50, !llvm.loop !22

79:                                               ; preds = %50
  br label %80

80:                                               ; preds = %79, %41
  %81 = call ptr @memp_malloc(i32 noundef 2)
  store ptr %81, ptr %7, align 8, !tbaa !5
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = icmp eq ptr %82, null
  br i1 %83, label %84, label %85

84:                                               ; preds = %80
  store i8 -1, ptr %8, align 1, !tbaa !9
  br label %180

85:                                               ; preds = %80
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.tcp_pcb, ptr %86, i32 0, i32 7
  %88 = load ptr, ptr %87, align 8, !tbaa !24
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %89, i32 0, i32 7
  store ptr %88, ptr %90, align 8, !tbaa !25
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.tcp_pcb, ptr %91, i32 0, i32 10
  %93 = load i16, ptr %92, align 2, !tbaa !18
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %94, i32 0, i32 10
  store i16 %93, ptr %95, align 2, !tbaa !16
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %96, i32 0, i32 8
  store i32 1, ptr %97, align 8, !tbaa !26
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.tcp_pcb, ptr %98, i32 0, i32 9
  %100 = load i8, ptr %99, align 4, !tbaa !27
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %101, i32 0, i32 9
  store i8 %100, ptr %102, align 4, !tbaa !28
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.tcp_pcb, ptr %103, i32 0, i32 3
  %105 = load i8, ptr %104, align 1, !tbaa !15
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %106, i32 0, i32 3
  store i8 %105, ptr %107, align 1, !tbaa !29
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %108, i32 0, i32 2
  store i8 0, ptr %109, align 8, !tbaa !30
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.tcp_pcb, ptr %110, i32 0, i32 5
  %112 = load i8, ptr %111, align 1, !tbaa !31
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %113, i32 0, i32 5
  store i8 %112, ptr %114, align 1, !tbaa !32
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.tcp_pcb, ptr %115, i32 0, i32 4
  %117 = load i8, ptr %116, align 2, !tbaa !33
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %118, i32 0, i32 4
  store i8 %117, ptr %119, align 2, !tbaa !34
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.tcp_pcb, ptr %120, i32 0, i32 0
  %122 = getelementptr inbounds %struct.ip4_addr, ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 8, !tbaa !20
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds %struct.ip4_addr, ptr %125, i32 0, i32 0
  store i32 %123, ptr %126, align 8, !tbaa !19
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.tcp_pcb, ptr %127, i32 0, i32 10
  %129 = load i16, ptr %128, align 2, !tbaa !18
  %130 = zext i16 %129 to i32
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %169

132:                                              ; preds = %85
  br label %133

133:                                              ; preds = %132
  %134 = load ptr, ptr @tcp_bound_pcbs, align 8, !tbaa !5
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = icmp eq ptr %134, %135
  br i1 %136, label %137, label %141

137:                                              ; preds = %133
  %138 = load ptr, ptr @tcp_bound_pcbs, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.tcp_pcb, ptr %138, i32 0, i32 6
  %140 = load ptr, ptr %139, align 8, !tbaa !35
  store ptr %140, ptr @tcp_bound_pcbs, align 8, !tbaa !5
  br label %164

141:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %142 = load ptr, ptr @tcp_bound_pcbs, align 8, !tbaa !5
  store ptr %142, ptr %9, align 8, !tbaa !5
  br label %143

143:                                              ; preds = %159, %141
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = icmp ne ptr %144, null
  br i1 %145, label %146, label %163

146:                                              ; preds = %143
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.tcp_pcb, ptr %147, i32 0, i32 6
  %149 = load ptr, ptr %148, align 8, !tbaa !35
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = icmp eq ptr %149, %150
  br i1 %151, label %152, label %158

152:                                              ; preds = %146
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.tcp_pcb, ptr %153, i32 0, i32 6
  %155 = load ptr, ptr %154, align 8, !tbaa !35
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.tcp_pcb, ptr %156, i32 0, i32 6
  store ptr %155, ptr %157, align 8, !tbaa !35
  br label %163

158:                                              ; preds = %146
  br label %159

159:                                              ; preds = %158
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.tcp_pcb, ptr %160, i32 0, i32 6
  %162 = load ptr, ptr %161, align 8, !tbaa !35
  store ptr %162, ptr %9, align 8, !tbaa !5
  br label %143, !llvm.loop !36

163:                                              ; preds = %152, %143
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %164

164:                                              ; preds = %163, %137
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.tcp_pcb, ptr %165, i32 0, i32 6
  store ptr null, ptr %166, align 8, !tbaa !35
  br label %167

167:                                              ; preds = %164
  br label %168

168:                                              ; preds = %167
  br label %169

169:                                              ; preds = %168, %85
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  call void @tcp_free(ptr noundef %170)
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.tcp_pcb_listen, ptr %171, i32 0, i32 11
  store ptr @tcp_accept_null, ptr %172, align 8, !tbaa !37
  br label %173

173:                                              ; preds = %169
  %174 = load ptr, ptr @tcp_listen_pcbs, align 8, !tbaa !9
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.tcp_pcb, ptr %175, i32 0, i32 6
  store ptr %174, ptr %176, align 8, !tbaa !35
  %177 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %177, ptr @tcp_listen_pcbs, align 8, !tbaa !9
  call void @tcp_timer_needed()
  br label %178

178:                                              ; preds = %173
  br label %179

179:                                              ; preds = %178
  store i8 0, ptr %8, align 1, !tbaa !9
  br label %180

180:                                              ; preds = %179, %84, %73, %39, %31, %18
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = icmp ne ptr %181, null
  br i1 %182, label %183, label %186

183:                                              ; preds = %180
  %184 = load i8, ptr %8, align 1, !tbaa !9
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  store i8 %184, ptr %185, align 1, !tbaa !9
  br label %186

186:                                              ; preds = %183, %180
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret ptr %187
}

declare ptr @memp_malloc(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden signext i8 @tcp_accept_null(ptr noundef, ptr noundef, i8 noundef signext) #0

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 = !{!7, !7, i64 0}
!10 = !{!11, !13, i64 32}
!11 = !{!"tcp_pcb", !12, i64 0, !12, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !6, i64 16, !6, i64 24, !13, i64 32, !7, i64 36, !14, i64 38, !14, i64 40, !14, i64 42, !7, i64 44, !7, i64 45, !7, i64 46, !13, i64 48, !13, i64 52, !14, i64 56, !14, i64 58, !13, i64 60, !14, i64 64, !14, i64 66, !13, i64 68, !13, i64 72, !14, i64 76, !14, i64 78, !14, i64 80, !7, i64 82, !7, i64 83, !13, i64 84, !14, i64 88, !14, i64 90, !13, i64 92, !13, i64 96, !13, i64 100, !13, i64 104, !13, 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, !13, i64 200, !7, i64 204, !7, i64 205, !7, i64 206, !7, i64 207}
!12 = !{!"ip4_addr", !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!11, !7, i64 9}
!16 = !{!17, !14, i64 38}
!17 = !{!"tcp_pcb_listen", !12, i64 0, !12, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !6, i64 16, !6, i64 24, !13, i64 32, !7, i64 36, !14, i64 38, !6, i64 40}
!18 = !{!11, !14, i64 38}
!19 = !{!17, !13, i64 0}
!20 = !{!11, !13, i64 0}
!21 = !{!17, !6, i64 16}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!11, !6, i64 24}
!25 = !{!17, !6, i64 24}
!26 = !{!17, !13, i64 32}
!27 = !{!11, !7, i64 36}
!28 = !{!17, !7, i64 36}
!29 = !{!17, !7, i64 9}
!30 = !{!17, !7, i64 8}
!31 = !{!11, !7, i64 11}
!32 = !{!17, !7, i64 11}
!33 = !{!11, !7, i64 10}
!34 = !{!17, !7, i64 10}
!35 = !{!11, !6, i64 16}
!36 = distinct !{!36, !23}
!37 = !{!17, !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"

%union.tcp_listen_pcbs_t = type { ptr }

@tcp_listen_pcbs = external dso_local local_unnamed_addr global %union.tcp_listen_pcbs_t, align 8
@tcp_bound_pcbs = external dso_local local_unnamed_addr 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.9 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [55 x 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

declare void @tcp_timer_needed() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local ptr @tcp_listen_with_backlog_and_err(ptr noundef %0, i8 noundef zeroext %1, ptr noundef writeonly %2) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %6

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

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

10:                                               ; preds = %6
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.10, i32 noundef 858, ptr noundef nonnull @.str.2)
  br label %.loopexit61

12:                                               ; preds = %6
  %13 = getelementptr inbounds i8, ptr %0, i64 9
  %14 = load i8, ptr %13, align 1, !tbaa !13
  %15 = and i8 %14, 4
  %.not54 = icmp eq i8 %15, 0
  br i1 %.not54, label %.loopexit60, label %.preheader59

.preheader59:                                     ; preds = %12
  %.04662 = load ptr, ptr @tcp_listen_pcbs, align 8, !tbaa !14
  %.not5563 = icmp eq ptr %.04662, null
  br i1 %.not5563, label %.loopexit60, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader59
  %16 = getelementptr inbounds i8, ptr %0, i64 38
  %17 = load i16, ptr %16, align 2, !tbaa !15
  br label %18

18:                                               ; preds = %.lr.ph, %26
  %.04664 = phi ptr [ %.04662, %.lr.ph ], [ %.046, %26 ]
  %19 = getelementptr inbounds i8, ptr %.04664, i64 38
  %20 = load i16, ptr %19, align 2, !tbaa !16
  %21 = icmp eq i16 %20, %17
  br i1 %21, label %22, label %26

22:                                               ; preds = %18
  %23 = load i32, ptr %.04664, align 8, !tbaa !18
  %24 = load i32, ptr %0, align 8, !tbaa !19
  %25 = icmp eq i32 %23, %24
  br i1 %25, label %.loopexit61, label %26

26:                                               ; preds = %18, %22
  %27 = getelementptr inbounds i8, ptr %.04664, i64 16
  %.046 = load ptr, ptr %27, align 8, !tbaa !14
  %.not55 = icmp eq ptr %.046, null
  br i1 %.not55, label %.loopexit60, label %18, !llvm.loop !20

.loopexit60:                                      ; preds = %26, %.preheader59, %12
  %28 = tail call ptr @memp_malloc(i32 noundef 2) #3
  %29 = icmp eq ptr %28, null
  br i1 %29, label %.loopexit61, label %30

30:                                               ; preds = %.loopexit60
  %31 = getelementptr inbounds i8, ptr %0, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !22
  %33 = getelementptr inbounds i8, ptr %28, i64 24
  store ptr %32, ptr %33, align 8, !tbaa !23
  %34 = getelementptr inbounds i8, ptr %0, i64 38
  %35 = load i16, ptr %34, align 2, !tbaa !15
  %36 = getelementptr inbounds i8, ptr %28, i64 38
  store i16 %35, ptr %36, align 2, !tbaa !16
  %37 = getelementptr inbounds i8, ptr %28, i64 32
  store i32 1, ptr %37, align 8, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %0, i64 36
  %39 = load i8, ptr %38, align 4, !tbaa !25
  %40 = getelementptr inbounds i8, ptr %28, i64 36
  store i8 %39, ptr %40, align 4, !tbaa !26
  %41 = load i8, ptr %13, align 1, !tbaa !13
  %42 = getelementptr inbounds i8, ptr %28, i64 9
  store i8 %41, ptr %42, align 1, !tbaa !27
  %43 = getelementptr inbounds i8, ptr %28, i64 8
  store i8 0, ptr %43, align 8, !tbaa !28
  %44 = getelementptr inbounds i8, ptr %0, i64 11
  %45 = load i8, ptr %44, align 1, !tbaa !29
  %46 = getelementptr inbounds i8, ptr %28, i64 11
  store i8 %45, ptr %46, align 1, !tbaa !30
  %47 = getelementptr inbounds i8, ptr %0, i64 10
  %48 = load i8, ptr %47, align 2, !tbaa !31
  %49 = getelementptr inbounds i8, ptr %28, i64 10
  store i8 %48, ptr %49, align 2, !tbaa !32
  %50 = load i32, ptr %0, align 8, !tbaa !19
  store i32 %50, ptr %28, align 8, !tbaa !18
  %.not56 = icmp eq i16 %35, 0
  br i1 %.not56, label %63, label %51

51:                                               ; preds = %30
  %52 = load ptr, ptr @tcp_bound_pcbs, align 8, !tbaa !33
  %53 = icmp eq ptr %52, %0
  br i1 %53, label %.loopexit.sink.split, label %.preheader

.preheader:                                       ; preds = %51, %54
  %.0 = phi ptr [ %56, %54 ], [ %52, %51 ]
  %.not57 = icmp eq ptr %.0, null
  br i1 %.not57, label %.loopexit, label %54

54:                                               ; preds = %.preheader
  %55 = getelementptr inbounds i8, ptr %.0, i64 16
  %56 = load ptr, ptr %55, align 8, !tbaa !34
  %57 = icmp eq ptr %56, %0
  br i1 %57, label %58, label %.preheader, !llvm.loop !35

58:                                               ; preds = %54
  %59 = getelementptr inbounds i8, ptr %.0, i64 16
  br label %.loopexit.sink.split

.loopexit.sink.split:                             ; preds = %51, %58
  %.sink = phi ptr [ %0, %58 ], [ %52, %51 ]
  %.sink66 = phi ptr [ %59, %58 ], [ @tcp_bound_pcbs, %51 ]
  %60 = getelementptr inbounds i8, ptr %.sink, i64 16
  %61 = load ptr, ptr %60, align 8, !tbaa !34
  store ptr %61, ptr %.sink66, align 8, !tbaa !33
  br label %.loopexit

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

63:                                               ; preds = %.loopexit, %30
  tail call void @tcp_free(ptr noundef nonnull %0)
  %64 = getelementptr inbounds i8, ptr %28, i64 40
  store ptr @tcp_accept_null, ptr %64, align 8, !tbaa !36
  %65 = load ptr, ptr @tcp_listen_pcbs, align 8, !tbaa !14
  %66 = getelementptr inbounds i8, ptr %28, i64 16
  store ptr %65, ptr %66, align 8, !tbaa !34
  store ptr %28, ptr @tcp_listen_pcbs, align 8, !tbaa !14
  tail call void @tcp_timer_needed() #3
  br label %.loopexit61

.loopexit61:                                      ; preds = %22, %.loopexit60, %63, %10, %4
  %.1 = phi ptr [ %28, %63 ], [ null, %10 ], [ null, %4 ], [ null, %.loopexit60 ], [ null, %22 ]
  %.045 = phi i8 [ 0, %63 ], [ -15, %10 ], [ -16, %4 ], [ -1, %.loopexit60 ], [ -8, %22 ]
  %.not58 = icmp eq ptr %2, null
  br i1 %.not58, label %68, label %67

67:                                               ; preds = %.loopexit61
  store i8 %.045, ptr %2, align 1, !tbaa !14
  br label %68

68:                                               ; preds = %67, %.loopexit61
  ret ptr %.1
}

declare ptr @memp_malloc(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden signext i8 @tcp_accept_null(ptr noundef, ptr noundef, i8 noundef signext) #0

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, !9, i64 9}
!14 = !{!9, !9, i64 0}
!15 = !{!6, !12, i64 38}
!16 = !{!17, !12, i64 38}
!17 = !{!"tcp_pcb_listen", !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, !11, i64 40}
!18 = !{!17, !8, i64 0}
!19 = !{!6, !8, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!6, !11, i64 24}
!23 = !{!17, !11, i64 24}
!24 = !{!17, !8, i64 32}
!25 = !{!6, !9, i64 36}
!26 = !{!17, !9, i64 36}
!27 = !{!17, !9, i64 9}
!28 = !{!17, !9, i64 8}
!29 = !{!6, !9, i64 11}
!30 = !{!17, !9, i64 11}
!31 = !{!6, !9, i64 10}
!32 = !{!17, !9, i64 10}
!33 = !{!11, !11, i64 0}
!34 = !{!6, !11, i64 16}
!35 = distinct !{!35, !21}
!36 = !{!17, !11, i64 40}


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