; LLVM IR from ohler55/agoo :: ext/agoo (con)

; 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._agooLogCat = type { ptr, [32 x i8], ptr, i32, i8 }
%struct._agooCon = type { ptr, i32, ptr, ptr, i64, [46 x i8], [8192 x i8], i64, i64, i64, double, i8, i8, i8, ptr, ptr, ptr, %union.pthread_mutex_t, ptr, ptr, ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct._agooBind = type { ptr, i32, i32, i16, %union.anon.0, ptr, ptr, ptr, ptr, ptr, i32 }
%union.anon.0 = type { %struct.in6_addr }
%struct.in6_addr = type { %union.anon }
%union.anon = type { [4 x i32] }
%struct._agooReq = type { i32, ptr, i32, ptr, %struct._agooStr, %struct._agooStr, %struct._agooStr, %struct._agooStr, %struct._agooStr, [46 x i8], ptr, ptr, i64, [8 x i8] }
%struct._agooStr = type { ptr, i32 }
%struct._agooRes = type { ptr, ptr, ptr, %union.pthread_mutex_t, i8, i32, i8, i8, i8 }
%struct._agooHook = type { ptr, i32, ptr, i32, %union.anon.1, ptr, i8 }
%union.anon.1 = type { ptr }

@con_timeout = external dso_local global double, align 8
@agoo_error_cat = external global %struct._agooLogCat, align 8
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@agoo_warn_cat = external global %struct._agooLogCat, align 8
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@agoo_debug_cat = external global %struct._agooLogCat, align 8
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [57 x i8], align 1

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

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

declare double @dtime() #1

declare void @agoo_req_destroy(ptr noundef) #1

declare void @agoo_log_cat(ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @agoo_con_http_read(ptr noundef %0) #2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !9
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct._agooCon, ptr %10, i32 0, i32 12
  %12 = load i8, ptr %11, align 1, !tbaa !11, !range !16, !noundef !17
  %13 = trunc i8 %12 to i1
  br i1 %13, label %24, label %14

14:                                               ; preds = %1
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._agooCon, ptr %15, i32 0, i32 1
  %17 = load i32, ptr %16, align 8, !tbaa !18
  %18 = icmp eq i32 0, %17
  br i1 %18, label %24, label %19

19:                                               ; preds = %14
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct._agooCon, ptr %20, i32 0, i32 11
  %22 = load i8, ptr %21, align 8, !tbaa !19, !range !16, !noundef !17
  %23 = trunc i8 %22 to i1
  br i1 %23, label %24, label %25

24:                                               ; preds = %19, %14, %1
  store i1 true, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %336

25:                                               ; preds = %19
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._agooCon, ptr %26, i32 0, i32 2
  %28 = load ptr, ptr %27, align 8, !tbaa !20
  %29 = getelementptr inbounds %struct._agooBind, ptr %28, i32 0, i32 10
  %30 = load i32, ptr %29, align 8, !tbaa !21
  %31 = icmp eq i32 84, %30
  br i1 %31, label %32, label %35

32:                                               ; preds = %25
  call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef @agoo_error_cat, ptr noundef @.str.3)
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._agooCon, ptr %33, i32 0, i32 12
  store i8 1, ptr %34, align 1, !tbaa !11
  br label %81

35:                                               ; preds = %25
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._agooCon, ptr %36, i32 0, i32 14
  %38 = load ptr, ptr %37, align 8, !tbaa !24
  %39 = icmp ne ptr null, %38
  br i1 %39, label %40, label %63

40:                                               ; preds = %35
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._agooCon, ptr %41, i32 0, i32 1
  %43 = load i32, ptr %42, align 8, !tbaa !18
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._agooCon, ptr %44, i32 0, i32 14
  %46 = load ptr, ptr %45, align 8, !tbaa !24
  %47 = getelementptr inbounds %struct._agooReq, ptr %46, i32 0, i32 13
  %48 = getelementptr inbounds [8 x i8], ptr %47, i64 0, i64 0
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._agooCon, ptr %49, i32 0, i32 7
  %51 = load i64, ptr %50, align 8, !tbaa !25
  %52 = getelementptr inbounds i8, ptr %48, i64 %51
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._agooCon, ptr %53, i32 0, i32 14
  %55 = load ptr, ptr %54, align 8, !tbaa !24
  %56 = getelementptr inbounds %struct._agooReq, ptr %55, i32 0, i32 12
  %57 = load i64, ptr %56, align 8, !tbaa !26
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._agooCon, ptr %58, i32 0, i32 7
  %60 = load i64, ptr %59, align 8, !tbaa !25
  %61 = sub i64 %57, %60
  %62 = call i64 @recv(i32 noundef %43, ptr noundef %52, i64 noundef %61, i32 noundef 0)
  store i64 %62, ptr %4, align 8, !tbaa !9
  br label %80

63:                                               ; preds = %35
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._agooCon, ptr %64, i32 0, i32 1
  %66 = load i32, ptr %65, align 8, !tbaa !18
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._agooCon, ptr %67, i32 0, i32 6
  %69 = getelementptr inbounds [8192 x i8], ptr %68, i64 0, i64 0
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._agooCon, ptr %70, i32 0, i32 7
  %72 = load i64, ptr %71, align 8, !tbaa !25
  %73 = getelementptr inbounds i8, ptr %69, i64 %72
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._agooCon, ptr %74, i32 0, i32 7
  %76 = load i64, ptr %75, align 8, !tbaa !25
  %77 = sub i64 8192, %76
  %78 = sub i64 %77, 1
  %79 = call i64 @recv(i32 noundef %66, ptr noundef %73, i64 noundef %78, i32 noundef 0)
  store i64 %79, ptr %4, align 8, !tbaa !9
  br label %80

80:                                               ; preds = %63, %40
  br label %81

81:                                               ; preds = %80, %32
  %82 = call double @dtime()
  %83 = load double, ptr @con_timeout, align 8, !tbaa !29
  %84 = fadd double %82, %83
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._agooCon, ptr %85, i32 0, i32 10
  store double %84, ptr %86, align 8, !tbaa !30
  %87 = load i64, ptr %4, align 8, !tbaa !9
  %88 = icmp sge i64 0, %87
  br i1 %88, label %89, label %109

89:                                               ; preds = %81
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._agooCon, ptr %90, i32 0, i32 7
  %92 = load i64, ptr %91, align 8, !tbaa !25
  %93 = icmp ult i64 0, %92
  br i1 %93, label %94, label %106

94:                                               ; preds = %89
  %95 = load i64, ptr %4, align 8, !tbaa !9
  %96 = icmp eq i64 0, %95
  br i1 %96, label %97, label %101

97:                                               ; preds = %94
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._agooCon, ptr %98, i32 0, i32 4
  %100 = load i64, ptr %99, align 8, !tbaa !31
  call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef @agoo_warn_cat, ptr noundef @.str.4, i64 noundef %100)
  br label %105

101:                                              ; preds = %94
  %102 = call ptr @__errno_location() #7
  %103 = load i32, ptr %102, align 4, !tbaa !32
  %104 = call ptr @strerror(i32 noundef %103) #6
  call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef @agoo_warn_cat, ptr noundef @.str.5, ptr noundef %104)
  br label %105

105:                                              ; preds = %101, %97
  br label %106

106:                                              ; preds = %105, %89
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._agooCon, ptr %107, i32 0, i32 12
  store i8 1, ptr %108, align 1, !tbaa !11
  store i1 true, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %336

109:                                              ; preds = %81
  %110 = load i64, ptr %4, align 8, !tbaa !9
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._agooCon, ptr %111, i32 0, i32 7
  %113 = load i64, ptr %112, align 8, !tbaa !25
  %114 = add i64 %113, %110
  store i64 %114, ptr %112, align 8, !tbaa !25
  br label %115

115:                                              ; preds = %331, %164, %109
  br label %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._agooCon, ptr %117, i32 0, i32 14
  %119 = load ptr, ptr %118, align 8, !tbaa !24
  %120 = icmp eq ptr null, %119
  br i1 %120, label %121, label %167

121:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = call i32 @con_header_read(ptr noundef %122, ptr noundef %6)
  switch i32 %123, label %157 [
    i32 65, label %124
    i32 79, label %163
    i32 72, label %125
    i32 69, label %156
  ]

124:                                              ; preds = %121
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %164

125:                                              ; preds = %121
  %126 = load i64, ptr %6, align 8, !tbaa !9
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._agooCon, ptr %127, i32 0, i32 7
  %129 = load i64, ptr %128, align 8, !tbaa !25
  %130 = icmp ult i64 %126, %129
  br i1 %130, label %131, label %150

131:                                              ; preds = %125
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._agooCon, ptr %132, i32 0, i32 6
  %134 = getelementptr inbounds [8192 x i8], ptr %133, i64 0, i64 0
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._agooCon, ptr %135, i32 0, i32 6
  %137 = getelementptr inbounds [8192 x i8], ptr %136, i64 0, i64 0
  %138 = load i64, ptr %6, align 8, !tbaa !9
  %139 = getelementptr inbounds i8, ptr %137, i64 %138
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._agooCon, ptr %140, i32 0, i32 7
  %142 = load i64, ptr %141, align 8, !tbaa !25
  %143 = load i64, ptr %6, align 8, !tbaa !9
  %144 = sub i64 %142, %143
  call void @llvm.memmove.p0.p0.i64(ptr align 2 %134, ptr align 1 %139, i64 %144, i1 false)
  %145 = load i64, ptr %6, align 8, !tbaa !9
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._agooCon, ptr %146, i32 0, i32 7
  %148 = load i64, ptr %147, align 8, !tbaa !25
  %149 = sub i64 %148, %145
  store i64 %149, ptr %147, align 8, !tbaa !25
  store i32 2, ptr %5, align 4
  br label %164

150:                                              ; preds = %125
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._agooCon, ptr %151, i32 0, i32 7
  store i64 0, ptr %152, align 8, !tbaa !25
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct._agooCon, ptr %153, i32 0, i32 6
  %155 = getelementptr inbounds [8192 x i8], ptr %154, i64 0, i64 0
  store i8 0, ptr %155, align 2, !tbaa !33
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %164

156:                                              ; preds = %121
  br label %157

157:                                              ; preds = %156, %121
  %158 = load ptr, ptr %3, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._agooCon, ptr %158, i32 0, i32 7
  store i64 0, ptr %159, align 8, !tbaa !25
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._agooCon, ptr %160, i32 0, i32 6
  %162 = getelementptr inbounds [8192 x i8], ptr %161, i64 0, i64 0
  store i8 0, ptr %162, align 2, !tbaa !33
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %164

163:                                              ; preds = %121
  store i32 0, ptr %5, align 4
  br label %164

164:                                              ; preds = %163, %157, %150, %131, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %165 = load i32, ptr %5, align 4
  switch i32 %165, label %336 [
    i32 0, label %166
    i32 2, label %115
  ]

166:                                              ; preds = %164
  br label %167

167:                                              ; preds = %166, %116
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct._agooCon, ptr %168, i32 0, i32 14
  %170 = load ptr, ptr %169, align 8, !tbaa !24
  %171 = icmp ne ptr null, %170
  br i1 %171, label %172, label %334

172:                                              ; preds = %167
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._agooCon, ptr %173, i32 0, i32 14
  %175 = load ptr, ptr %174, align 8, !tbaa !24
  %176 = getelementptr inbounds %struct._agooReq, ptr %175, i32 0, i32 12
  %177 = load i64, ptr %176, align 8, !tbaa !26
  %178 = load ptr, ptr %3, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct._agooCon, ptr %178, i32 0, i32 7
  %180 = load i64, ptr %179, align 8, !tbaa !25
  %181 = icmp ule i64 %177, %180
  br i1 %181, label %182, label %333

182:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %183 = load i8, ptr getelementptr inbounds (%struct._agooLogCat, ptr @agoo_debug_cat, i32 0, i32 4), align 4, !tbaa !34, !range !16, !noundef !17
  %184 = trunc i8 %183 to i1
  br i1 %184, label %185, label %214

185:                                              ; preds = %182
  %186 = load ptr, ptr %3, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct._agooCon, ptr %186, i32 0, i32 14
  %188 = load ptr, ptr %187, align 8, !tbaa !24
  %189 = icmp ne ptr null, %188
  br i1 %189, label %190, label %214

190:                                              ; preds = %185
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct._agooCon, ptr %191, i32 0, i32 14
  %193 = load ptr, ptr %192, align 8, !tbaa !24
  %194 = getelementptr inbounds %struct._agooReq, ptr %193, i32 0, i32 8
  %195 = getelementptr inbounds %struct._agooStr, ptr %194, i32 0, i32 0
  %196 = load ptr, ptr %195, align 8, !tbaa !36
  %197 = icmp ne ptr null, %196
  br i1 %197, label %198, label %214

198:                                              ; preds = %190
  %199 = load ptr, ptr %3, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct._agooCon, ptr %199, i32 0, i32 2
  %201 = load ptr, ptr %200, align 8, !tbaa !20
  %202 = getelementptr inbounds %struct._agooBind, ptr %201, i32 0, i32 10
  %203 = load i32, ptr %202, align 8, !tbaa !21
  %204 = call ptr @agoo_con_kind_str(i32 noundef %203)
  %205 = load ptr, ptr %3, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct._agooCon, ptr %205, i32 0, i32 4
  %207 = load i64, ptr %206, align 8, !tbaa !31
  %208 = load ptr, ptr %3, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct._agooCon, ptr %208, i32 0, i32 14
  %210 = load ptr, ptr %209, align 8, !tbaa !24
  %211 = getelementptr inbounds %struct._agooReq, ptr %210, i32 0, i32 8
  %212 = getelementptr inbounds %struct._agooStr, ptr %211, i32 0, i32 0
  %213 = load ptr, ptr %212, align 8, !tbaa !36
  call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef @agoo_debug_cat, ptr noundef @.str.6, ptr noundef %204, i64 noundef %207, ptr noundef %213)
  br label %214

214:                                              ; preds = %198, %190, %185, %182
  %215 = load ptr, ptr %3, align 8, !tbaa !5
  %216 = call ptr @agoo_res_create(ptr noundef %215)
  store ptr %216, ptr %8, align 8, !tbaa !5
  %217 = icmp eq ptr null, %216
  br i1 %217, label %218, label %227

218:                                              ; preds = %214
  %219 = load ptr, ptr %3, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct._agooCon, ptr %219, i32 0, i32 14
  store ptr null, ptr %220, align 8, !tbaa !24
  %221 = load ptr, ptr %3, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct._agooCon, ptr %221, i32 0, i32 4
  %223 = load i64, ptr %222, align 8, !tbaa !31
  call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef @agoo_error_cat, ptr noundef @.str.7, i64 noundef %223)
  %224 = load ptr, ptr %3, align 8, !tbaa !5
  %225 = call i32 @bad_request(ptr noundef %224, i32 noundef 500, i32 noundef 626)
  %226 = icmp ne i32 %225, 0
  store i1 %226, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %331

227:                                              ; preds = %214
  %228 = load ptr, ptr %3, align 8, !tbaa !5
  %229 = load ptr, ptr %8, align 8, !tbaa !5
  call void @agoo_con_res_append(ptr noundef %228, ptr noundef %229)
  %230 = load ptr, ptr %3, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct._agooCon, ptr %230, i32 0, i32 14
  %232 = load ptr, ptr %231, align 8, !tbaa !24
  %233 = getelementptr inbounds %struct._agooReq, ptr %232, i32 0, i32 7
  %234 = getelementptr inbounds %struct._agooStr, ptr %233, i32 0, i32 0
  %235 = load ptr, ptr %234, align 8, !tbaa !37
  %236 = load ptr, ptr %3, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct._agooCon, ptr %236, i32 0, i32 14
  %238 = load ptr, ptr %237, align 8, !tbaa !24
  %239 = getelementptr inbounds %struct._agooReq, ptr %238, i32 0, i32 7
  %240 = getelementptr inbounds %struct._agooStr, ptr %239, i32 0, i32 1
  %241 = load i32, ptr %240, align 8, !tbaa !38
  %242 = call zeroext i1 @should_close(ptr noundef %235, i32 noundef %241)
  %243 = load ptr, ptr %8, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct._agooRes, ptr %243, i32 0, i32 6
  %245 = zext i1 %242 to i8
  store i8 %245, ptr %244, align 8, !tbaa !39
  %246 = load ptr, ptr %8, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct._agooRes, ptr %246, i32 0, i32 6
  %248 = load i8, ptr %247, align 8, !tbaa !39, !range !16, !noundef !17
  %249 = trunc i8 %248 to i1
  br i1 %249, label %250, label %253

250:                                              ; preds = %227
  %251 = load ptr, ptr %3, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct._agooCon, ptr %251, i32 0, i32 11
  store i8 1, ptr %252, align 8, !tbaa !19
  br label %253

253:                                              ; preds = %250, %227
  br label %254

254:                                              ; preds = %253
  %255 = load ptr, ptr %8, align 8, !tbaa !5
  %256 = load ptr, ptr %3, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct._agooCon, ptr %256, i32 0, i32 14
  %258 = load ptr, ptr %257, align 8, !tbaa !24
  %259 = getelementptr inbounds %struct._agooReq, ptr %258, i32 0, i32 1
  store ptr %255, ptr %259, align 8, !tbaa !41
  %260 = load ptr, ptr %3, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct._agooCon, ptr %260, i32 0, i32 14
  %262 = load ptr, ptr %261, align 8, !tbaa !24
  %263 = getelementptr inbounds %struct._agooReq, ptr %262, i32 0, i32 12
  %264 = load i64, ptr %263, align 8, !tbaa !26
  store i64 %264, ptr %9, align 8, !tbaa !9
  %265 = load ptr, ptr %3, align 8, !tbaa !5
  call void @check_upgrade(ptr noundef %265)
  %266 = load ptr, ptr %3, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct._agooCon, ptr %266, i32 0, i32 14
  %268 = load ptr, ptr %267, align 8, !tbaa !24
  store ptr %268, ptr %7, align 8, !tbaa !5
  %269 = load ptr, ptr %3, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct._agooCon, ptr %269, i32 0, i32 14
  store ptr null, ptr %270, align 8, !tbaa !24
  %271 = load ptr, ptr %7, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct._agooReq, ptr %271, i32 0, i32 11
  %273 = load ptr, ptr %272, align 8, !tbaa !42
  %274 = getelementptr inbounds %struct._agooHook, ptr %273, i32 0, i32 6
  %275 = load i8, ptr %274, align 8, !tbaa !43, !range !16, !noundef !17
  %276 = trunc i8 %275 to i1
  br i1 %276, label %277, label %292

277:                                              ; preds = %254
  %278 = load ptr, ptr %7, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct._agooReq, ptr %278, i32 0, i32 11
  %280 = load ptr, ptr %279, align 8, !tbaa !42
  %281 = getelementptr inbounds %struct._agooHook, ptr %280, i32 0, i32 3
  %282 = load i32, ptr %281, align 8, !tbaa !45
  %283 = icmp eq i32 70, %282
  br i1 %283, label %284, label %292

284:                                              ; preds = %277
  %285 = load ptr, ptr %7, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct._agooReq, ptr %285, i32 0, i32 11
  %287 = load ptr, ptr %286, align 8, !tbaa !42
  %288 = getelementptr inbounds %struct._agooHook, ptr %287, i32 0, i32 4
  %289 = load ptr, ptr %288, align 8, !tbaa !33
  %290 = load ptr, ptr %7, align 8, !tbaa !5
  call void %289(ptr noundef %290)
  %291 = load ptr, ptr %7, align 8, !tbaa !5
  call void @agoo_req_destroy(ptr noundef %291)
  br label %299

292:                                              ; preds = %277, %254
  %293 = load ptr, ptr %7, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct._agooReq, ptr %293, i32 0, i32 11
  %295 = load ptr, ptr %294, align 8, !tbaa !42
  %296 = getelementptr inbounds %struct._agooHook, ptr %295, i32 0, i32 5
  %297 = load ptr, ptr %296, align 8, !tbaa !46
  %298 = load ptr, ptr %7, align 8, !tbaa !5
  call void @agoo_queue_push(ptr noundef %297, ptr noundef %298)
  br label %299

299:                                              ; preds = %292, %284
  %300 = load i64, ptr %9, align 8, !tbaa !9
  %301 = load ptr, ptr %3, align 8, !tbaa !5
  %302 = getelementptr inbounds %struct._agooCon, ptr %301, i32 0, i32 7
  %303 = load i64, ptr %302, align 8, !tbaa !25
  %304 = icmp slt i64 %300, %303
  br i1 %304, label %305, label %324

305:                                              ; preds = %299
  %306 = load ptr, ptr %3, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct._agooCon, ptr %306, i32 0, i32 6
  %308 = getelementptr inbounds [8192 x i8], ptr %307, i64 0, i64 0
  %309 = load ptr, ptr %3, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct._agooCon, ptr %309, i32 0, i32 6
  %311 = getelementptr inbounds [8192 x i8], ptr %310, i64 0, i64 0
  %312 = load i64, ptr %9, align 8, !tbaa !9
  %313 = getelementptr inbounds i8, ptr %311, i64 %312
  %314 = load ptr, ptr %3, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct._agooCon, ptr %314, i32 0, i32 7
  %316 = load i64, ptr %315, align 8, !tbaa !25
  %317 = load i64, ptr %9, align 8, !tbaa !9
  %318 = sub i64 %316, %317
  call void @llvm.memmove.p0.p0.i64(ptr align 2 %308, ptr align 1 %313, i64 %318, i1 false)
  %319 = load i64, ptr %9, align 8, !tbaa !9
  %320 = load ptr, ptr %3, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct._agooCon, ptr %320, i32 0, i32 7
  %322 = load i64, ptr %321, align 8, !tbaa !25
  %323 = sub i64 %322, %319
  store i64 %323, ptr %321, align 8, !tbaa !25
  br label %330

324:                                              ; preds = %299
  %325 = load ptr, ptr %3, align 8, !tbaa !5
  %326 = getelementptr inbounds %struct._agooCon, ptr %325, i32 0, i32 7
  store i64 0, ptr %326, align 8, !tbaa !25
  %327 = load ptr, ptr %3, align 8, !tbaa !5
  %328 = getelementptr inbounds %struct._agooCon, ptr %327, i32 0, i32 6
  %329 = getelementptr inbounds [8192 x i8], ptr %328, i64 0, i64 0
  store i8 0, ptr %329, align 2, !tbaa !33
  store i32 3, ptr %5, align 4
  br label %331

330:                                              ; preds = %305
  store i32 2, ptr %5, align 4
  br label %331

331:                                              ; preds = %330, %324, %218
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %332 = load i32, ptr %5, align 4
  switch i32 %332, label %336 [
    i32 3, label %335
    i32 2, label %115
  ]

333:                                              ; preds = %172
  br label %334

334:                                              ; preds = %333, %167
  br label %335

335:                                              ; preds = %334, %331
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %336

336:                                              ; preds = %335, %331, %164, %106, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %337 = load i1, ptr %2, align 1
  ret i1 %337
}

declare i64 @recv(i32 noundef, ptr noundef, i64 noundef, i32 noundef) #1

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #3

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

; Function Attrs: nounwind uwtable
declare hidden i32 @con_header_read(ptr noundef, ptr noundef) #2

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

declare ptr @agoo_con_kind_str(i32 noundef) #1

declare ptr @agoo_res_create(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @bad_request(ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @should_close(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @check_upgrade(ptr noundef) #2

declare void @agoo_queue_push(ptr noundef, ptr noundef) #1

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 "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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(none) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !15, i64 8313}
!12 = !{!"_agooCon", !6, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !7, i64 40, !7, i64 86, !10, i64 8280, !10, i64 8288, !10, i64 8296, !14, i64 8304, !15, i64 8312, !15, i64 8313, !15, i64 8314, !6, i64 8320, !6, i64 8328, !6, i64 8336, !7, i64 8344, !6, i64 8384, !6, i64 8392, !6, i64 8400}
!13 = !{!"int", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!12, !13, i64 8}
!19 = !{!12, !15, i64 8312}
!20 = !{!12, !6, i64 16}
!21 = !{!22, !13, i64 80}
!22 = !{!"_agooBind", !6, i64 0, !13, i64 8, !13, i64 12, !23, i64 16, !7, i64 20, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !13, i64 80}
!23 = !{!"short", !7, i64 0}
!24 = !{!12, !6, i64 8320}
!25 = !{!12, !10, i64 8280}
!26 = !{!27, !10, i64 176}
!27 = !{!"_agooReq", !13, i64 0, !6, i64 8, !13, i64 16, !6, i64 24, !28, i64 32, !28, i64 48, !28, i64 64, !28, i64 80, !28, i64 96, !7, i64 112, !6, i64 160, !6, i64 168, !10, i64 176, !7, i64 184}
!28 = !{!"_agooStr", !6, i64 0, !13, i64 8}
!29 = !{!14, !14, i64 0}
!30 = !{!12, !14, i64 8304}
!31 = !{!12, !10, i64 32}
!32 = !{!13, !13, i64 0}
!33 = !{!7, !7, i64 0}
!34 = !{!35, !15, i64 52}
!35 = !{!"_agooLogCat", !6, i64 0, !7, i64 8, !6, i64 40, !13, i64 48, !15, i64 52}
!36 = !{!27, !6, i64 96}
!37 = !{!27, !6, i64 80}
!38 = !{!27, !13, i64 88}
!39 = !{!40, !15, i64 72}
!40 = !{!"_agooRes", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !15, i64 64, !13, i64 68, !15, i64 72, !15, i64 73, !15, i64 74}
!41 = !{!27, !6, i64 8}
!42 = !{!27, !6, i64 168}
!43 = !{!44, !15, i64 48}
!44 = !{!"_agooHook", !6, i64 0, !13, i64 8, !6, i64 16, !13, i64 24, !7, i64 32, !6, i64 40, !15, i64 48}
!45 = !{!44, !13, i64 24}
!46 = !{!44, !6, i64 40}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._agooLogCat = type { ptr, [32 x i8], ptr, i32, i8 }

@con_timeout = external dso_local local_unnamed_addr global double, align 8
@agoo_error_cat = external global %struct._agooLogCat, align 8
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@agoo_warn_cat = external global %struct._agooLogCat, align 8
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@agoo_debug_cat = external global %struct._agooLogCat, align 8
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [57 x i8], align 1

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

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

declare double @dtime() local_unnamed_addr #1

declare void @agoo_req_destroy(ptr noundef) local_unnamed_addr #1

declare void @agoo_log_cat(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @agoo_con_http_read(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca i64, align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 8313
  %4 = load i8, ptr %3, align 1, !tbaa !5, !range !14, !noundef !15
  %5 = trunc nuw i8 %4 to i1
  br i1 %5, label %.loopexit, label %6

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

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %0, i64 8312
  %12 = load i8, ptr %11, align 8, !tbaa !17, !range !14, !noundef !15
  %13 = trunc nuw i8 %12 to i1
  br i1 %13, label %.loopexit, label %14

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load ptr, ptr %15, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %16, i64 80
  %18 = load i32, ptr %17, align 8, !tbaa !19
  %19 = icmp eq i32 %18, 84
  br i1 %19, label %20, label %21

20:                                               ; preds = %14
  tail call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef nonnull @agoo_error_cat, ptr noundef nonnull @.str.3) #6
  store i8 1, ptr %3, align 1, !tbaa !5
  br label %38

21:                                               ; preds = %14
  %22 = getelementptr inbounds i8, ptr %0, i64 8320
  %23 = load ptr, ptr %22, align 8, !tbaa !22
  %.not = icmp eq ptr %23, null
  %24 = getelementptr inbounds i8, ptr %0, i64 8280
  %25 = load i64, ptr %24, align 8, !tbaa !23
  br i1 %.not, label %33, label %26

26:                                               ; preds = %21
  %27 = getelementptr inbounds i8, ptr %23, i64 184
  %28 = getelementptr inbounds i8, ptr %27, i64 %25
  %29 = getelementptr inbounds i8, ptr %23, i64 176
  %30 = load i64, ptr %29, align 8, !tbaa !24
  %31 = sub i64 %30, %25
  %32 = tail call i64 @recv(i32 noundef %8, ptr noundef nonnull %28, i64 noundef %31, i32 noundef 0) #6
  br label %38

33:                                               ; preds = %21
  %34 = getelementptr inbounds i8, ptr %0, i64 86
  %35 = getelementptr inbounds i8, ptr %34, i64 %25
  %36 = sub i64 8191, %25
  %37 = tail call i64 @recv(i32 noundef %8, ptr noundef nonnull %35, i64 noundef %36, i32 noundef 0) #6
  br label %38

38:                                               ; preds = %26, %33, %20
  %.079 = phi i64 [ 0, %20 ], [ %32, %26 ], [ %37, %33 ]
  %39 = tail call double @dtime() #6
  %40 = load double, ptr @con_timeout, align 8, !tbaa !27
  %41 = fadd double %39, %40
  %42 = getelementptr inbounds i8, ptr %0, i64 8304
  store double %41, ptr %42, align 8, !tbaa !28
  %43 = icmp slt i64 %.079, 1
  %44 = getelementptr inbounds i8, ptr %0, i64 8280
  %45 = load i64, ptr %44, align 8, !tbaa !23
  br i1 %43, label %46, label %57

46:                                               ; preds = %38
  %.not93 = icmp eq i64 %45, 0
  br i1 %.not93, label %56, label %47

47:                                               ; preds = %46
  %48 = icmp eq i64 %.079, 0
  br i1 %48, label %49, label %52

49:                                               ; preds = %47
  %50 = getelementptr inbounds i8, ptr %0, i64 32
  %51 = load i64, ptr %50, align 8, !tbaa !29
  tail call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef nonnull @agoo_warn_cat, ptr noundef nonnull @.str.4, i64 noundef %51) #6
  br label %56

52:                                               ; preds = %47
  %53 = tail call ptr @__errno_location() #7
  %54 = load i32, ptr %53, align 4, !tbaa !30
  %55 = tail call ptr @strerror(i32 noundef %54) #6
  tail call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef nonnull @agoo_warn_cat, ptr noundef nonnull @.str.5, ptr noundef %55) #6
  br label %56

56:                                               ; preds = %49, %52, %46
  store i8 1, ptr %3, align 1, !tbaa !5
  br label %.loopexit

57:                                               ; preds = %38
  %58 = add i64 %45, %.079
  store i64 %58, ptr %44, align 8, !tbaa !23
  %59 = getelementptr inbounds i8, ptr %0, i64 8320
  %60 = getelementptr inbounds i8, ptr %0, i64 86
  %61 = getelementptr inbounds i8, ptr %0, i64 32
  br label %.backedge

.backedge:                                        ; preds = %.backedge.backedge, %57
  %62 = phi i64 [ %58, %57 ], [ %.be, %.backedge.backedge ]
  %63 = load ptr, ptr %59, align 8, !tbaa !22
  %64 = icmp eq ptr %63, null
  br i1 %64, label %65, label %.thread99

65:                                               ; preds = %.backedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %66 = call i32 @con_header_read(ptr noundef nonnull %0, ptr noundef nonnull %2)
  switch i32 %66, label %.thread.sink.split [
    i32 65, label %.thread
    i32 79, label %76
    i32 72, label %67
  ]

67:                                               ; preds = %65
  %68 = load i64, ptr %2, align 8, !tbaa !31
  %69 = load i64, ptr %44, align 8, !tbaa !23
  %70 = icmp ult i64 %68, %69
  br i1 %70, label %71, label %.thread.sink.split

.thread.sink.split:                               ; preds = %65, %67
  store i64 0, ptr %44, align 8, !tbaa !23
  store i8 0, ptr %60, align 2, !tbaa !32
  br label %.thread

.thread:                                          ; preds = %65, %.thread.sink.split
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %.loopexit

71:                                               ; preds = %67
  %72 = getelementptr inbounds i8, ptr %60, i64 %68
  %73 = sub i64 %69, %68
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 2 %60, ptr nonnull align 1 %72, i64 %73, i1 false)
  %74 = load i64, ptr %44, align 8, !tbaa !23
  %75 = sub i64 %74, %68
  store i64 %75, ptr %44, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %.backedge.backedge

.backedge.backedge:                               ; preds = %71, %136
  %.be = phi i64 [ %75, %71 ], [ %140, %136 ]
  br label %.backedge

76:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %.pr = load ptr, ptr %59, align 8, !tbaa !22
  %.not90 = icmp eq ptr %.pr, null
  br i1 %.not90, label %.loopexit, label %..thread99_crit_edge

..thread99_crit_edge:                             ; preds = %76
  %.pre = load i64, ptr %44, align 8, !tbaa !23
  br label %.thread99

.thread99:                                        ; preds = %..thread99_crit_edge, %.backedge
  %77 = phi i64 [ %.pre, %..thread99_crit_edge ], [ %62, %.backedge ]
  %78 = phi ptr [ %.pr, %..thread99_crit_edge ], [ %63, %.backedge ]
  %79 = getelementptr inbounds i8, ptr %78, i64 176
  %80 = load i64, ptr %79, align 8, !tbaa !24
  %.not91 = icmp ugt i64 %80, %77
  br i1 %.not91, label %.loopexit, label %81

81:                                               ; preds = %.thread99
  %82 = load i8, ptr getelementptr inbounds (i8, ptr @agoo_debug_cat, i64 52), align 4, !tbaa !33, !range !14, !noundef !15
  %83 = trunc nuw i8 %82 to i1
  br i1 %83, label %84, label %96

84:                                               ; preds = %81
  %85 = getelementptr inbounds i8, ptr %78, i64 96
  %86 = load ptr, ptr %85, align 8, !tbaa !35
  %.not92 = icmp eq ptr %86, null
  br i1 %.not92, label %96, label %87

87:                                               ; preds = %84
  %88 = load ptr, ptr %15, align 8, !tbaa !18
  %89 = getelementptr inbounds i8, ptr %88, i64 80
  %90 = load i32, ptr %89, align 8, !tbaa !19
  %91 = call ptr @agoo_con_kind_str(i32 noundef %90) #6
  %92 = load i64, ptr %61, align 8, !tbaa !29
  %93 = load ptr, ptr %59, align 8, !tbaa !22
  %94 = getelementptr inbounds i8, ptr %93, i64 96
  %95 = load ptr, ptr %94, align 8, !tbaa !35
  call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef nonnull @agoo_debug_cat, ptr noundef nonnull @.str.6, ptr noundef %91, i64 noundef %92, ptr noundef %95) #6
  br label %96

96:                                               ; preds = %87, %84, %81
  %97 = call ptr @agoo_res_create(ptr noundef nonnull %0) #6
  %98 = icmp eq ptr %97, null
  br i1 %98, label %.thread101, label %102

.thread101:                                       ; preds = %96
  store ptr null, ptr %59, align 8, !tbaa !22
  %99 = load i64, ptr %61, align 8, !tbaa !29
  call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef nonnull @agoo_error_cat, ptr noundef nonnull @.str.7, i64 noundef %99) #6
  %100 = call i32 @bad_request(ptr noundef nonnull %0, i32 noundef 500, i32 noundef 626)
  %101 = icmp ne i32 %100, 0
  br label %.loopexit

102:                                              ; preds = %96
  call void @agoo_con_res_append(ptr noundef nonnull %0, ptr noundef nonnull %97)
  %103 = load ptr, ptr %59, align 8, !tbaa !22
  %104 = getelementptr inbounds i8, ptr %103, i64 80
  %105 = load ptr, ptr %104, align 8, !tbaa !36
  %106 = getelementptr inbounds i8, ptr %103, i64 88
  %107 = load i32, ptr %106, align 8, !tbaa !37
  %108 = call zeroext i1 @should_close(ptr noundef %105, i32 noundef %107)
  %109 = getelementptr inbounds i8, ptr %97, i64 72
  %110 = zext i1 %108 to i8
  store i8 %110, ptr %109, align 8, !tbaa !38
  br i1 %108, label %111, label %112

111:                                              ; preds = %102
  store i8 1, ptr %11, align 8, !tbaa !17
  br label %112

112:                                              ; preds = %102, %111
  %113 = load ptr, ptr %59, align 8, !tbaa !22
  %114 = getelementptr inbounds i8, ptr %113, i64 8
  store ptr %97, ptr %114, align 8, !tbaa !40
  %115 = getelementptr inbounds i8, ptr %113, i64 176
  %116 = load i64, ptr %115, align 8, !tbaa !24
  call void @check_upgrade(ptr noundef nonnull %0)
  %117 = load ptr, ptr %59, align 8, !tbaa !22
  store ptr null, ptr %59, align 8, !tbaa !22
  %118 = getelementptr inbounds i8, ptr %117, i64 168
  %119 = load ptr, ptr %118, align 8, !tbaa !41
  %120 = getelementptr inbounds i8, ptr %119, i64 48
  %121 = load i8, ptr %120, align 8, !tbaa !42, !range !14, !noundef !15
  %122 = trunc nuw i8 %121 to i1
  br i1 %122, label %123, label %130

123:                                              ; preds = %112
  %124 = getelementptr inbounds i8, ptr %119, i64 24
  %125 = load i32, ptr %124, align 8, !tbaa !44
  %126 = icmp eq i32 %125, 70
  br i1 %126, label %127, label %130

127:                                              ; preds = %123
  %128 = getelementptr inbounds i8, ptr %119, i64 32
  %129 = load ptr, ptr %128, align 8, !tbaa !32
  call void %129(ptr noundef nonnull %117) #6
  call void @agoo_req_destroy(ptr noundef nonnull %117) #6
  br label %133

130:                                              ; preds = %123, %112
  %131 = getelementptr inbounds i8, ptr %119, i64 40
  %132 = load ptr, ptr %131, align 8, !tbaa !45
  call void @agoo_queue_push(ptr noundef %132, ptr noundef nonnull %117) #6
  br label %133

133:                                              ; preds = %130, %127
  %134 = load i64, ptr %44, align 8, !tbaa !23
  %135 = icmp slt i64 %116, %134
  br i1 %135, label %136, label %.thread104

.thread104:                                       ; preds = %133
  store i64 0, ptr %44, align 8, !tbaa !23
  store i8 0, ptr %60, align 2, !tbaa !32
  br label %.loopexit

136:                                              ; preds = %133
  %137 = getelementptr inbounds i8, ptr %60, i64 %116
  %138 = sub i64 %134, %116
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 2 %60, ptr nonnull align 1 %137, i64 %138, i1 false)
  %139 = load i64, ptr %44, align 8, !tbaa !23
  %140 = sub i64 %139, %116
  store i64 %140, ptr %44, align 8, !tbaa !23
  br label %.backedge.backedge

.loopexit:                                        ; preds = %.thread99, %76, %.thread104, %.thread101, %.thread, %1, %6, %10, %56
  %.4 = phi i1 [ true, %56 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ false, %.thread ], [ %101, %.thread101 ], [ false, %.thread104 ], [ false, %76 ], [ false, %.thread99 ]
  ret i1 %.4
}

declare i64 @recv(i32 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #3

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

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

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

declare ptr @agoo_con_kind_str(i32 noundef) local_unnamed_addr #1

declare ptr @agoo_res_create(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare hidden void @check_upgrade(ptr noundef) local_unnamed_addr #2

declare void @agoo_queue_push(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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 "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 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(none) }

!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, !13, i64 8313}
!6 = !{!"_agooCon", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !8, i64 40, !8, i64 86, !11, i64 8280, !11, i64 8288, !11, i64 8296, !12, i64 8304, !13, i64 8312, !13, i64 8313, !13, i64 8314, !7, i64 8320, !7, i64 8328, !7, i64 8336, !8, i64 8344, !7, i64 8384, !7, i64 8392, !7, i64 8400}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"double", !8, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!6, !10, i64 8}
!17 = !{!6, !13, i64 8312}
!18 = !{!6, !7, i64 16}
!19 = !{!20, !10, i64 80}
!20 = !{!"_agooBind", !7, i64 0, !10, i64 8, !10, i64 12, !21, i64 16, !8, i64 20, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !10, i64 80}
!21 = !{!"short", !8, i64 0}
!22 = !{!6, !7, i64 8320}
!23 = !{!6, !11, i64 8280}
!24 = !{!25, !11, i64 176}
!25 = !{!"_agooReq", !10, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !26, i64 32, !26, i64 48, !26, i64 64, !26, i64 80, !26, i64 96, !8, i64 112, !7, i64 160, !7, i64 168, !11, i64 176, !8, i64 184}
!26 = !{!"_agooStr", !7, i64 0, !10, i64 8}
!27 = !{!12, !12, i64 0}
!28 = !{!6, !12, i64 8304}
!29 = !{!6, !11, i64 32}
!30 = !{!10, !10, i64 0}
!31 = !{!11, !11, i64 0}
!32 = !{!8, !8, i64 0}
!33 = !{!34, !13, i64 52}
!34 = !{!"_agooLogCat", !7, i64 0, !8, i64 8, !7, i64 40, !10, i64 48, !13, i64 52}
!35 = !{!25, !7, i64 96}
!36 = !{!25, !7, i64 80}
!37 = !{!25, !10, i64 88}
!38 = !{!39, !13, i64 72}
!39 = !{!"_agooRes", !7, i64 0, !7, i64 8, !7, i64 16, !8, i64 24, !13, i64 64, !10, i64 68, !13, i64 72, !13, i64 73, !13, i64 74}
!40 = !{!25, !7, i64 8}
!41 = !{!25, !7, i64 168}
!42 = !{!43, !13, i64 48}
!43 = !{!"_agooHook", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !8, i64 32, !7, i64 40, !13, i64 48}
!44 = !{!43, !10, i64 24}
!45 = !{!43, !7, i64 40}


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