; LLVM IR from dynexcoin/Dynex :: external/miniupnpc (minihttptestserver)

; 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.anon = type { i32, ptr }

@modes_array = external dso_local constant [6 x %struct.anon], align 16
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [4 x i8], align 1
@__const.handle_http_connection.response405 = external hidden unnamed_addr constant [48 x i8], align 16
@.str.18 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [109 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [74 x i8], align 1

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

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

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

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

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

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

declare i64 @write(i32 noundef, ptr noundef, i64 noundef) #5

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #6

declare void @perror(ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local void @handle_http_connection(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca [2048 x i8], align 16
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca [16 x i8], align 16
  %10 = alloca [256 x i8], align 16
  %11 = alloca [16 x i8], align 16
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca [48 x i8], align 16
  %19 = alloca ptr, align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2048, ptr %3) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #9
  store i64 0, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 256, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  store i64 16384, ptr %16, align 8, !tbaa !9
  br label %20

20:                                               ; preds = %71, %43, %1
  %21 = load i64, ptr %4, align 8, !tbaa !9
  %22 = icmp ult i64 %21, 2048
  br i1 %22, label %23, label %27

23:                                               ; preds = %20
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = icmp ne i32 %24, 0
  %26 = xor i1 %25, true
  br label %27

27:                                               ; preds = %23, %20
  %28 = phi i1 [ false, %20 ], [ %26, %23 ]
  br i1 %28, label %29, label %72

29:                                               ; preds = %27
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = getelementptr inbounds [2048 x i8], ptr %3, i64 0, i64 0
  %32 = load i64, ptr %4, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %31, i64 %32
  %34 = load i64, ptr %4, align 8, !tbaa !9
  %35 = sub i64 2048, %34
  %36 = call i64 @read(i32 noundef %30, ptr noundef %33, i64 noundef %35)
  store i64 %36, ptr %6, align 8, !tbaa !9
  %37 = load i64, ptr %6, align 8, !tbaa !9
  %38 = icmp slt i64 %37, 0
  br i1 %38, label %39, label %45

39:                                               ; preds = %29
  %40 = call ptr @__errno_location() #10
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = icmp eq i32 %41, 4
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  br label %20, !llvm.loop !11

44:                                               ; preds = %39
  call void @perror(ptr noundef @.str.12)
  store i32 1, ptr %17, align 4
  br label %369

45:                                               ; preds = %29
  %46 = load i64, ptr %6, align 8, !tbaa !9
  %47 = icmp eq i64 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %45
  br label %72

49:                                               ; preds = %45
  %50 = load i64, ptr %6, align 8, !tbaa !9
  %51 = load i64, ptr %4, align 8, !tbaa !9
  %52 = add i64 %51, %50
  store i64 %52, ptr %4, align 8, !tbaa !9
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %53

53:                                               ; preds = %66, %49
  %54 = load i64, ptr %8, align 8, !tbaa !9
  %55 = load i64, ptr %4, align 8, !tbaa !9
  %56 = sub i64 %55, 3
  %57 = icmp ult i64 %54, %56
  br i1 %57, label %58, label %69

58:                                               ; preds = %53
  %59 = getelementptr inbounds [2048 x i8], ptr %3, i64 0, i64 0
  %60 = load i64, ptr %8, align 8, !tbaa !9
  %61 = getelementptr inbounds i8, ptr %59, i64 %60
  %62 = call i32 @memcmp(ptr noundef %61, ptr noundef @.str.13, i64 noundef 4) #11
  %63 = icmp eq i32 0, %62
  br i1 %63, label %64, label %65

64:                                               ; preds = %58
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %69

65:                                               ; preds = %58
  br label %66

66:                                               ; preds = %65
  %67 = load i64, ptr %8, align 8, !tbaa !9
  %68 = add i64 %67, 1
  store i64 %68, ptr %8, align 8, !tbaa !9
  br label %53, !llvm.loop !13

69:                                               ; preds = %64, %53
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70
  br label %20, !llvm.loop !11

72:                                               ; preds = %48, %27
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %77, label %75

75:                                               ; preds = %72
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  store i32 1, ptr %17, align 4
  br label %369

77:                                               ; preds = %72
  %78 = load i64, ptr %4, align 8, !tbaa !9
  %79 = trunc i64 %78 to i32
  %80 = getelementptr inbounds [2048 x i8], ptr %3, i64 0, i64 0
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %79, ptr noundef %80)
  %82 = getelementptr inbounds [2048 x i8], ptr %3, i64 0, i64 0
  store ptr %82, ptr %12, align 8, !tbaa !14
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %83

83:                                               ; preds = %104, %77
  %84 = load i64, ptr %8, align 8, !tbaa !9
  %85 = icmp ult i64 %84, 15
  br i1 %85, label %86, label %107

86:                                               ; preds = %83
  %87 = load ptr, ptr %12, align 8, !tbaa !14
  %88 = load i8, ptr %87, align 1, !tbaa !16
  %89 = sext i8 %88 to i32
  %90 = icmp eq i32 %89, 32
  br i1 %90, label %96, label %91

91:                                               ; preds = %86
  %92 = load ptr, ptr %12, align 8, !tbaa !14
  %93 = load i8, ptr %92, align 1, !tbaa !16
  %94 = sext i8 %93 to i32
  %95 = icmp eq i32 %94, 13
  br i1 %95, label %96, label %97

96:                                               ; preds = %91, %86
  br label %107

97:                                               ; preds = %91
  %98 = load ptr, ptr %12, align 8, !tbaa !14
  %99 = load i8, ptr %98, align 1, !tbaa !16
  %100 = load i64, ptr %8, align 8, !tbaa !9
  %101 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 %100
  store i8 %99, ptr %101, align 1, !tbaa !16
  %102 = load ptr, ptr %12, align 8, !tbaa !14
  %103 = getelementptr inbounds i8, ptr %102, i32 1
  store ptr %103, ptr %12, align 8, !tbaa !14
  br label %104

104:                                              ; preds = %97
  %105 = load i64, ptr %8, align 8, !tbaa !9
  %106 = add i64 %105, 1
  store i64 %106, ptr %8, align 8, !tbaa !9
  br label %83, !llvm.loop !17

107:                                              ; preds = %96, %83
  %108 = load i64, ptr %8, align 8, !tbaa !9
  %109 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 %108
  store i8 0, ptr %109, align 1, !tbaa !16
  br label %110

110:                                              ; preds = %115, %107
  %111 = load ptr, ptr %12, align 8, !tbaa !14
  %112 = load i8, ptr %111, align 1, !tbaa !16
  %113 = sext i8 %112 to i32
  %114 = icmp eq i32 %113, 32
  br i1 %114, label %115, label %118

115:                                              ; preds = %110
  %116 = load ptr, ptr %12, align 8, !tbaa !14
  %117 = getelementptr inbounds i8, ptr %116, i32 1
  store ptr %117, ptr %12, align 8, !tbaa !14
  br label %110, !llvm.loop !18

118:                                              ; preds = %110
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %119

119:                                              ; preds = %140, %118
  %120 = load i64, ptr %8, align 8, !tbaa !9
  %121 = icmp ult i64 %120, 255
  br i1 %121, label %122, label %143

122:                                              ; preds = %119
  %123 = load ptr, ptr %12, align 8, !tbaa !14
  %124 = load i8, ptr %123, align 1, !tbaa !16
  %125 = sext i8 %124 to i32
  %126 = icmp eq i32 %125, 32
  br i1 %126, label %132, label %127

127:                                              ; preds = %122
  %128 = load ptr, ptr %12, align 8, !tbaa !14
  %129 = load i8, ptr %128, align 1, !tbaa !16
  %130 = sext i8 %129 to i32
  %131 = icmp eq i32 %130, 13
  br i1 %131, label %132, label %133

132:                                              ; preds = %127, %122
  br label %143

133:                                              ; preds = %127
  %134 = load ptr, ptr %12, align 8, !tbaa !14
  %135 = load i8, ptr %134, align 1, !tbaa !16
  %136 = load i64, ptr %8, align 8, !tbaa !9
  %137 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 %136
  store i8 %135, ptr %137, align 1, !tbaa !16
  %138 = load ptr, ptr %12, align 8, !tbaa !14
  %139 = getelementptr inbounds i8, ptr %138, i32 1
  store ptr %139, ptr %12, align 8, !tbaa !14
  br label %140

140:                                              ; preds = %133
  %141 = load i64, ptr %8, align 8, !tbaa !9
  %142 = add i64 %141, 1
  store i64 %142, ptr %8, align 8, !tbaa !9
  br label %119, !llvm.loop !19

143:                                              ; preds = %132, %119
  %144 = load i64, ptr %8, align 8, !tbaa !9
  %145 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 %144
  store i8 0, ptr %145, align 1, !tbaa !16
  br label %146

146:                                              ; preds = %151, %143
  %147 = load ptr, ptr %12, align 8, !tbaa !14
  %148 = load i8, ptr %147, align 1, !tbaa !16
  %149 = sext i8 %148 to i32
  %150 = icmp eq i32 %149, 32
  br i1 %150, label %151, label %154

151:                                              ; preds = %146
  %152 = load ptr, ptr %12, align 8, !tbaa !14
  %153 = getelementptr inbounds i8, ptr %152, i32 1
  store ptr %153, ptr %12, align 8, !tbaa !14
  br label %146, !llvm.loop !20

154:                                              ; preds = %146
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %155

155:                                              ; preds = %176, %154
  %156 = load i64, ptr %8, align 8, !tbaa !9
  %157 = icmp ult i64 %156, 15
  br i1 %157, label %158, label %179

158:                                              ; preds = %155
  %159 = load ptr, ptr %12, align 8, !tbaa !14
  %160 = load i8, ptr %159, align 1, !tbaa !16
  %161 = sext i8 %160 to i32
  %162 = icmp eq i32 %161, 32
  br i1 %162, label %168, label %163

163:                                              ; preds = %158
  %164 = load ptr, ptr %12, align 8, !tbaa !14
  %165 = load i8, ptr %164, align 1, !tbaa !16
  %166 = sext i8 %165 to i32
  %167 = icmp eq i32 %166, 13
  br i1 %167, label %168, label %169

168:                                              ; preds = %163, %158
  br label %179

169:                                              ; preds = %163
  %170 = load ptr, ptr %12, align 8, !tbaa !14
  %171 = load i8, ptr %170, align 1, !tbaa !16
  %172 = load i64, ptr %8, align 8, !tbaa !9
  %173 = getelementptr inbounds [16 x i8], ptr %11, i64 0, i64 %172
  store i8 %171, ptr %173, align 1, !tbaa !16
  %174 = load ptr, ptr %12, align 8, !tbaa !14
  %175 = getelementptr inbounds i8, ptr %174, i32 1
  store ptr %175, ptr %12, align 8, !tbaa !14
  br label %176

176:                                              ; preds = %169
  %177 = load i64, ptr %8, align 8, !tbaa !9
  %178 = add i64 %177, 1
  store i64 %178, ptr %8, align 8, !tbaa !9
  br label %155, !llvm.loop !21

179:                                              ; preds = %168, %155
  %180 = load i64, ptr %8, align 8, !tbaa !9
  %181 = getelementptr inbounds [16 x i8], ptr %11, i64 0, i64 %180
  store i8 0, ptr %181, align 1, !tbaa !16
  %182 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  %183 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 0
  %184 = getelementptr inbounds [16 x i8], ptr %11, i64 0, i64 0
  %185 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef %182, ptr noundef %183, ptr noundef %184)
  %186 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  %187 = call i32 @strcmp(ptr noundef %186, ptr noundef @.str.17) #11
  %188 = icmp ne i32 0, %187
  br i1 %188, label %189, label %217

189:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 48, ptr %18) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 @__const.handle_http_connection.response405, i64 48, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  store i64 47, ptr %6, align 8, !tbaa !9
  %190 = getelementptr inbounds [48 x i8], ptr %18, i64 0, i64 0
  store ptr %190, ptr %19, align 8, !tbaa !14
  br label %191

191:                                              ; preds = %214, %189
  %192 = load i64, ptr %6, align 8, !tbaa !9
  %193 = icmp sgt i64 %192, 0
  br i1 %193, label %194, label %215

194:                                              ; preds = %191
  %195 = load i32, ptr %2, align 4, !tbaa !5
  %196 = load ptr, ptr %19, align 8, !tbaa !14
  %197 = load i64, ptr %6, align 8, !tbaa !9
  %198 = call i64 @write(i32 noundef %195, ptr noundef %196, i64 noundef %197)
  store i64 %198, ptr %7, align 8, !tbaa !9
  %199 = load i64, ptr %7, align 8, !tbaa !9
  %200 = icmp slt i64 %199, 0
  br i1 %200, label %201, label %207

201:                                              ; preds = %194
  %202 = call ptr @__errno_location() #10
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = icmp ne i32 %203, 4
  br i1 %204, label %205, label %206

205:                                              ; preds = %201
  call void @perror(ptr noundef @.str.11)
  store i32 1, ptr %17, align 4
  br label %216

206:                                              ; preds = %201
  br label %214

207:                                              ; preds = %194
  %208 = load i64, ptr %7, align 8, !tbaa !9
  %209 = load i64, ptr %6, align 8, !tbaa !9
  %210 = sub nsw i64 %209, %208
  store i64 %210, ptr %6, align 8, !tbaa !9
  %211 = load i64, ptr %7, align 8, !tbaa !9
  %212 = load ptr, ptr %19, align 8, !tbaa !14
  %213 = getelementptr inbounds i8, ptr %212, i64 %211
  store ptr %213, ptr %19, align 8, !tbaa !14
  br label %214

214:                                              ; preds = %207, %206
  br label %191, !llvm.loop !22

215:                                              ; preds = %191
  store i32 1, ptr %17, align 4
  br label %216

216:                                              ; preds = %215, %205
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr %18) #9
  br label %369

217:                                              ; preds = %179
  store i32 0, ptr %15, align 4, !tbaa !5
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %218

218:                                              ; preds = %238, %217
  %219 = load i64, ptr %8, align 8, !tbaa !9
  %220 = getelementptr inbounds [6 x %struct.anon], ptr @modes_array, i64 0, i64 %219
  %221 = getelementptr inbounds %struct.anon, ptr %220, i32 0, i32 0
  %222 = load i32, ptr %221, align 16, !tbaa !23
  %223 = icmp ne i32 %222, 0
  br i1 %223, label %224, label %241

224:                                              ; preds = %218
  %225 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 0
  %226 = load i64, ptr %8, align 8, !tbaa !9
  %227 = getelementptr inbounds [6 x %struct.anon], ptr @modes_array, i64 0, i64 %226
  %228 = getelementptr inbounds %struct.anon, ptr %227, i32 0, i32 1
  %229 = load ptr, ptr %228, align 8, !tbaa !25
  %230 = call ptr @strstr(ptr noundef %225, ptr noundef %229) #11
  %231 = icmp ne ptr %230, null
  br i1 %231, label %232, label %237

232:                                              ; preds = %224
  %233 = load i64, ptr %8, align 8, !tbaa !9
  %234 = getelementptr inbounds [6 x %struct.anon], ptr @modes_array, i64 0, i64 %233
  %235 = getelementptr inbounds %struct.anon, ptr %234, i32 0, i32 0
  %236 = load i32, ptr %235, align 16, !tbaa !23
  store i32 %236, ptr %15, align 4, !tbaa !5
  br label %241

237:                                              ; preds = %224
  br label %238

238:                                              ; preds = %237
  %239 = load i64, ptr %8, align 8, !tbaa !9
  %240 = add i64 %239, 1
  store i64 %240, ptr %8, align 8, !tbaa !9
  br label %218, !llvm.loop !26

241:                                              ; preds = %232, %218
  %242 = load i32, ptr %15, align 4, !tbaa !5
  switch i32 %242, label %328 [
    i32 5, label %243
    i32 1, label %268
    i32 2, label %271
    i32 4, label %307
  ]

243:                                              ; preds = %241
  store i64 2048, ptr %14, align 8, !tbaa !9
  %244 = load i64, ptr %14, align 8, !tbaa !9
  %245 = call noalias ptr @malloc(i64 noundef %244) #12
  store ptr %245, ptr %13, align 8, !tbaa !14
  %246 = load ptr, ptr %13, align 8, !tbaa !14
  %247 = icmp ne ptr %246, null
  br i1 %247, label %249, label %248

248:                                              ; preds = %243
  br label %359

249:                                              ; preds = %243
  %250 = load ptr, ptr %13, align 8, !tbaa !14
  %251 = load i64, ptr %14, align 8, !tbaa !9
  %252 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %250, i64 noundef %251, ptr noundef @.str.18) #9
  %253 = sext i32 %252 to i64
  store i64 %253, ptr %6, align 8, !tbaa !9
  %254 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %254, ptr %8, align 8, !tbaa !9
  br label %255

255:                                              ; preds = %263, %249
  %256 = load i64, ptr %8, align 8, !tbaa !9
  %257 = load i64, ptr %14, align 8, !tbaa !9
  %258 = icmp ult i64 %256, %257
  br i1 %258, label %259, label %266

259:                                              ; preds = %255
  %260 = load ptr, ptr %13, align 8, !tbaa !14
  %261 = load i64, ptr %8, align 8, !tbaa !9
  %262 = getelementptr inbounds i8, ptr %260, i64 %261
  store i8 32, ptr %262, align 1, !tbaa !16
  br label %263

263:                                              ; preds = %259
  %264 = load i64, ptr %8, align 8, !tbaa !9
  %265 = add i64 %264, 1
  store i64 %265, ptr %8, align 8, !tbaa !9
  br label %255, !llvm.loop !27

266:                                              ; preds = %255
  %267 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %267, ptr %14, align 8, !tbaa !9
  br label %359

268:                                              ; preds = %241
  %269 = load i64, ptr %16, align 8, !tbaa !9
  %270 = call ptr @build_chunked_response(i64 noundef %269, ptr noundef %14)
  store ptr %270, ptr %13, align 8, !tbaa !14
  br label %359

271:                                              ; preds = %241
  %272 = load i64, ptr %16, align 8, !tbaa !9
  %273 = add i64 %272, 256
  store i64 %273, ptr %14, align 8, !tbaa !9
  %274 = load i64, ptr %14, align 8, !tbaa !9
  %275 = call noalias ptr @malloc(i64 noundef %274) #12
  store ptr %275, ptr %13, align 8, !tbaa !14
  %276 = load ptr, ptr %13, align 8, !tbaa !14
  %277 = icmp ne ptr %276, null
  br i1 %277, label %279, label %278

278:                                              ; preds = %271
  br label %359

279:                                              ; preds = %271
  %280 = load ptr, ptr %13, align 8, !tbaa !14
  %281 = load i64, ptr %14, align 8, !tbaa !9
  %282 = load i64, ptr %16, align 8, !tbaa !9
  %283 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %280, i64 noundef %281, ptr noundef @.str.19, i64 noundef %282) #9
  %284 = sext i32 %283 to i64
  store i64 %284, ptr %6, align 8, !tbaa !9
  %285 = load i64, ptr %16, align 8, !tbaa !9
  %286 = load i64, ptr %6, align 8, !tbaa !9
  %287 = add i64 %285, %286
  %288 = add i64 %287, 2048
  store i64 %288, ptr %14, align 8, !tbaa !9
  %289 = load ptr, ptr %13, align 8, !tbaa !14
  %290 = load i64, ptr %14, align 8, !tbaa !9
  %291 = call ptr @realloc(ptr noundef %289, i64 noundef %290) #13
  store ptr %291, ptr %12, align 8, !tbaa !14
  %292 = load ptr, ptr %12, align 8, !tbaa !14
  %293 = icmp eq ptr %292, null
  br i1 %293, label %294, label %296

294:                                              ; preds = %279
  %295 = load ptr, ptr %13, align 8, !tbaa !14
  call void @free(ptr noundef %295) #9
  store ptr null, ptr %13, align 8, !tbaa !14
  br label %359

296:                                              ; preds = %279
  %297 = load ptr, ptr %12, align 8, !tbaa !14
  store ptr %297, ptr %13, align 8, !tbaa !14
  %298 = load ptr, ptr %13, align 8, !tbaa !14
  %299 = load i64, ptr %6, align 8, !tbaa !9
  %300 = getelementptr inbounds i8, ptr %298, i64 %299
  %301 = load i64, ptr %16, align 8, !tbaa !9
  call void @build_content(ptr noundef %300, i64 noundef %301)
  %302 = load ptr, ptr %13, align 8, !tbaa !14
  %303 = load i64, ptr %6, align 8, !tbaa !9
  %304 = getelementptr inbounds i8, ptr %302, i64 %303
  %305 = load i64, ptr %16, align 8, !tbaa !9
  %306 = getelementptr inbounds i8, ptr %304, i64 %305
  call void @build_crap(ptr noundef %306, i64 noundef 2048)
  br label %359

307:                                              ; preds = %241
  store i64 198, ptr %16, align 8, !tbaa !9
  %308 = load i64, ptr %16, align 8, !tbaa !9
  %309 = add i64 %308, 256
  store i64 %309, ptr %14, align 8, !tbaa !9
  %310 = load i64, ptr %14, align 8, !tbaa !9
  %311 = call noalias ptr @malloc(i64 noundef %310) #12
  store ptr %311, ptr %13, align 8, !tbaa !14
  %312 = load ptr, ptr %13, align 8, !tbaa !14
  %313 = icmp ne ptr %312, null
  br i1 %313, label %315, label %314

314:                                              ; preds = %307
  br label %359

315:                                              ; preds = %307
  %316 = load ptr, ptr %13, align 8, !tbaa !14
  %317 = load i64, ptr %14, align 8, !tbaa !9
  %318 = load i64, ptr %16, align 8, !tbaa !9
  %319 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %316, i64 noundef %317, ptr noundef @.str.20, i64 noundef %318) #9
  %320 = sext i32 %319 to i64
  store i64 %320, ptr %6, align 8, !tbaa !9
  %321 = load ptr, ptr %13, align 8, !tbaa !14
  %322 = load i64, ptr %6, align 8, !tbaa !9
  %323 = getelementptr inbounds i8, ptr %321, i64 %322
  %324 = load i64, ptr %16, align 8, !tbaa !9
  call void @build_favicon_content(ptr noundef %323, i64 noundef %324)
  %325 = load i64, ptr %16, align 8, !tbaa !9
  %326 = load i64, ptr %6, align 8, !tbaa !9
  %327 = add i64 %325, %326
  store i64 %327, ptr %14, align 8, !tbaa !9
  br label %359

328:                                              ; preds = %241
  %329 = load i64, ptr %16, align 8, !tbaa !9
  %330 = add i64 %329, 256
  store i64 %330, ptr %14, align 8, !tbaa !9
  %331 = load i64, ptr %14, align 8, !tbaa !9
  %332 = call noalias ptr @malloc(i64 noundef %331) #12
  store ptr %332, ptr %13, align 8, !tbaa !14
  %333 = load ptr, ptr %13, align 8, !tbaa !14
  %334 = icmp ne ptr %333, null
  br i1 %334, label %336, label %335

335:                                              ; preds = %328
  br label %359

336:                                              ; preds = %328
  %337 = load ptr, ptr %13, align 8, !tbaa !14
  %338 = load i64, ptr %14, align 8, !tbaa !9
  %339 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %337, i64 noundef %338, ptr noundef @.str.21) #9
  %340 = sext i32 %339 to i64
  store i64 %340, ptr %6, align 8, !tbaa !9
  %341 = load i64, ptr %16, align 8, !tbaa !9
  %342 = load i64, ptr %6, align 8, !tbaa !9
  %343 = add i64 %341, %342
  store i64 %343, ptr %14, align 8, !tbaa !9
  %344 = load ptr, ptr %13, align 8, !tbaa !14
  %345 = load i64, ptr %14, align 8, !tbaa !9
  %346 = call ptr @realloc(ptr noundef %344, i64 noundef %345) #13
  store ptr %346, ptr %12, align 8, !tbaa !14
  %347 = load ptr, ptr %12, align 8, !tbaa !14
  %348 = icmp eq ptr %347, null
  br i1 %348, label %349, label %351

349:                                              ; preds = %336
  %350 = load ptr, ptr %13, align 8, !tbaa !14
  call void @free(ptr noundef %350) #9
  store ptr null, ptr %13, align 8, !tbaa !14
  br label %359

351:                                              ; preds = %336
  %352 = load ptr, ptr %12, align 8, !tbaa !14
  store ptr %352, ptr %13, align 8, !tbaa !14
  %353 = load ptr, ptr %13, align 8, !tbaa !14
  %354 = load i64, ptr %6, align 8, !tbaa !9
  %355 = getelementptr inbounds i8, ptr %353, i64 %354
  %356 = load i64, ptr %14, align 8, !tbaa !9
  %357 = load i64, ptr %6, align 8, !tbaa !9
  %358 = sub i64 %356, %357
  call void @build_content(ptr noundef %355, i64 noundef %358)
  br label %359

359:                                              ; preds = %351, %349, %335, %315, %314, %296, %294, %278, %268, %266, %248
  %360 = load ptr, ptr %13, align 8, !tbaa !14
  %361 = icmp ne ptr %360, null
  br i1 %361, label %362, label %367

362:                                              ; preds = %359
  %363 = load i32, ptr %2, align 4, !tbaa !5
  %364 = load ptr, ptr %13, align 8, !tbaa !14
  %365 = load i64, ptr %14, align 8, !tbaa !9
  call void @send_response(i32 noundef %363, ptr noundef %364, i64 noundef %365)
  %366 = load ptr, ptr %13, align 8, !tbaa !14
  call void @free(ptr noundef %366) #9
  br label %368

367:                                              ; preds = %359
  br label %368

368:                                              ; preds = %367, %362
  store i32 0, ptr %17, align 4
  br label %369

369:                                              ; preds = %368, %216, %75, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 256, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 2048, ptr %3) #9
  %370 = load i32, ptr %17, align 4
  switch i32 %370, label %372 [
    i32 0, label %371
    i32 1, label %371
  ]

371:                                              ; preds = %369, %369
  ret void

372:                                              ; preds = %369
  unreachable
}

declare i64 @read(i32 noundef, ptr noundef, i64 noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #7

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #7

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strstr(ptr noundef, ptr noundef) #7

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #8

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind allocsize(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 #5 = { "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 #6 = { nounwind willreturn memory(none) "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 #7 = { nounwind willreturn memory(read) "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 #8 = { nounwind allocsize(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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(none) }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind allocsize(0) }
attributes #13 = { nounwind allocsize(1) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = !{!24, !6, i64 0}
!24 = !{!"", !6, i64 0, !15, i64 8}
!25 = !{!24, !15, i64 8}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}


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

%struct.anon = type { i32, ptr }

@modes_array = external dso_local local_unnamed_addr constant [6 x %struct.anon], align 16
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [4 x i8], align 1
@__const.handle_http_connection.response405 = external hidden unnamed_addr constant [48 x i8], align 16
@.str.18 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [109 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [74 x i8], align 1

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: nofree
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @handle_http_connection(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca [2048 x i8], align 16
  %3 = alloca [16 x i8], align 16
  %4 = alloca [256 x i8], align 16
  %5 = alloca [16 x i8], align 16
  %6 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %2) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #11
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #11
  %.3113.lcssa.sroa.gep215 = getelementptr inbounds i8, ptr %5, i64 1
  %.3113.lcssa.sroa.gep216 = getelementptr inbounds i8, ptr %5, i64 2
  %.3113.lcssa.sroa.gep217 = getelementptr inbounds i8, ptr %5, i64 3
  %.3113.lcssa.sroa.gep218 = getelementptr inbounds i8, ptr %5, i64 4
  %.3113.lcssa.sroa.gep219 = getelementptr inbounds i8, ptr %5, i64 5
  %.3113.lcssa.sroa.gep220 = getelementptr inbounds i8, ptr %5, i64 6
  %.3113.lcssa.sroa.gep221 = getelementptr inbounds i8, ptr %5, i64 7
  %.3113.lcssa.sroa.gep222 = getelementptr inbounds i8, ptr %5, i64 8
  %.3113.lcssa.sroa.gep223 = getelementptr inbounds i8, ptr %5, i64 9
  %.3113.lcssa.sroa.gep224 = getelementptr inbounds i8, ptr %5, i64 10
  %.3113.lcssa.sroa.gep225 = getelementptr inbounds i8, ptr %5, i64 11
  %.3113.lcssa.sroa.gep226 = getelementptr inbounds i8, ptr %5, i64 12
  %.3113.lcssa.sroa.gep227 = getelementptr inbounds i8, ptr %5, i64 13
  %.3113.lcssa.sroa.gep228 = getelementptr inbounds i8, ptr %5, i64 14
  %.3113.lcssa.sroa.gep229 = getelementptr inbounds i8, ptr %5, i64 15
  %.1111.lcssa.sroa.gep230 = getelementptr inbounds i8, ptr %3, i64 1
  %.1111.lcssa.sroa.gep231 = getelementptr inbounds i8, ptr %3, i64 2
  %.1111.lcssa.sroa.gep232 = getelementptr inbounds i8, ptr %3, i64 3
  %.1111.lcssa.sroa.gep233 = getelementptr inbounds i8, ptr %3, i64 4
  %.1111.lcssa.sroa.gep234 = getelementptr inbounds i8, ptr %3, i64 5
  %.1111.lcssa.sroa.gep235 = getelementptr inbounds i8, ptr %3, i64 6
  %.1111.lcssa.sroa.gep236 = getelementptr inbounds i8, ptr %3, i64 7
  %.1111.lcssa.sroa.gep237 = getelementptr inbounds i8, ptr %3, i64 8
  %.1111.lcssa.sroa.gep238 = getelementptr inbounds i8, ptr %3, i64 9
  %.1111.lcssa.sroa.gep239 = getelementptr inbounds i8, ptr %3, i64 10
  %.1111.lcssa.sroa.gep240 = getelementptr inbounds i8, ptr %3, i64 11
  %.1111.lcssa.sroa.gep241 = getelementptr inbounds i8, ptr %3, i64 12
  %.1111.lcssa.sroa.gep242 = getelementptr inbounds i8, ptr %3, i64 13
  %.1111.lcssa.sroa.gep243 = getelementptr inbounds i8, ptr %3, i64 14
  %.1111.lcssa.sroa.gep244 = getelementptr inbounds i8, ptr %3, i64 15
  br label %7

7:                                                ; preds = %1, %.outer.split.backedge
  %.0115.ph177268 = phi i64 [ 0, %1 ], [ %23, %.outer.split.backedge ]
  %8 = phi ptr [ %2, %1 ], [ %.be254, %.outer.split.backedge ]
  %9 = phi i64 [ 2048, %1 ], [ %.be, %.outer.split.backedge ]
  %10 = call i64 @read(i32 noundef %0, ptr noundef nonnull %8, i64 noundef %9) #11
  %11 = icmp slt i64 %10, 0
  br i1 %11, label %12, label %.loopexit

12:                                               ; preds = %7
  %13 = tail call ptr @__errno_location() #12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = icmp eq i32 %14, 4
  br i1 %15, label %.peel.next, label %.loopexit207

.peel.next:                                       ; preds = %12, %18
  %16 = call i64 @read(i32 noundef %0, ptr noundef nonnull %8, i64 noundef %9) #11
  %17 = icmp slt i64 %16, 0
  br i1 %17, label %18, label %.loopexit

18:                                               ; preds = %.peel.next
  %19 = load i32, ptr %13, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 4
  br i1 %20, label %.peel.next, label %.loopexit207, !llvm.loop !9

.loopexit207:                                     ; preds = %12, %18
  tail call void @perror(ptr noundef nonnull @.str.12) #13
  br label %.thread147

.loopexit:                                        ; preds = %.peel.next, %7
  %.lcssa200 = phi i64 [ %10, %7 ], [ %16, %.peel.next ]
  %21 = icmp eq i64 %.lcssa200, 0
  br i1 %21, label %.thread, label %22

22:                                               ; preds = %.loopexit
  %23 = add i64 %.lcssa200, %.0115.ph177268
  %24 = add i64 %23, -3
  %.not193 = icmp eq i64 %24, 0
  br i1 %.not193, label %.outer, label %.lr.ph

25:                                               ; preds = %.lr.ph
  %26 = add nuw i64 %.0110173, 1
  %exitcond.not = icmp eq i64 %26, %24
  br i1 %exitcond.not, label %.outer, label %.lr.ph, !llvm.loop !12

.lr.ph:                                           ; preds = %22, %25
  %.0110173 = phi i64 [ %26, %25 ], [ 0, %22 ]
  %27 = getelementptr inbounds i8, ptr %2, i64 %.0110173
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %27, ptr noundef nonnull dereferenceable(4) @.str.13, i64 4)
  %28 = icmp eq i32 %bcmp, 0
  br i1 %28, label %.outer.thread, label %25

.outer:                                           ; preds = %25, %22
  %29 = icmp ult i64 %23, 2048
  br i1 %29, label %.outer.split.backedge, label %.thread

.outer.split.backedge:                            ; preds = %.outer, %.outer.thread
  %.not.peel = phi i1 [ true, %.outer ], [ false, %.outer.thread ]
  %.be254 = getelementptr inbounds i8, ptr %2, i64 %23
  %.be = sub nuw nsw i64 2048, %23
  br i1 %.not.peel, label %7, label %.split.thread, !llvm.loop !13

.outer.thread:                                    ; preds = %.lr.ph
  %30 = icmp ult i64 %23, 2048
  br i1 %30, label %.outer.split.backedge, label %.split.thread

.thread:                                          ; preds = %.loopexit, %.outer
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  br label %.thread147

.split.thread:                                    ; preds = %.outer.thread, %.outer.split.backedge
  %32 = trunc i64 %23 to i32
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %32, ptr noundef nonnull %2)
  %34 = load i8, ptr %2, align 16, !tbaa !14
  switch i8 %34, label %35 [
    i8 32, label %79
    i8 13, label %79
  ]

35:                                               ; preds = %.split.thread
  store i8 %34, ptr %3, align 16, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %2, i64 1
  %37 = load i8, ptr %36, align 1, !tbaa !14
  switch i8 %37, label %38 [
    i8 32, label %79
    i8 13, label %79
  ]

38:                                               ; preds = %35
  store i8 %37, ptr %.1111.lcssa.sroa.gep230, align 1, !tbaa !14
  %39 = getelementptr inbounds i8, ptr %2, i64 2
  %40 = load i8, ptr %39, align 2, !tbaa !14
  switch i8 %40, label %41 [
    i8 32, label %79
    i8 13, label %79
  ]

41:                                               ; preds = %38
  store i8 %40, ptr %.1111.lcssa.sroa.gep231, align 2, !tbaa !14
  %42 = getelementptr inbounds i8, ptr %2, i64 3
  %43 = load i8, ptr %42, align 1, !tbaa !14
  switch i8 %43, label %44 [
    i8 32, label %79
    i8 13, label %79
  ]

44:                                               ; preds = %41
  store i8 %43, ptr %.1111.lcssa.sroa.gep232, align 1, !tbaa !14
  %45 = getelementptr inbounds i8, ptr %2, i64 4
  %46 = load i8, ptr %45, align 4, !tbaa !14
  switch i8 %46, label %47 [
    i8 32, label %79
    i8 13, label %79
  ]

47:                                               ; preds = %44
  store i8 %46, ptr %.1111.lcssa.sroa.gep233, align 4, !tbaa !14
  %48 = getelementptr inbounds i8, ptr %2, i64 5
  %49 = load i8, ptr %48, align 1, !tbaa !14
  switch i8 %49, label %50 [
    i8 32, label %79
    i8 13, label %79
  ]

50:                                               ; preds = %47
  store i8 %49, ptr %.1111.lcssa.sroa.gep234, align 1, !tbaa !14
  %51 = getelementptr inbounds i8, ptr %2, i64 6
  %52 = load i8, ptr %51, align 2, !tbaa !14
  switch i8 %52, label %53 [
    i8 32, label %79
    i8 13, label %79
  ]

53:                                               ; preds = %50
  store i8 %52, ptr %.1111.lcssa.sroa.gep235, align 2, !tbaa !14
  %54 = getelementptr inbounds i8, ptr %2, i64 7
  %55 = load i8, ptr %54, align 1, !tbaa !14
  switch i8 %55, label %56 [
    i8 32, label %79
    i8 13, label %79
  ]

56:                                               ; preds = %53
  store i8 %55, ptr %.1111.lcssa.sroa.gep236, align 1, !tbaa !14
  %57 = getelementptr inbounds i8, ptr %2, i64 8
  %58 = load i8, ptr %57, align 8, !tbaa !14
  switch i8 %58, label %59 [
    i8 32, label %79
    i8 13, label %79
  ]

59:                                               ; preds = %56
  store i8 %58, ptr %.1111.lcssa.sroa.gep237, align 8, !tbaa !14
  %60 = getelementptr inbounds i8, ptr %2, i64 9
  %61 = load i8, ptr %60, align 1, !tbaa !14
  switch i8 %61, label %62 [
    i8 32, label %79
    i8 13, label %79
  ]

62:                                               ; preds = %59
  store i8 %61, ptr %.1111.lcssa.sroa.gep238, align 1, !tbaa !14
  %63 = getelementptr inbounds i8, ptr %2, i64 10
  %64 = load i8, ptr %63, align 2, !tbaa !14
  switch i8 %64, label %65 [
    i8 32, label %79
    i8 13, label %79
  ]

65:                                               ; preds = %62
  store i8 %64, ptr %.1111.lcssa.sroa.gep239, align 2, !tbaa !14
  %66 = getelementptr inbounds i8, ptr %2, i64 11
  %67 = load i8, ptr %66, align 1, !tbaa !14
  switch i8 %67, label %68 [
    i8 32, label %79
    i8 13, label %79
  ]

68:                                               ; preds = %65
  store i8 %67, ptr %.1111.lcssa.sroa.gep240, align 1, !tbaa !14
  %69 = getelementptr inbounds i8, ptr %2, i64 12
  %70 = load i8, ptr %69, align 4, !tbaa !14
  switch i8 %70, label %71 [
    i8 32, label %79
    i8 13, label %79
  ]

71:                                               ; preds = %68
  store i8 %70, ptr %.1111.lcssa.sroa.gep241, align 4, !tbaa !14
  %72 = getelementptr inbounds i8, ptr %2, i64 13
  %73 = load i8, ptr %72, align 1, !tbaa !14
  switch i8 %73, label %74 [
    i8 32, label %79
    i8 13, label %79
  ]

74:                                               ; preds = %71
  store i8 %73, ptr %.1111.lcssa.sroa.gep242, align 1, !tbaa !14
  %75 = getelementptr inbounds i8, ptr %2, i64 14
  %76 = load i8, ptr %75, align 2, !tbaa !14
  switch i8 %76, label %77 [
    i8 32, label %79
    i8 13, label %79
  ]

77:                                               ; preds = %74
  store i8 %76, ptr %.1111.lcssa.sroa.gep243, align 2, !tbaa !14
  %78 = getelementptr inbounds i8, ptr %2, i64 15
  br label %79

79:                                               ; preds = %77, %74, %74, %71, %71, %68, %68, %65, %65, %62, %62, %59, %59, %56, %56, %53, %53, %50, %50, %47, %47, %44, %44, %41, %41, %38, %38, %35, %35, %.split.thread, %.split.thread
  %.1111.lcssa.sroa.phi = phi ptr [ %3, %.split.thread ], [ %3, %.split.thread ], [ %.1111.lcssa.sroa.gep230, %35 ], [ %.1111.lcssa.sroa.gep230, %35 ], [ %.1111.lcssa.sroa.gep231, %38 ], [ %.1111.lcssa.sroa.gep231, %38 ], [ %.1111.lcssa.sroa.gep232, %41 ], [ %.1111.lcssa.sroa.gep232, %41 ], [ %.1111.lcssa.sroa.gep233, %44 ], [ %.1111.lcssa.sroa.gep233, %44 ], [ %.1111.lcssa.sroa.gep234, %47 ], [ %.1111.lcssa.sroa.gep234, %47 ], [ %.1111.lcssa.sroa.gep235, %50 ], [ %.1111.lcssa.sroa.gep235, %50 ], [ %.1111.lcssa.sroa.gep236, %53 ], [ %.1111.lcssa.sroa.gep236, %53 ], [ %.1111.lcssa.sroa.gep237, %56 ], [ %.1111.lcssa.sroa.gep237, %56 ], [ %.1111.lcssa.sroa.gep238, %59 ], [ %.1111.lcssa.sroa.gep238, %59 ], [ %.1111.lcssa.sroa.gep239, %62 ], [ %.1111.lcssa.sroa.gep239, %62 ], [ %.1111.lcssa.sroa.gep240, %65 ], [ %.1111.lcssa.sroa.gep240, %65 ], [ %.1111.lcssa.sroa.gep241, %68 ], [ %.1111.lcssa.sroa.gep241, %68 ], [ %.1111.lcssa.sroa.gep242, %71 ], [ %.1111.lcssa.sroa.gep242, %71 ], [ %.1111.lcssa.sroa.gep243, %74 ], [ %.1111.lcssa.sroa.gep243, %74 ], [ %.1111.lcssa.sroa.gep244, %77 ]
  %.0108.lcssa = phi ptr [ %2, %.split.thread ], [ %2, %.split.thread ], [ %36, %35 ], [ %36, %35 ], [ %39, %38 ], [ %39, %38 ], [ %42, %41 ], [ %42, %41 ], [ %45, %44 ], [ %45, %44 ], [ %48, %47 ], [ %48, %47 ], [ %51, %50 ], [ %51, %50 ], [ %54, %53 ], [ %54, %53 ], [ %57, %56 ], [ %57, %56 ], [ %60, %59 ], [ %60, %59 ], [ %63, %62 ], [ %63, %62 ], [ %66, %65 ], [ %66, %65 ], [ %69, %68 ], [ %69, %68 ], [ %72, %71 ], [ %72, %71 ], [ %75, %74 ], [ %75, %74 ], [ %78, %77 ]
  store i8 0, ptr %.1111.lcssa.sroa.phi, align 1, !tbaa !14
  br label %80

80:                                               ; preds = %80, %79
  %.1109 = phi ptr [ %.0108.lcssa, %79 ], [ %83, %80 ]
  %81 = load i8, ptr %.1109, align 1, !tbaa !14
  %82 = icmp eq i8 %81, 32
  %83 = getelementptr inbounds i8, ptr %.1109, i64 1
  br i1 %82, label %80, label %.preheader157, !llvm.loop !15

.preheader157thread-pre-split.1:                  ; preds = %.preheader157thread-pre-split
  %84 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 %93
  store i8 %.pr, ptr %84, align 1, !tbaa !14
  %85 = add nuw nsw i64 %.2112180, 2
  %86 = getelementptr inbounds i8, ptr %.2181, i64 2
  %.pr.1 = load i8, ptr %86, align 1, !tbaa !14
  switch i8 %.pr.1, label %87 [
    i8 32, label %.split.loop.exit296
    i8 13, label %.split.loop.exit296
  ]

87:                                               ; preds = %.preheader157thread-pre-split.1
  %88 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 %85
  store i8 %.pr.1, ptr %88, align 1, !tbaa !14
  %89 = getelementptr inbounds i8, ptr %.2181, i64 3
  %90 = add nuw nsw i64 %.2112180, 3
  %exitcond213.not.2 = icmp eq i64 %90, 255
  br i1 %exitcond213.not.2, label %.split.loop.exit, label %.preheader157thread-pre-split.2, !llvm.loop !16

.preheader157thread-pre-split.2:                  ; preds = %87
  %.pr.2 = load i8, ptr %89, align 1, !tbaa !14
  br label %.preheader157

.preheader157:                                    ; preds = %80, %.preheader157thread-pre-split.2
  %91 = phi i8 [ %.pr.2, %.preheader157thread-pre-split.2 ], [ %81, %80 ]
  %.2181 = phi ptr [ %89, %.preheader157thread-pre-split.2 ], [ %.1109, %80 ]
  %.2112180 = phi i64 [ %90, %.preheader157thread-pre-split.2 ], [ 0, %80 ]
  switch i8 %91, label %.preheader157thread-pre-split [
    i8 32, label %.split.loop.exit
    i8 13, label %.split.loop.exit
  ]

.preheader157thread-pre-split:                    ; preds = %.preheader157
  %92 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 %.2112180
  store i8 %91, ptr %92, align 1, !tbaa !14
  %93 = add nuw nsw i64 %.2112180, 1
  %94 = getelementptr inbounds i8, ptr %.2181, i64 1
  %.pr = load i8, ptr %94, align 1, !tbaa !14
  switch i8 %.pr, label %.preheader157thread-pre-split.1 [
    i8 32, label %.split.loop.exit299
    i8 13, label %.split.loop.exit299
  ]

.split.loop.exit296:                              ; preds = %.preheader157thread-pre-split.1, %.preheader157thread-pre-split.1
  %95 = getelementptr inbounds i8, ptr %.2181, i64 2
  br label %.split.loop.exit

.split.loop.exit299:                              ; preds = %.preheader157thread-pre-split, %.preheader157thread-pre-split
  %96 = getelementptr inbounds i8, ptr %.2181, i64 1
  br label %.split.loop.exit

.split.loop.exit:                                 ; preds = %.preheader157, %.preheader157, %87, %.split.loop.exit299, %.split.loop.exit296
  %.2112.lcssa = phi i64 [ %85, %.split.loop.exit296 ], [ %93, %.split.loop.exit299 ], [ 255, %87 ], [ %.2112180, %.preheader157 ], [ %.2112180, %.preheader157 ]
  %.2.lcssa = phi ptr [ %95, %.split.loop.exit296 ], [ %96, %.split.loop.exit299 ], [ %89, %87 ], [ %.2181, %.preheader157 ], [ %.2181, %.preheader157 ]
  %97 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 %.2112.lcssa
  store i8 0, ptr %97, align 1, !tbaa !14
  br label %98

98:                                               ; preds = %98, %.split.loop.exit
  %.3 = phi ptr [ %.2.lcssa, %.split.loop.exit ], [ %100, %98 ]
  %99 = load i8, ptr %.3, align 1, !tbaa !14
  %100 = getelementptr inbounds i8, ptr %.3, i64 1
  switch i8 %99, label %.preheader156.1 [
    i8 32, label %98
    i8 13, label %.loopexit274
  ]

.preheader156.1:                                  ; preds = %98
  store i8 %99, ptr %5, align 16, !tbaa !14
  %101 = load i8, ptr %100, align 1, !tbaa !14
  switch i8 %101, label %.preheader156.2 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.2:                                  ; preds = %.preheader156.1
  store i8 %101, ptr %.3113.lcssa.sroa.gep215, align 1, !tbaa !14
  %102 = getelementptr inbounds i8, ptr %.3, i64 2
  %103 = load i8, ptr %102, align 1, !tbaa !14
  switch i8 %103, label %.preheader156.3 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.3:                                  ; preds = %.preheader156.2
  store i8 %103, ptr %.3113.lcssa.sroa.gep216, align 2, !tbaa !14
  %104 = getelementptr inbounds i8, ptr %.3, i64 3
  %105 = load i8, ptr %104, align 1, !tbaa !14
  switch i8 %105, label %.preheader156.4 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.4:                                  ; preds = %.preheader156.3
  store i8 %105, ptr %.3113.lcssa.sroa.gep217, align 1, !tbaa !14
  %106 = getelementptr inbounds i8, ptr %.3, i64 4
  %107 = load i8, ptr %106, align 1, !tbaa !14
  switch i8 %107, label %.preheader156.5 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.5:                                  ; preds = %.preheader156.4
  store i8 %107, ptr %.3113.lcssa.sroa.gep218, align 4, !tbaa !14
  %108 = getelementptr inbounds i8, ptr %.3, i64 5
  %109 = load i8, ptr %108, align 1, !tbaa !14
  switch i8 %109, label %.preheader156.6 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.6:                                  ; preds = %.preheader156.5
  store i8 %109, ptr %.3113.lcssa.sroa.gep219, align 1, !tbaa !14
  %110 = getelementptr inbounds i8, ptr %.3, i64 6
  %111 = load i8, ptr %110, align 1, !tbaa !14
  switch i8 %111, label %.preheader156.7 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.7:                                  ; preds = %.preheader156.6
  store i8 %111, ptr %.3113.lcssa.sroa.gep220, align 2, !tbaa !14
  %112 = getelementptr inbounds i8, ptr %.3, i64 7
  %113 = load i8, ptr %112, align 1, !tbaa !14
  switch i8 %113, label %.preheader156.8 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.8:                                  ; preds = %.preheader156.7
  store i8 %113, ptr %.3113.lcssa.sroa.gep221, align 1, !tbaa !14
  %114 = getelementptr inbounds i8, ptr %.3, i64 8
  %115 = load i8, ptr %114, align 1, !tbaa !14
  switch i8 %115, label %.preheader156.9 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.9:                                  ; preds = %.preheader156.8
  store i8 %115, ptr %.3113.lcssa.sroa.gep222, align 8, !tbaa !14
  %116 = getelementptr inbounds i8, ptr %.3, i64 9
  %117 = load i8, ptr %116, align 1, !tbaa !14
  switch i8 %117, label %.preheader156.10 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.10:                                 ; preds = %.preheader156.9
  store i8 %117, ptr %.3113.lcssa.sroa.gep223, align 1, !tbaa !14
  %118 = getelementptr inbounds i8, ptr %.3, i64 10
  %119 = load i8, ptr %118, align 1, !tbaa !14
  switch i8 %119, label %.preheader156.11 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.11:                                 ; preds = %.preheader156.10
  store i8 %119, ptr %.3113.lcssa.sroa.gep224, align 2, !tbaa !14
  %120 = getelementptr inbounds i8, ptr %.3, i64 11
  %121 = load i8, ptr %120, align 1, !tbaa !14
  switch i8 %121, label %.preheader156.12 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.12:                                 ; preds = %.preheader156.11
  store i8 %121, ptr %.3113.lcssa.sroa.gep225, align 1, !tbaa !14
  %122 = getelementptr inbounds i8, ptr %.3, i64 12
  %123 = load i8, ptr %122, align 1, !tbaa !14
  switch i8 %123, label %.preheader156.13 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.13:                                 ; preds = %.preheader156.12
  store i8 %123, ptr %.3113.lcssa.sroa.gep226, align 4, !tbaa !14
  %124 = getelementptr inbounds i8, ptr %.3, i64 13
  %125 = load i8, ptr %124, align 1, !tbaa !14
  switch i8 %125, label %.preheader156.14 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

.preheader156.14:                                 ; preds = %.preheader156.13
  store i8 %125, ptr %.3113.lcssa.sroa.gep227, align 1, !tbaa !14
  %126 = getelementptr inbounds i8, ptr %.3, i64 14
  %127 = load i8, ptr %126, align 1, !tbaa !14
  switch i8 %127, label %128 [
    i8 32, label %.loopexit274
    i8 13, label %.loopexit274
  ]

128:                                              ; preds = %.preheader156.14
  store i8 %127, ptr %.3113.lcssa.sroa.gep228, align 2, !tbaa !14
  br label %.loopexit274

.loopexit274:                                     ; preds = %98, %128, %.preheader156.14, %.preheader156.14, %.preheader156.13, %.preheader156.13, %.preheader156.12, %.preheader156.12, %.preheader156.11, %.preheader156.11, %.preheader156.10, %.preheader156.10, %.preheader156.9, %.preheader156.9, %.preheader156.8, %.preheader156.8, %.preheader156.7, %.preheader156.7, %.preheader156.6, %.preheader156.6, %.preheader156.5, %.preheader156.5, %.preheader156.4, %.preheader156.4, %.preheader156.3, %.preheader156.3, %.preheader156.2, %.preheader156.2, %.preheader156.1, %.preheader156.1
  %.3113.lcssa.sroa.phi = phi ptr [ %.3113.lcssa.sroa.gep215, %.preheader156.1 ], [ %.3113.lcssa.sroa.gep215, %.preheader156.1 ], [ %.3113.lcssa.sroa.gep216, %.preheader156.2 ], [ %.3113.lcssa.sroa.gep216, %.preheader156.2 ], [ %.3113.lcssa.sroa.gep217, %.preheader156.3 ], [ %.3113.lcssa.sroa.gep217, %.preheader156.3 ], [ %.3113.lcssa.sroa.gep218, %.preheader156.4 ], [ %.3113.lcssa.sroa.gep218, %.preheader156.4 ], [ %.3113.lcssa.sroa.gep219, %.preheader156.5 ], [ %.3113.lcssa.sroa.gep219, %.preheader156.5 ], [ %.3113.lcssa.sroa.gep220, %.preheader156.6 ], [ %.3113.lcssa.sroa.gep220, %.preheader156.6 ], [ %.3113.lcssa.sroa.gep221, %.preheader156.7 ], [ %.3113.lcssa.sroa.gep221, %.preheader156.7 ], [ %.3113.lcssa.sroa.gep222, %.preheader156.8 ], [ %.3113.lcssa.sroa.gep222, %.preheader156.8 ], [ %.3113.lcssa.sroa.gep223, %.preheader156.9 ], [ %.3113.lcssa.sroa.gep223, %.preheader156.9 ], [ %.3113.lcssa.sroa.gep224, %.preheader156.10 ], [ %.3113.lcssa.sroa.gep224, %.preheader156.10 ], [ %.3113.lcssa.sroa.gep225, %.preheader156.11 ], [ %.3113.lcssa.sroa.gep225, %.preheader156.11 ], [ %.3113.lcssa.sroa.gep226, %.preheader156.12 ], [ %.3113.lcssa.sroa.gep226, %.preheader156.12 ], [ %.3113.lcssa.sroa.gep227, %.preheader156.13 ], [ %.3113.lcssa.sroa.gep227, %.preheader156.13 ], [ %.3113.lcssa.sroa.gep228, %.preheader156.14 ], [ %.3113.lcssa.sroa.gep228, %.preheader156.14 ], [ %.3113.lcssa.sroa.gep229, %128 ], [ %5, %98 ]
  store i8 0, ptr %.3113.lcssa.sroa.phi, align 1, !tbaa !14
  %129 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %130 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.17) #14
  %.not136 = icmp eq i32 %130, 0
  br i1 %.not136, label %.preheader, label %.preheader155

.preheader:                                       ; preds = %.loopexit274
  %131 = load i32, ptr @modes_array, align 16, !tbaa !17
  %.not137186 = icmp eq i32 %131, 0
  br i1 %.not137186, label %.thread145, label %.lr.ph188.preheader

.lr.ph188.preheader:                              ; preds = %.preheader
  %132 = load ptr, ptr getelementptr inbounds (i8, ptr @modes_array, i64 8), align 8, !tbaa !20
  %133 = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) %132) #14
  %.not138269 = icmp eq ptr %133, null
  br i1 %.not138269, label %.lr.ph271, label %.lr.ph188._crit_edge

.preheader155:                                    ; preds = %.loopexit274, %143
  %.0185 = phi ptr [ %.1, %143 ], [ @__const.handle_http_connection.response405, %.loopexit274 ]
  %.0116184 = phi i64 [ %.1117, %143 ], [ 47, %.loopexit274 ]
  %134 = call i64 @write(i32 noundef %0, ptr noundef %.0185, i64 noundef %.0116184) #11
  %135 = icmp slt i64 %134, 0
  br i1 %135, label %136, label %140

136:                                              ; preds = %.preheader155
  %137 = tail call ptr @__errno_location() #12
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %.not144 = icmp eq i32 %138, 4
  br i1 %.not144, label %143, label %139

139:                                              ; preds = %136
  call void @perror(ptr noundef nonnull @.str.11) #13
  br label %.thread147

140:                                              ; preds = %.preheader155
  %141 = sub nsw i64 %.0116184, %134
  %142 = getelementptr inbounds i8, ptr %.0185, i64 %134
  br label %143

143:                                              ; preds = %136, %140
  %.1117 = phi i64 [ %.0116184, %136 ], [ %141, %140 ]
  %.1 = phi ptr [ %.0185, %136 ], [ %142, %140 ]
  %144 = icmp sgt i64 %.1117, 0
  br i1 %144, label %.preheader155, label %.thread147, !llvm.loop !21

.lr.ph271:                                        ; preds = %.lr.ph188.preheader, %.lr.ph188
  %.4114187270 = phi i64 [ %145, %.lr.ph188 ], [ 0, %.lr.ph188.preheader ]
  %145 = add i64 %.4114187270, 1
  %146 = getelementptr inbounds [6 x %struct.anon], ptr @modes_array, i64 0, i64 %145
  %147 = load i32, ptr %146, align 16, !tbaa !17
  %.not137 = icmp eq i32 %147, 0
  br i1 %.not137, label %.thread145, label %.lr.ph188, !llvm.loop !22

.lr.ph188:                                        ; preds = %.lr.ph271
  %148 = getelementptr inbounds i8, ptr %146, i64 8
  %149 = load ptr, ptr %148, align 8, !tbaa !20
  %150 = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) %149) #14
  %.not138 = icmp eq ptr %150, null
  br i1 %.not138, label %.lr.ph271, label %.lr.ph188._crit_edge, !llvm.loop !22

.lr.ph188._crit_edge:                             ; preds = %.lr.ph188, %.lr.ph188.preheader
  %.lcssa = phi i32 [ %131, %.lr.ph188.preheader ], [ %147, %.lr.ph188 ]
  switch i32 %.lcssa, label %.thread145 [
    i32 5, label %151
    i32 1, label %187
    i32 2, label %158
    i32 4, label %170
  ]

151:                                              ; preds = %.lr.ph188._crit_edge
  %152 = call noalias dereferenceable_or_null(2048) ptr @malloc(i64 noundef 2048) #15
  %.not141 = icmp eq ptr %152, null
  br i1 %.not141, label %.thread147, label %153

153:                                              ; preds = %151
  %154 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %152, i64 noundef 2048, ptr noundef nonnull @.str.18) #11
  %155 = sext i32 %154 to i64
  %156 = icmp ult i32 %154, 2048
  br i1 %156, label %.lr.ph191.preheader, label %._crit_edge192

.lr.ph191.preheader:                              ; preds = %153
  %scevgep = getelementptr i8, ptr %152, i64 %155
  %157 = sub nuw nsw i64 2048, %155
  call void @llvm.memset.p0.i64(ptr align 1 %scevgep, i8 32, i64 %157, i1 false), !tbaa !14
  br label %._crit_edge192

._crit_edge192:                                   ; preds = %.lr.ph191.preheader, %153
  store i64 %155, ptr %6, align 8, !tbaa !23
  br label %.thread151

158:                                              ; preds = %.lr.ph188._crit_edge
  %159 = call noalias dereferenceable_or_null(16640) ptr @malloc(i64 noundef 16640) #15
  %.not140 = icmp eq ptr %159, null
  br i1 %.not140, label %.thread147, label %160

160:                                              ; preds = %158
  %161 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %159, i64 noundef 16640, ptr noundef nonnull @.str.19, i64 noundef 16384) #11
  %162 = sext i32 %161 to i64
  %163 = add nsw i64 %162, 18432
  store i64 %163, ptr %6, align 8, !tbaa !23
  %164 = call ptr @realloc(ptr noundef nonnull %159, i64 noundef %163) #16
  %165 = icmp eq ptr %164, null
  br i1 %165, label %166, label %167

166:                                              ; preds = %160
  call void @free(ptr noundef nonnull %159) #11
  br label %.thread147

167:                                              ; preds = %160
  %168 = getelementptr inbounds i8, ptr %164, i64 %162
  call void @build_content(ptr noundef nonnull %168, i64 noundef 16384)
  %169 = getelementptr inbounds i8, ptr %168, i64 16384
  call void @build_crap(ptr noundef nonnull %169, i64 noundef 2048)
  br label %.thread151

170:                                              ; preds = %.lr.ph188._crit_edge
  %171 = call noalias dereferenceable_or_null(454) ptr @malloc(i64 noundef 454) #15
  %.not139 = icmp eq ptr %171, null
  br i1 %.not139, label %.thread147, label %172

172:                                              ; preds = %170
  %173 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %171, i64 noundef 454, ptr noundef nonnull @.str.20, i64 noundef 198) #11
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i8, ptr %171, i64 %174
  call void @build_favicon_content(ptr noundef nonnull %175, i64 noundef 198)
  %176 = add nsw i64 %174, 198
  store i64 %176, ptr %6, align 8, !tbaa !23
  br label %.thread151

.thread145:                                       ; preds = %.lr.ph271, %.preheader, %.lr.ph188._crit_edge
  %177 = call noalias dereferenceable_or_null(16640) ptr @malloc(i64 noundef 16640) #15
  %.not142 = icmp eq ptr %177, null
  br i1 %.not142, label %.thread147, label %178

178:                                              ; preds = %.thread145
  %179 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %177, i64 noundef 16640, ptr noundef nonnull @.str.21) #11
  %180 = sext i32 %179 to i64
  %181 = add nsw i64 %180, 16384
  store i64 %181, ptr %6, align 8, !tbaa !23
  %182 = call ptr @realloc(ptr noundef nonnull %177, i64 noundef %181) #16
  %183 = icmp eq ptr %182, null
  br i1 %183, label %184, label %185

184:                                              ; preds = %178
  call void @free(ptr noundef nonnull %177) #11
  br label %.thread147

185:                                              ; preds = %178
  %186 = getelementptr inbounds i8, ptr %182, i64 %180
  call void @build_content(ptr noundef nonnull %186, i64 noundef 16384)
  br label %.thread151

187:                                              ; preds = %.lr.ph188._crit_edge
  %188 = call ptr @build_chunked_response(i64 noundef 16384, ptr noundef nonnull %6)
  %.not143 = icmp eq ptr %188, null
  br i1 %.not143, label %.thread147, label %..thread151_crit_edge

..thread151_crit_edge:                            ; preds = %187
  %.pre = load i64, ptr %6, align 8, !tbaa !23
  br label %.thread151

.thread151:                                       ; preds = %..thread151_crit_edge, %._crit_edge192, %167, %172, %185
  %189 = phi i64 [ %.pre, %..thread151_crit_edge ], [ %155, %._crit_edge192 ], [ %163, %167 ], [ %176, %172 ], [ %181, %185 ]
  %.0107154 = phi ptr [ %188, %..thread151_crit_edge ], [ %152, %._crit_edge192 ], [ %164, %167 ], [ %171, %172 ], [ %182, %185 ]
  call void @send_response(i32 noundef %0, ptr noundef nonnull %.0107154, i64 noundef %189)
  call void @free(ptr noundef nonnull %.0107154) #11
  br label %.thread147

.thread147:                                       ; preds = %143, %151, %158, %166, %170, %.thread145, %184, %.thread151, %187, %139, %.thread, %.loopexit207
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #11
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #11
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %2) #11
  ret void
}

; Function Attrs: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strstr(ptr noundef, ptr nocapture noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #8

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #9

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #10

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #5 = { nofree "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 #6 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 #8 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #9 = { nofree nounwind willreturn memory(argmem: read) }
attributes #10 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(none) }
attributes #13 = { cold }
attributes #14 = { nounwind willreturn memory(read) }
attributes #15 = { nounwind allocsize(0) }
attributes #16 = { nounwind allocsize(1) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!18, !6, i64 0}
!18 = !{!"", !6, i64 0, !19, i64 8}
!19 = !{!"any pointer", !7, i64 0}
!20 = !{!18, !19, i64 8}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = !{!24, !24, i64 0}
!24 = !{!"long", !7, i64 0}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass