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

; 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._agooServer = type { i8, i8, i32, i8, i8, i8, i8, i64, %struct._agooQueue, ptr, ptr, ptr, %struct._agooQueue, ptr, i32, i32, %struct._agooAtom, ptr, ptr, %union.pthread_mutex_t, i32, ptr, ptr, %struct._agooAtom }
%struct._agooQueue = type { ptr, ptr, %struct._agooAtom, %struct._agooAtom, i8, i8, %struct._agooAtom, %struct._agooAtom, %struct._agooAtom, i32, i32 }
%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._agooAtom = type { ptr, %union.pthread_mutex_t }
%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 }
%struct._agooUpgraded = type { ptr, ptr, ptr, %struct._agooAtom, %struct._agooAtom, ptr, ptr, ptr, ptr, i8, i8, i8, i8, i8, ptr }
%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 }

@agoo_error_cat = external global %struct._agooLogCat, align 8
@.str.4 = external hidden unnamed_addr constant [46 x i8], align 1
@agoo_server = external global %struct._agooServer, align 8

; 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 void @agoo_log_cat(ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @agoo_ws_create_req(ptr noundef %0, i64 noundef %1) #2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct._agooCon, ptr %8, i32 0, i32 6
  %10 = getelementptr inbounds [8192 x i8], ptr %9, i64 0, i64 0
  %11 = load i8, ptr %10, align 2, !tbaa !11
  %12 = sext i8 %11 to i32
  %13 = and i32 15, %12
  %14 = trunc i32 %13 to i8
  store i8 %14, ptr %6, align 1, !tbaa !11
  %15 = load i64, ptr %5, align 8, !tbaa !9
  %16 = call ptr @agoo_req_create(i64 noundef %15)
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._agooCon, ptr %17, i32 0, i32 14
  store ptr %16, ptr %18, align 8, !tbaa !12
  %19 = icmp eq ptr null, %16
  br i1 %19, label %20, label %21

20:                                               ; preds = %2
  call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef @agoo_error_cat, ptr noundef @.str.4)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %149

21:                                               ; preds = %2
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._agooCon, ptr %22, i32 0, i32 18
  %24 = load ptr, ptr %23, align 8, !tbaa !17
  %25 = icmp eq ptr null, %24
  br i1 %25, label %34, label %26

26:                                               ; preds = %21
  %27 = load ptr, ptr getelementptr inbounds (%struct._agooServer, ptr @agoo_server, i32 0, i32 22), align 8, !tbaa !18
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._agooCon, ptr %28, i32 0, i32 18
  %30 = load ptr, ptr %29, align 8, !tbaa !17
  %31 = getelementptr inbounds %struct._agooUpgraded, ptr %30, i32 0, i32 6
  %32 = load ptr, ptr %31, align 8, !tbaa !22
  %33 = icmp eq ptr %27, %32
  br i1 %33, label %34, label %35

34:                                               ; preds = %26, %21
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %149

35:                                               ; preds = %26
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._agooCon, ptr %36, i32 0, i32 14
  %38 = load ptr, ptr %37, align 8, !tbaa !12
  call void @llvm.memset.p0.i64(ptr align 8 %38, i8 0, i64 192, i1 false)
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._agooCon, ptr %39, i32 0, i32 7
  %41 = load i64, ptr %40, align 8, !tbaa !24
  %42 = load i64, ptr %5, align 8, !tbaa !9
  %43 = icmp sle i64 %41, %42
  br i1 %43, label %44, label %77

44:                                               ; preds = %35
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._agooCon, ptr %45, i32 0, i32 14
  %47 = load ptr, ptr %46, align 8, !tbaa !12
  %48 = getelementptr inbounds %struct._agooReq, ptr %47, i32 0, i32 13
  %49 = getelementptr inbounds [8 x i8], ptr %48, i64 0, i64 0
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._agooCon, ptr %50, i32 0, i32 6
  %52 = getelementptr inbounds [8192 x i8], ptr %51, i64 0, i64 0
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._agooCon, ptr %53, i32 0, i32 7
  %55 = load i64, ptr %54, align 8, !tbaa !24
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %49, ptr align 2 %52, i64 %55, i1 false)
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._agooCon, ptr %56, i32 0, i32 7
  %58 = load i64, ptr %57, align 8, !tbaa !24
  %59 = load i64, ptr %5, align 8, !tbaa !9
  %60 = icmp slt i64 %58, %59
  br i1 %60, label %61, label %76

