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

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

@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [182 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [40 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

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

declare zeroext i16 @pbuf_clen(ptr noundef) #1

declare ptr @pbuf_alloc(i32 noundef, i16 noundef zeroext, i32 noundef) #1

; 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 hidden ptr @tcp_create_segment(ptr noundef, ptr noundef, i8 noundef zeroext, i32 noundef, i8 noundef zeroext) #2

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

12:                                               ; preds = %2
  %13 = load i8, ptr %5, align 1, !tbaa !9
  %14 = zext i8 %13 to i32
  %15 = and i32 %14, 3
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %22, label %17

17:                                               ; preds = %12
  br label %18

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

20:                                               ; preds = %18
  br label %21

21:                                               ; preds = %20
  br label %22

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

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %33, label %28

28:                                               ; preds = %25
  br label %29

29:                                               ; preds = %28
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.22, i32 noundef 1043, ptr noundef @.str.2)
  br label %31

31:                                               ; preds = %29
  br label %32

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32, %25
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34
  %36 = load i8, ptr %5, align 1, !tbaa !9
  %37 = zext i8 %36 to i32
  %38 = and i32 %37, 2
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %35
  store i8 1, ptr %8, align 1, !tbaa !9
  br label %41

41:                                               ; preds = %40, %35
  %42 = load i8, ptr %8, align 1, !tbaa !9
  %43 = zext i8 %42 to i32
  %44 = and i32 %43, 1
  %45 = icmp ne i32 %44, 0
  %46 = zext i1 %45 to i64
  %47 = select i1 %45, i32 4, i32 0
  %48 = load i8, ptr %8, align 1, !tbaa !9
  %49 = zext i8 %48 to i32
  %50 = and i32 %49, 2
  %51 = icmp ne i32 %50, 0
  %52 = zext i1 %51 to i64
  %53 = select i1 %51, i32 0, i32 0
  %54 = add nsw i32 %47, %53
  %55 = load i8, ptr %8, align 1, !tbaa !9
  %56 = zext i8 %55 to i32
  %57 = and i32 %56, 8
  %58 = icmp ne i32 %57, 0
  %59 = zext i1 %58 to i64
  %60 = select i1 %58, i32 0, i32 0
  %61 = add nsw i32 %54, %60
  %62 = load i8, ptr %8, align 1, !tbaa !9
  %63 = zext i8 %62 to i32
  %64 = and i32 %63, 16
  %65 = icmp ne i32 %64, 0
  %66 = zext i1 %65 to i64
  %67 = select i1 %65, i32 0, i32 0
  %68 = add nsw i32 %61, %67
  %69 = trunc i32 %68 to i8
  store i8 %69, ptr %9, align 1, !tbaa !9
  %70 = load i8, ptr %9, align 1, !tbaa !9
  %71 = zext i8 %70 to i16
  %72 = call ptr @pbuf_alloc(i32 noundef 56, i16 noundef zeroext %71, i32 noundef 640)
  store ptr %72, ptr %6, align 8, !tbaa !5
  %73 = icmp eq ptr %72, null
  br i1 %73, label %74, label %86

74:                                               ; preds = %41
  br label %75

75:                                               ; preds = %74
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.tcp_pcb, ptr %76, i32 0, i32 12
  %78 = load i16, ptr %77, align 2, !tbaa !10
  %79 = zext i16 %78 to i32
  %80 = or i32 %79, 128
  %81 = trunc i32 %80 to i16
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.tcp_pcb, ptr %82, i32 0, i32 12
  store i16 %81, ptr %83, align 2, !tbaa !10
  br label %84

84:                                               ; preds = %75
  br label %85

85:                                               ; preds = %84
  store i8 -1, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %251

86:                                               ; preds = %41
  br label %87

87:                                               ; preds = %86
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.pbuf, ptr %88, i32 0, i32 3
  %90 = load i16, ptr %89, align 2, !tbaa !15
  %91 = zext i16 %90 to i32
  %92 = load i8, ptr %9, align 1, !tbaa !9
  %93 = zext i8 %92 to i32
  %94 = icmp sge i32 %91, %93
  br i1 %94, label %100, label %95

95:                                               ; preds = %87
  br label %96

96:                                               ; preds = %95
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.23, i32 noundef 1082, ptr noundef @.str.2)
  br label %98

98:                                               ; preds = %96
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99, %87
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = load i8, ptr %5, align 1, !tbaa !9
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.tcp_pcb, ptr %106, i32 0, i32 37
  %108 = load i32, ptr %107, align 4, !tbaa !17
  %109 = load i8, ptr %8, align 1, !tbaa !9
  %110 = call ptr @tcp_create_segment(ptr noundef %103, ptr noundef %104, i8 noundef zeroext %105, i32 noundef %108, i8 noundef zeroext %109)
  store ptr %110, ptr %7, align 8, !tbaa !5
  %111 = icmp eq ptr %110, null
  br i1 %111, label %112, label %124

112:                                              ; preds = %102
  br label %113

113:                                              ; preds = %112
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.tcp_pcb, ptr %114, i32 0, i32 12
  %116 = load i16, ptr %115, align 2, !tbaa !10
  %117 = zext i16 %116 to i32
  %118 = or i32 %117, 128
  %119 = trunc i32 %118 to i16
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.tcp_pcb, ptr %120, i32 0, i32 12
  store i16 %119, ptr %121, align 2, !tbaa !10
  br label %122

122:                                              ; preds = %113
  br label %123

123:                                              ; preds = %122
  store i8 -1, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %251

124:                                              ; preds = %102
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.tcp_seg, ptr %126, i32 0, i32 4
  %128 = load ptr, ptr %127, align 8, !tbaa !18
  %129 = ptrtoint ptr %128 to i64
  %130 = urem i64 %129, 4
  %131 = icmp eq i64 %130, 0
  br i1 %131, label %137, label %132

132:                                              ; preds = %125
  br label %133

133:                                              ; preds = %132
  %134 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.24, i32 noundef 1090, ptr noundef @.str.2)
  br label %135

135:                                              ; preds = %133
  br label %136

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136, %125
  br label %138

138:                                              ; preds = %137
  br label %139

139:                                              ; preds = %138
  br label %140

140:                                              ; preds = %139
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.tcp_seg, ptr %141, i32 0, i32 2
  %143 = load i16, ptr %142, align 8, !tbaa !20
  %144 = zext i16 %143 to i32
  %145 = icmp eq i32 %144, 0
  br i1 %145, label %151, label %146

146:                                              ; preds = %140
  br label %147

147:                                              ; preds = %146
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.25, i32 noundef 1091, ptr noundef @.str.2)
  br label %149

149:                                              ; preds = %147
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150, %140
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.tcp_pcb, ptr %154, i32 0, i32 44
  %156 = load ptr, ptr %155, align 8, !tbaa !21
  %157 = icmp eq ptr %156, null
  br i1 %157, label %158, label %162

158:                                              ; preds = %153
  %159 = load ptr, ptr %7, align 8, !tbaa !5
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.tcp_pcb, ptr %160, i32 0, i32 44
  store ptr %159, ptr %161, align 8, !tbaa !21
  br label %180

162:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.tcp_pcb, ptr %163, i32 0, i32 44
  %165 = load ptr, ptr %164, align 8, !tbaa !21
  store ptr %165, ptr %11, align 8, !tbaa !5
  br label %166

166:                                              ; preds = %172, %162
  %167 = load ptr, ptr %11, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.tcp_seg, ptr %167, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !22
  %170 = icmp ne ptr %169, null
  br i1 %170, label %171, label %176

171:                                              ; preds = %166
  br label %172

172:                                              ; preds = %171
  %173 = load ptr, ptr %11, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.tcp_seg, ptr %173, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8, !tbaa !22
  store ptr %175, ptr %11, align 8, !tbaa !5
  br label %166, !llvm.loop !23

176:                                              ; preds = %166
  %177 = load ptr, ptr %7, align 8, !tbaa !5
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.tcp_seg, ptr %178, i32 0, i32 0
  store ptr %177, ptr %179, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %180

180:                                              ; preds = %176, %158
  %181 = load ptr, ptr %4, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.tcp_pcb, ptr %181, i32 0, i32 42
  store i16 0, ptr %182, align 8, !tbaa !25
  %183 = load i8, ptr %5, align 1, !tbaa !9
  %184 = zext i8 %183 to i32
  %185 = and i32 %184, 2
  %186 = icmp ne i32 %185, 0
  br i1 %186, label %192, label %187

187:                                              ; preds = %180
  %188 = load i8, ptr %5, align 1, !tbaa !9
  %189 = zext i8 %188 to i32
  %190 = and i32 %189, 1
  %191 = icmp ne i32 %190, 0
  br i1 %191, label %192, label %197

192:                                              ; preds = %187, %180
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.tcp_pcb, ptr %193, i32 0, i32 37
  %195 = load i32, ptr %194, align 4, !tbaa !17
  %196 = add i32 %195, 1
  store i32 %196, ptr %194, align 4, !tbaa !17
  br label %197

197:                                              ; preds = %192, %187
  %198 = load i8, ptr %5, align 1, !tbaa !9
  %199 = zext i8 %198 to i32
  %200 = and i32 %199, 1
  %201 = icmp ne i32 %200, 0
  br i1 %201, label %202, label %214

202:                                              ; preds = %197
  br label %203

203:                                              ; preds = %202
  %204 = load ptr, ptr %4, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.tcp_pcb, ptr %204, i32 0, i32 12
  %206 = load i16, ptr %205, align 2, !tbaa !10
  %207 = zext i16 %206 to i32
  %208 = or i32 %207, 32
  %209 = trunc i32 %208 to i16
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.tcp_pcb, ptr %210, i32 0, i32 12
  store i16 %209, ptr %211, align 2, !tbaa !10
  br label %212

212:                                              ; preds = %203
  br label %213

213:                                              ; preds = %212
  br label %214

214:                                              ; preds = %213, %197
  %215 = load ptr, ptr %7, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.tcp_seg, ptr %215, i32 0, i32 1
  %217 = load ptr, ptr %216, align 8, !tbaa !26
  %218 = call zeroext i16 @pbuf_clen(ptr noundef %217)
  %219 = zext i16 %218 to i32
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.tcp_pcb, ptr %220, i32 0, i32 41
  %222 = load i16, ptr %221, align 2, !tbaa !27
  %223 = zext i16 %222 to i32
  %224 = add nsw i32 %223, %219
  %225 = trunc i32 %224 to i16
  store i16 %225, ptr %221, align 2, !tbaa !27
  %226 = load ptr, ptr %4, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.tcp_pcb, ptr %226, i32 0, i32 41
  %228 = load i16, ptr %227, align 2, !tbaa !27
  %229 = zext i16 %228 to i32
  %230 = icmp ne i32 %229, 0
  br i1 %230, label %231, label %250

231:                                              ; preds = %214
  br label %232

232:                                              ; preds = %231
  %233 = load ptr, ptr %4, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.tcp_pcb, ptr %233, i32 0, i32 45
  %235 = load ptr, ptr %234, align 8, !tbaa !28
  %236 = icmp ne ptr %235, null
  br i1 %236, label %247, label %237

237:                                              ; preds = %232
  %238 = load ptr, ptr %4, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.tcp_pcb, ptr %238, i32 0, i32 44
  %240 = load ptr, ptr %239, align 8, !tbaa !21
  %241 = icmp ne ptr %240, null
  br i1 %241, label %247, label %242

242:                                              ; preds = %237
  br label %243

243:                                              ; preds = %242
  %244 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.26, i32 noundef 1126, ptr noundef @.str.2)
  br label %245

245:                                              ; preds = %243
  br label %246

246:                                              ; preds = %245
  br label %247

247:                                              ; preds = %246, %237, %232
  br label %248

248:                                              ; preds = %247
  br label %249

249:                                              ; preds = %248
  br label %250

250:                                              ; preds = %249, %214
  store i8 0, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %251

251:                                              ; preds = %250, %123, %85
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 1, 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
  %252 = load i8, ptr %3, align 1
  ret i8 %252
}

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 = !{!7, !7, i64 0}
!10 = !{!11, !14, i64 42}
!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 = !{!16, !14, i64 18}
!16 = !{!"pbuf", !6, i64 0, !6, i64 8, !14, i64 16, !14, i64 18, !7, i64 20, !7, i64 21, !7, i64 22, !7, i64 23}
!17 = !{!11, !13, i64 108}
!18 = !{!19, !6, i64 24}
!19 = !{!"tcp_seg", !6, i64 0, !6, i64 8, !14, i64 16, !7, i64 18, !6, i64 24}
!20 = !{!19, !14, i64 16}
!21 = !{!11, !6, i64 128}
!22 = !{!19, !6, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!11, !14, i64 120}
!26 = !{!19, !6, i64 8}
!27 = !{!11, !14, i64 118}
!28 = !{!11, !6, i64 136}


; 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 [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [182 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [40 x i8], align 1

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

declare zeroext i16 @pbuf_clen(ptr noundef) local_unnamed_addr #1

declare ptr @pbuf_alloc(i32 noundef, i16 noundef zeroext, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @tcp_create_segment(ptr noundef, ptr noundef, i8 noundef zeroext, i32 noundef, i8 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local signext range(i8 -1, 1) i8 @tcp_enqueue_flags(ptr noundef %0, i8 noundef zeroext %1) local_unnamed_addr #2 {
  %3 = zext i8 %1 to i32
  %4 = and i32 %3, 3
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %5, label %7

5:                                                ; preds = %2
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.21, i32 noundef 1042, ptr noundef nonnull @.str.2)
  br label %7

7:                                                ; preds = %2, %5
  %.not47 = icmp eq ptr %0, null
  br i1 %.not47, label %8, label %10

8:                                                ; preds = %7
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.22, i32 noundef 1043, ptr noundef nonnull @.str.2)
  br label %10

10:                                               ; preds = %8, %7
  %11 = and i32 %3, 2
  %.lobit = lshr exact i32 %11, 1
  %spec.select = trunc nuw nsw i32 %.lobit to i8
  %.tr = trunc nuw nsw i32 %11 to i16
  %12 = shl nuw nsw i16 %.tr, 1
  %13 = tail call ptr @pbuf_alloc(i32 noundef 56, i16 noundef zeroext %12, i32 noundef 640) #3
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %19

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %0, i64 42
  %17 = load i16, ptr %16, align 2, !tbaa !5
  %18 = or i16 %17, 128
  store i16 %18, ptr %16, align 2, !tbaa !5
  br label %74

19:                                               ; preds = %10
  %20 = getelementptr inbounds i8, ptr %13, i64 18
  %21 = load i16, ptr %20, align 2, !tbaa !13
  %.not50 = icmp ult i16 %21, %12
  br i1 %.not50, label %22, label %24

22:                                               ; preds = %19
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.23, i32 noundef 1082, ptr noundef nonnull @.str.2)
  br label %24

24:                                               ; preds = %22, %19
  %25 = getelementptr inbounds i8, ptr %0, i64 108
  %26 = load i32, ptr %25, align 4, !tbaa !15
  %27 = tail call ptr @tcp_create_segment(ptr noundef %0, ptr noundef nonnull %13, i8 noundef zeroext %1, i32 noundef %26, i8 noundef zeroext %spec.select)
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %33

29:                                               ; preds = %24
  %30 = getelementptr inbounds i8, ptr %0, i64 42
  %31 = load i16, ptr %30, align 2, !tbaa !5
  %32 = or i16 %31, 128
  store i16 %32, ptr %30, align 2, !tbaa !5
  br label %74

33:                                               ; preds = %24
  %34 = getelementptr inbounds i8, ptr %27, i64 24
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  %36 = ptrtoint ptr %35 to i64
  %37 = and i64 %36, 3
  %38 = icmp eq i64 %37, 0
  br i1 %38, label %41, label %39

39:                                               ; preds = %33
  %40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.24, i32 noundef 1090, ptr noundef nonnull @.str.2)
  br label %41

41:                                               ; preds = %33, %39
  %42 = getelementptr inbounds i8, ptr %27, i64 16
  %43 = load i16, ptr %42, align 8, !tbaa !18
  %44 = icmp eq i16 %43, 0
  br i1 %44, label %47, label %45

45:                                               ; preds = %41
  %46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.25, i32 noundef 1091, ptr noundef nonnull @.str.2)
  br label %47

47:                                               ; preds = %45, %41
  %48 = getelementptr inbounds i8, ptr %0, i64 128
  %49 = load ptr, ptr %48, align 8, !tbaa !19
  %50 = icmp eq ptr %49, null
  br i1 %50, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %47, %.preheader
  %.0 = phi ptr [ %51, %.preheader ], [ %49, %47 ]
  %51 = load ptr, ptr %.0, align 8, !tbaa !20
  %.not51 = icmp eq ptr %51, null
  br i1 %.not51, label %.loopexit, label %.preheader, !llvm.loop !21

.loopexit:                                        ; preds = %.preheader, %47
  %.0.lcssa.sink = phi ptr [ %48, %47 ], [ %.0, %.preheader ]
  store ptr %27, ptr %.0.lcssa.sink, align 8, !tbaa !23
  %52 = getelementptr inbounds i8, ptr %0, i64 120
  store i16 0, ptr %52, align 8, !tbaa !24
  br i1 %.not, label %.thread, label %53

53:                                               ; preds = %.loopexit
  %54 = and i32 %3, 1
  %.not52 = icmp eq i32 %54, 0
  %55 = load i32, ptr %25, align 4, !tbaa !15
  %56 = add i32 %55, 1
  store i32 %56, ptr %25, align 4, !tbaa !15
  br i1 %.not52, label %.thread, label %57

57:                                               ; preds = %53
  %58 = getelementptr inbounds i8, ptr %0, i64 42
  %59 = load i16, ptr %58, align 2, !tbaa !5
  %60 = or i16 %59, 32
  store i16 %60, ptr %58, align 2, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %.loopexit, %57, %53
  %61 = getelementptr inbounds i8, ptr %27, i64 8
  %62 = load ptr, ptr %61, align 8, !tbaa !25
  %63 = tail call zeroext i16 @pbuf_clen(ptr noundef %62) #3
  %64 = getelementptr inbounds i8, ptr %0, i64 118
  %65 = load i16, ptr %64, align 2, !tbaa !26
  %66 = add i16 %65, %63
  store i16 %66, ptr %64, align 2, !tbaa !26
  %.not54 = icmp eq i16 %66, 0
  br i1 %.not54, label %74, label %67

67:                                               ; preds = %.thread
  %68 = getelementptr inbounds i8, ptr %0, i64 136
  %69 = load ptr, ptr %68, align 8, !tbaa !27
  %.not55 = icmp eq ptr %69, null
  br i1 %.not55, label %70, label %74

70:                                               ; preds = %67
  %71 = load ptr, ptr %48, align 8, !tbaa !19
  %.not56 = icmp eq ptr %71, null
  br i1 %.not56, label %72, label %74

72:                                               ; preds = %70
  %73 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.26, i32 noundef 1126, ptr noundef nonnull @.str.2)
  br label %74

74:                                               ; preds = %.thread, %72, %70, %67, %29, %15
  %.042 = phi i8 [ -1, %15 ], [ -1, %29 ], [ 0, %67 ], [ 0, %70 ], [ 0, %72 ], [ 0, %.thread ]
  ret i8 %.042
}

attributes #0 = { 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 #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, !12, i64 42}
!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 = !{!14, !12, i64 18}
!14 = !{!"pbuf", !11, i64 0, !11, i64 8, !12, i64 16, !12, i64 18, !9, i64 20, !9, i64 21, !9, i64 22, !9, i64 23}
!15 = !{!6, !8, i64 108}
!16 = !{!17, !11, i64 24}
!17 = !{!"tcp_seg", !11, i64 0, !11, i64 8, !12, i64 16, !9, i64 18, !11, i64 24}
!18 = !{!17, !12, i64 16}
!19 = !{!6, !11, i64 128}
!20 = !{!17, !11, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!11, !11, i64 0}
!24 = !{!6, !12, i64 120}
!25 = !{!17, !11, i64 8}
!26 = !{!6, !12, i64 118}
!27 = !{!6, !11, i64 136}


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