61:                                               ; preds = %44
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._agooCon, ptr %62, i32 0, i32 14
  %64 = load ptr, ptr %63, align 8, !tbaa !12
  %65 = getelementptr inbounds %struct._agooReq, ptr %64, i32 0, i32 13
  %66 = getelementptr inbounds [8 x i8], ptr %65, i64 0, i64 0
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._agooCon, ptr %67, i32 0, i32 7
  %69 = load i64, ptr %68, align 8, !tbaa !24
  %70 = getelementptr inbounds i8, ptr %66, i64 %69
  %71 = load i64, ptr %5, align 8, !tbaa !9
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._agooCon, ptr %72, i32 0, i32 7
  %74 = load i64, ptr %73, align 8, !tbaa !24
  %75 = sub i64 %71, %74
  call void @llvm.memset.p0.i64(ptr align 1 %70, i8 0, i64 %75, i1 false)
  br label %76

76:                                               ; preds = %61, %44
  br label %87

77:                                               ; preds = %35
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._agooCon, ptr %78, i32 0, i32 14
  %80 = load ptr, ptr %79, align 8, !tbaa !12
  %81 = getelementptr inbounds %struct._agooReq, ptr %80, i32 0, i32 13
  %82 = getelementptr inbounds [8 x i8], ptr %81, i64 0, i64 0
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._agooCon, ptr %83, i32 0, i32 6
  %85 = getelementptr inbounds [8192 x i8], ptr %84, i64 0, i64 0
  %86 = load i64, ptr %5, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %82, ptr align 2 %85, i64 %86, i1 false)
  br label %87

87:                                               ; preds = %77, %76
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._agooCon, ptr %88, i32 0, i32 14
  %90 = load ptr, ptr %89, align 8, !tbaa !12
  %91 = getelementptr inbounds %struct._agooReq, ptr %90, i32 0, i32 13
  %92 = load i64, ptr %5, align 8, !tbaa !9
  %93 = getelementptr inbounds [8 x i8], ptr %91, i64 0, i64 %92
  store i8 0, ptr %93, align 1, !tbaa !11
  %94 = load i64, ptr %5, align 8, !tbaa !9
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._agooCon, ptr %95, i32 0, i32 14
  %97 = load ptr, ptr %96, align 8, !tbaa !12
  %98 = getelementptr inbounds %struct._agooReq, ptr %97, i32 0, i32 12
  store i64 %94, ptr %98, align 8, !tbaa !25
  %99 = load i8, ptr %6, align 1, !tbaa !11
  %100 = zext i8 %99 to i32
  %101 = icmp eq i32 2, %100
  %102 = zext i1 %101 to i64
  %103 = select i1 %101, i32 66, i32 77
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._agooCon, ptr %104, i32 0, i32 14
  %106 = load ptr, ptr %105, align 8, !tbaa !12
  %107 = getelementptr inbounds %struct._agooReq, ptr %106, i32 0, i32 0
  store i32 %103, ptr %107, align 8, !tbaa !28
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._agooCon, ptr %108, i32 0, i32 14
  %110 = load ptr, ptr %109, align 8, !tbaa !12
  %111 = getelementptr inbounds %struct._agooReq, ptr %110, i32 0, i32 2
  store i32 0, ptr %111, align 8, !tbaa !29
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._agooCon, ptr %112, i32 0, i32 18
  %114 = load ptr, ptr %113, align 8, !tbaa !17
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._agooCon, ptr %115, i32 0, i32 14
  %117 = load ptr, ptr %116, align 8, !tbaa !12
  %118 = getelementptr inbounds %struct._agooReq, ptr %117, i32 0, i32 3
  store ptr %114, ptr %118, align 8, !tbaa !30
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._agooCon, ptr %119, i32 0, i32 14
  %121 = load ptr, ptr %120, align 8, !tbaa !12
  %122 = getelementptr inbounds %struct._agooReq, ptr %121, i32 0, i32 9
  %123 = getelementptr inbounds [46 x i8], ptr %122, i64 0, i64 0
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._agooCon, ptr %124, i32 0, i32 5
  %126 = getelementptr inbounds [46 x i8], ptr %125, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %123, ptr align 8 %126, i64 46, i1 false)
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._agooCon, ptr %127, i32 0, i32 14
  %129 = load ptr, ptr %128, align 8, !tbaa !12
  %130 = getelementptr inbounds %struct._agooReq, ptr %129, i32 0, i32 1
  store ptr null, ptr %130, align 8, !tbaa !31
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._agooCon, ptr %131, i32 0, i32 18
  %133 = load ptr, ptr %132, align 8, !tbaa !17
  %134 = getelementptr inbounds %struct._agooUpgraded, ptr %133, i32 0, i32 12
  %135 = load i8, ptr %134, align 1, !tbaa !32, !range !33, !noundef !34
  %136 = trunc i8 %135 to i1
  br i1 %136, label %137, label %148

137:                                              ; preds = %87
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct._agooCon, ptr %138, i32 0, i32 18
  %140 = load ptr, ptr %139, align 8, !tbaa !17
  %141 = getelementptr inbounds %struct._agooUpgraded, ptr %140, i32 0, i32 6
  %142 = load ptr, ptr %141, align 8, !tbaa !22
  %143 = call ptr @agoo_hook_create(i32 noundef 0, ptr noundef null, ptr noundef %142, i32 noundef 80, ptr noundef getelementptr inbounds (%struct._agooServer, ptr @agoo_server, i32 0, i32 12))
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._agooCon, ptr %144, i32 0, i32 14
  %146 = load ptr, ptr %145, align 8, !tbaa !12
  %147 = getelementptr inbounds %struct._agooReq, ptr %146, i32 0, i32 11
  store ptr %143, ptr %147, align 8, !tbaa !35
  br label %148

148:                                              ; preds = %137, %87
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %149

149:                                              ; preds = %148, %34, %20
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  %150 = load i1, ptr %3, align 1
  ret i1 %150
}

declare ptr @agoo_req_create(i64 noundef) #1

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

; 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) #4

declare ptr @agoo_hook_create(i32 noundef, ptr noundef, ptr noundef, i32 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 8320}
!13 = !{!"_agooCon", !6, i64 0, !14, 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, !15, i64 8304, !16, i64 8312, !16, i64 8313, !16, i64 8314, !6, i64 8320, !6, i64 8328, !6, i64 8336, !7, i64 8344, !6, i64 8384, !6, i64 8392, !6, i64 8400}
!14 = !{!"int", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!13, !6, i64 8384}
!18 = !{!19, !6, i64 728}
!19 = !{!"_agooServer", !16, i64 0, !16, i64 1, !14, i64 4, !16, i64 8, !16, i64 9, !16, i64 10, !16, i64 11, !10, i64 16, !20, i64 24, !6, i64 296, !6, i64 304, !6, i64 312, !20, i64 320, !6, i64 592, !14, i64 600, !14, i64 604, !21, i64 608, !6, i64 656, !6, i64 664, !7, i64 672, !14, i64 712, !6, i64 720, !6, i64 728, !21, i64 736}
!20 = !{!"_agooQueue", !6, i64 0, !6, i64 8, !21, i64 16, !21, i64 64, !16, i64 112, !16, i64 113, !21, i64 120, !21, i64 168, !21, i64 216, !14, i64 264, !14, i64 268}
!21 = !{!"_agooAtom", !6, i64 0, !7, i64 8}
!22 = !{!23, !6, i64 128}
!23 = !{!"_agooUpgraded", !6, i64 0, !6, i64 8, !6, i64 16, !21, i64 24, !21, i64 72, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !16, i64 152, !16, i64 153, !16, i64 154, !16, i64 155, !16, i64 156, !6, i64 160}
!24 = !{!13, !10, i64 8280}
!25 = !{!26, !10, i64 176}
!26 = !{!"_agooReq", !14, i64 0, !6, i64 8, !14, i64 16, !6, i64 24, !27, i64 32, !27, i64 48, !27, i64 64, !27, i64 80, !27, i64 96, !7, i64 112, !6, i64 160, !6, i64 168, !10, i64 176, !7, i64 184}
!27 = !{!"_agooStr", !6, i64 0, !14, i64 8}
!28 = !{!26, !14, i64 0}
!29 = !{!26, !14, i64 16}
!30 = !{!26, !6, i64 24}
!31 = !{!26, !6, i64 8}
!32 = !{!23, !16, i64 155}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!26, !6, i64 168}


; 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 }
%struct._agooServer = type { i8, i8, i32, i8, i8, i8, i8, i64, %struct._agooQueue, ptr, ptr, ptr, %struct._agooQueue, ptr, i32, i32, %struct._agooAtom, ptr, ptr, %union.pthread_mutex_t, i32, ptr, ptr, %struct._agooAtom }
%struct._agooQueue = type { ptr, ptr, %struct._agooAtom, %struct._agooAtom, i8, i8, %struct._agooAtom, %struct._agooAtom, %struct._agooAtom, i32, i32 }
%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._agooAtom = type { ptr, %union.pthread_mutex_t }

@agoo_error_cat = external global %struct._agooLogCat, align 8
@.str.4 = external hidden unnamed_addr constant [46 x i8], align 1
@agoo_server = external global %struct._agooServer, align 8

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @agoo_ws_create_req(ptr nocapture noundef %0, i64 noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 86
  %4 = load i8, ptr %3, align 2, !tbaa !5
  %5 = and i8 %4, 15
  %6 = tail call ptr @agoo_req_create(i64 noundef %1) #4
  %7 = getelementptr inbounds i8, ptr %0, i64 8320
  store ptr %6, ptr %7, align 8, !tbaa !8
  %8 = icmp eq ptr %6, null
  br i1 %8, label %9, label %10

9:                                                ; preds = %2
  tail call void (ptr, ptr, ...) @agoo_log_cat(ptr noundef nonnull @agoo_error_cat, ptr noundef nonnull @.str.4) #4
  br label %58

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %0, i64 8384
  %12 = load ptr, ptr %11, align 8, !tbaa !15
  %13 = icmp eq ptr %12, null
  br i1 %13, label %58, label %14

14:                                               ; preds = %10
  %15 = load ptr, ptr getelementptr inbounds (i8, ptr @agoo_server, i64 728), align 8, !tbaa !16
  %16 = getelementptr inbounds i8, ptr %12, i64 128
  %17 = load ptr, ptr %16, align 8, !tbaa !20
  %18 = icmp eq ptr %15, %17
  br i1 %18, label %58, label %19

19:                                               ; preds = %14
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(192) %6, i8 0, i64 192, i1 false)
  %20 = getelementptr inbounds i8, ptr %0, i64 8280
  %21 = load i64, ptr %20, align 8, !tbaa !22
  %.not = icmp sgt i64 %21, %1
  %22 = load ptr, ptr %7, align 8, !tbaa !8
  %23 = getelementptr inbounds i8, ptr %22, i64 184
  br i1 %.not, label %32, label %24

24:                                               ; preds = %19
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %23, ptr nonnull align 2 %3, i64 %21, i1 false)
  %25 = load i64, ptr %20, align 8, !tbaa !22
  %26 = icmp slt i64 %25, %1
  br i1 %26, label %27, label %33

27:                                               ; preds = %24
  %28 = load ptr, ptr %7, align 8, !tbaa !8
  %29 = getelementptr inbounds i8, ptr %28, i64 184
  %30 = getelementptr inbounds i8, ptr %29, i64 %25
  %31 = sub i64 %1, %25
  tail call void @llvm.memset.p0.i64(ptr nonnull align 1 %30, i8 0, i64 %31, i1 false)
  br label %33

32:                                               ; preds = %19
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %23, ptr nonnull align 2 %3, i64 %1, i1 false)
  br label %33

33:                                               ; preds = %24, %27, %32
  %34 = load ptr, ptr %7, align 8, !tbaa !8
  %35 = getelementptr inbounds i8, ptr %34, i64 184
  %36 = getelementptr inbounds [8 x i8], ptr %35, i64 0, i64 %1
  store i8 0, ptr %36, align 1, !tbaa !5
  %37 = load ptr, ptr %7, align 8, !tbaa !8
  %38 = getelementptr inbounds i8, ptr %37, i64 176
  store i64 %1, ptr %38, align 8, !tbaa !23
  %39 = icmp eq i8 %5, 2
  %40 = select i1 %39, i32 66, i32 77
  store i32 %40, ptr %37, align 8, !tbaa !26
  %41 = getelementptr inbounds i8, ptr %37, i64 16
  store i32 0, ptr %41, align 8, !tbaa !27
  %42 = load ptr, ptr %11, align 8, !tbaa !15
  %43 = getelementptr inbounds i8, ptr %37, i64 24
  store ptr %42, ptr %43, align 8, !tbaa !28
  %44 = getelementptr inbounds i8, ptr %37, i64 112
  %45 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(46) %44, ptr noundef nonnull align 8 dereferenceable(46) %45, i64 46, i1 false)
  %46 = load ptr, ptr %7, align 8, !tbaa !8
  %47 = getelementptr inbounds i8, ptr %46, i64 8
  store ptr null, ptr %47, align 8, !tbaa !29
  %48 = load ptr, ptr %11, align 8, !tbaa !15
  %49 = getelementptr inbounds i8, ptr %48, i64 155
  %50 = load i8, ptr %49, align 1, !tbaa !30, !range !31, !noundef !32
  %51 = trunc nuw i8 %50 to i1
  br i1 %51, label %52, label %58

52:                                               ; preds = %33
  %53 = getelementptr inbounds i8, ptr %48, i64 128
  %54 = load ptr, ptr %53, align 8, !tbaa !20
  %55 = tail call ptr @agoo_hook_create(i32 noundef 0, ptr noundef null, ptr noundef %54, i32 noundef 80, ptr noundef nonnull getelementptr inbounds (i8, ptr @agoo_server, i64 320)) #4
  %56 = load ptr, ptr %7, align 8, !tbaa !8
  %57 = getelementptr inbounds i8, ptr %56, i64 168
  store ptr %55, ptr %57, align 8, !tbaa !33
  br label %58

58:                                               ; preds = %33, %52, %10, %14, %9
  %.0 = phi i1 [ true, %9 ], [ true, %14 ], [ true, %10 ], [ false, %52 ], [ false, %33 ]
  ret i1 %.0
}

declare ptr @agoo_req_create(i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress 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

declare ptr @agoo_hook_create(i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

attributes #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 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 8320}
!9 = !{!"_agooCon", !10, i64 0, !11, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !6, i64 40, !6, i64 86, !12, i64 8280, !12, i64 8288, !12, i64 8296, !13, i64 8304, !14, i64 8312, !14, i64 8313, !14, i64 8314, !10, i64 8320, !10, i64 8328, !10, i64 8336, !6, i64 8344, !10, i64 8384, !10, i64 8392, !10, i64 8400}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!"long", !6, i64 0}
!13 = !{!"double", !6, i64 0}
!14 = !{!"_Bool", !6, i64 0}
!15 = !{!9, !10, i64 8384}
!16 = !{!17, !10, i64 728}
!17 = !{!"_agooServer", !14, i64 0, !14, i64 1, !11, i64 4, !14, i64 8, !14, i64 9, !14, i64 10, !14, i64 11, !12, i64 16, !18, i64 24, !10, i64 296, !10, i64 304, !10, i64 312, !18, i64 320, !10, i64 592, !11, i64 600, !11, i64 604, !19, i64 608, !10, i64 656, !10, i64 664, !6, i64 672, !11, i64 712, !10, i64 720, !10, i64 728, !19, i64 736}
!18 = !{!"_agooQueue", !10, i64 0, !10, i64 8, !19, i64 16, !19, i64 64, !14, i64 112, !14, i64 113, !19, i64 120, !19, i64 168, !19, i64 216, !11, i64 264, !11, i64 268}
!19 = !{!"_agooAtom", !10, i64 0, !6, i64 8}
!20 = !{!21, !10, i64 128}
!21 = !{!"_agooUpgraded", !10, i64 0, !10, i64 8, !10, i64 16, !19, i64 24, !19, i64 72, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !14, i64 152, !14, i64 153, !14, i64 154, !14, i64 155, !14, i64 156, !10, i64 160}
!22 = !{!9, !12, i64 8280}
!23 = !{!24, !12, i64 176}
!24 = !{!"_agooReq", !11, i64 0, !10, i64 8, !11, i64 16, !10, i64 24, !25, i64 32, !25, i64 48, !25, i64 64, !25, i64 80, !25, i64 96, !6, i64 112, !10, i64 160, !10, i64 168, !12, i64 176, !6, i64 184}
!25 = !{!"_agooStr", !10, i64 0, !11, i64 8}
!26 = !{!24, !11, i64 0}
!27 = !{!24, !11, i64 16}
!28 = !{!24, !10, i64 24}
!29 = !{!24, !10, i64 8}
!30 = !{!21, !14, i64 155}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = !{!24, !10, i64 168}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass