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

; 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._cache = type { [1024 x ptr], [1024 x ptr], [64 x ptr], ptr, ptr, ptr }
%struct._agooGroup = type { ptr, ptr, i32, ptr }
%struct._agooDir = type { ptr, ptr, i32 }
%struct._agooPage = type { ptr, ptr, i64, double, i8 }

@.str.3 = external hidden unnamed_addr constant [62 x i8], align 1
@cache = external hidden global %struct._cache, align 8
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [11 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: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #1

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

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

declare i32 @agoo_err_set(ptr noundef, i32 noundef, ptr noundef, ...) #3

declare i32 @agoo_err_memory(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @agoo_page_create(ptr noundef) #2

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

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

; Function Attrs: nounwind
declare ptr @stpcpy(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #4

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @agoo_group_get(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca [2048 x i8], align 16
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2048, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = call ptr @strstr(ptr noundef %15, ptr noundef @.str.13) #6
  %17 = icmp ne ptr null, %16
  br i1 %17, label %18, label %19

18:                                               ; preds = %3
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %229

19:                                               ; preds = %3
  %20 = load ptr, ptr getelementptr inbounds (%struct._cache, ptr @cache, i32 0, i32 4), align 8, !tbaa !11
  store ptr %20, ptr %9, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %53, %19
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = icmp ne ptr null, %22
  br i1 %23, label %24, label %57

24:                                               ; preds = %21
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._agooGroup, ptr %25, i32 0, i32 2
  %27 = load i32, ptr %26, align 8, !tbaa !13
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %30, label %52

30:                                               ; preds = %24
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._agooGroup, ptr %32, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !15
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._agooGroup, ptr %35, i32 0, i32 2
  %37 = load i32, ptr %36, align 8, !tbaa !13
  %38 = sext i32 %37 to i64
  %39 = call i32 @strncmp(ptr noundef %31, ptr noundef %34, i64 noundef %38) #6
  %40 = icmp eq i32 0, %39
  br i1 %40, label %41, label %52

41:                                               ; preds = %30
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._agooGroup, ptr %43, i32 0, i32 2
  %45 = load i32, ptr %44, align 8, !tbaa !13
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i8, ptr %42, i64 %46
  %48 = load i8, ptr %47, align 1, !tbaa !16
  %49 = sext i8 %48 to i32
  %50 = icmp eq i32 47, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %41
  br label %57

52:                                               ; preds = %41, %30, %24
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._agooGroup, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  store ptr %56, ptr %9, align 8, !tbaa !5
  br label %21, !llvm.loop !18

57:                                               ; preds = %51, %21
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = icmp eq ptr null, %58
  br i1 %59, label %60, label %61

60:                                               ; preds = %57
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %229

61:                                               ; preds = %57
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._agooGroup, ptr %62, i32 0, i32 3
  %64 = load ptr, ptr %63, align 8, !tbaa !20
  store ptr %64, ptr %12, align 8, !tbaa !5
  br label %65

65:                                               ; preds = %116, %61
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = icmp ne ptr null, %66
  br i1 %67, label %68, label %120

68:                                               ; preds = %65
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._agooDir, ptr %69, i32 0, i32 2
  %71 = load i32, ptr %70, align 8, !tbaa !21
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = add nsw i32 %71, %72
  %74 = icmp sle i32 2048, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %68
  br label %116

76:                                               ; preds = %68
  %77 = getelementptr inbounds [2048 x i8], ptr %10, i64 0, i64 0
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._agooDir, ptr %78, i32 0, i32 1
  %80 = load ptr, ptr %79, align 8, !tbaa !23
  %81 = call ptr @stpcpy(ptr noundef %77, ptr noundef %80) #5
  store ptr %81, ptr %11, align 8, !tbaa !5
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._agooGroup, ptr %84, i32 0, i32 2
  %86 = load i32, ptr %85, align 8, !tbaa !13
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i8, ptr %83, i64 %87
  %89 = load i32, ptr %7, align 4, !tbaa !9
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._agooGroup, ptr %90, i32 0, i32 2
  %92 = load i32, ptr %91, align 8, !tbaa !13
  %93 = sub nsw i32 %89, %92
  %94 = sext i32 %93 to i64
  %95 = call ptr @strncpy(ptr noundef %82, ptr noundef %88, i64 noundef %94) #5
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._agooGroup, ptr %97, i32 0, i32 2
  %99 = load i32, ptr %98, align 8, !tbaa !13
  %100 = sub nsw i32 %96, %99
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = sext i32 %100 to i64
  %103 = getelementptr inbounds i8, ptr %101, i64 %102
  store ptr %103, ptr %11, align 8, !tbaa !5
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  store i8 0, ptr %104, align 1, !tbaa !16
  %105 = getelementptr inbounds [2048 x i8], ptr %10, i64 0, i64 0
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds [2048 x i8], ptr %10, i64 0, i64 0
  %108 = ptrtoint ptr %106 to i64
  %109 = ptrtoint ptr %107 to i64
  %110 = sub i64 %108, %109
  %111 = trunc i64 %110 to i32
  %112 = call ptr @cache_get(ptr noundef %105, i32 noundef %111)
  store ptr %112, ptr %8, align 8, !tbaa !5
  %113 = icmp ne ptr null, %112
  br i1 %113, label %114, label %115

114:                                              ; preds = %76
  br label %120

115:                                              ; preds = %76
  br label %116

116:                                              ; preds = %115, %75
  %117 = load ptr, ptr %12, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._agooDir, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !24
  store ptr %119, ptr %12, align 8, !tbaa !5
  br label %65, !llvm.loop !25

120:                                              ; preds = %114, %65
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = icmp eq ptr null, %121
  br i1 %122, label %123, label %225

123:                                              ; preds = %120
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._agooGroup, ptr %124, i32 0, i32 3
  %126 = load ptr, ptr %125, align 8, !tbaa !20
  store ptr %126, ptr %12, align 8, !tbaa !5
  br label %127

127:                                              ; preds = %172, %123
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  %129 = icmp ne ptr null, %128
  br i1 %129, label %130, label %176

130:                                              ; preds = %127
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._agooDir, ptr %131, i32 0, i32 2
  %133 = load i32, ptr %132, align 8, !tbaa !21
  %134 = load i32, ptr %7, align 4, !tbaa !9
  %135 = add nsw i32 %133, %134
  %136 = icmp sle i32 2048, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %130
  br label %172

138:                                              ; preds = %130
  %139 = getelementptr inbounds [2048 x i8], ptr %10, i64 0, i64 0
  %140 = load ptr, ptr %12, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._agooDir, ptr %140, i32 0, i32 1
  %142 = load ptr, ptr %141, align 8, !tbaa !23
  %143 = call ptr @stpcpy(ptr noundef %139, ptr noundef %142) #5
  store ptr %143, ptr %11, align 8, !tbaa !5
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._agooGroup, ptr %146, i32 0, i32 2
  %148 = load i32, ptr %147, align 8, !tbaa !13
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i8, ptr %145, i64 %149
  %151 = load i32, ptr %7, align 4, !tbaa !9
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._agooGroup, ptr %152, i32 0, i32 2
  %154 = load i32, ptr %153, align 8, !tbaa !13
  %155 = sub nsw i32 %151, %154
  %156 = sext i32 %155 to i64
  %157 = call ptr @strncpy(ptr noundef %144, ptr noundef %150, i64 noundef %156) #5
  %158 = load i32, ptr %7, align 4, !tbaa !9
  %159 = load ptr, ptr %9, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct._agooGroup, ptr %159, i32 0, i32 2
  %161 = load i32, ptr %160, align 8, !tbaa !13
  %162 = sub nsw i32 %158, %161
  %163 = load ptr, ptr %11, align 8, !tbaa !5
  %164 = sext i32 %162 to i64
  %165 = getelementptr inbounds i8, ptr %163, i64 %164
  store ptr %165, ptr %11, align 8, !tbaa !5
  %166 = load ptr, ptr %11, align 8, !tbaa !5
  store i8 0, ptr %166, align 1, !tbaa !16
  %167 = getelementptr inbounds [2048 x i8], ptr %10, i64 0, i64 0
  %168 = call i32 @access(ptr noundef %167, i32 noundef 4) #5
  %169 = icmp eq i32 0, %168
  br i1 %169, label %170, label %171

170:                                              ; preds = %138
  br label %176

171:                                              ; preds = %138
  br label %172

172:                                              ; preds = %171, %137
  %173 = load ptr, ptr %12, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._agooDir, ptr %173, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8, !tbaa !24
  store ptr %175, ptr %12, align 8, !tbaa !5
  br label %127, !llvm.loop !26

176:                                              ; preds = %170, %127
  %177 = load ptr, ptr %12, align 8, !tbaa !5
  %178 = icmp eq ptr null, %177
  br i1 %178, label %179, label %180

179:                                              ; preds = %176
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %229

180:                                              ; preds = %176
  %181 = load ptr, ptr %11, align 8, !tbaa !5
  %182 = getelementptr inbounds [2048 x i8], ptr %10, i64 0, i64 0
  %183 = ptrtoint ptr %181 to i64
  %184 = ptrtoint ptr %182 to i64
  %185 = sub i64 %183, %184
  %186 = trunc i64 %185 to i32
  store i32 %186, ptr %7, align 4, !tbaa !9
  %187 = getelementptr inbounds [2048 x i8], ptr %10, i64 0, i64 0
  store ptr %187, ptr %6, align 8, !tbaa !5
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  %189 = load i32, ptr %7, align 4, !tbaa !9
  %190 = call ptr @cache_get(ptr noundef %188, i32 noundef %189)
  store ptr %190, ptr %8, align 8, !tbaa !5
  %191 = icmp eq ptr null, %190
  br i1 %191, label %192, label %223

192:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %193 = load ptr, ptr %6, align 8, !tbaa !5
  %194 = call ptr @agoo_page_create(ptr noundef %193)
  store ptr %194, ptr %8, align 8, !tbaa !5
  %195 = icmp eq ptr null, %194
  br i1 %195, label %196, label %199

196:                                              ; preds = %192
  %197 = load ptr, ptr %5, align 8, !tbaa !5
  %198 = call i32 @agoo_err_memory(ptr noundef %197, ptr noundef @.str.6, ptr noundef @.str.3, i32 noundef 956)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %220

199:                                              ; preds = %192
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = call zeroext i1 @update_contents(ptr noundef %200)
  br i1 %201, label %202, label %207

202:                                              ; preds = %199
  %203 = load ptr, ptr %8, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct._agooPage, ptr %203, i32 0, i32 0
  %205 = load ptr, ptr %204, align 8, !tbaa !27
  %206 = icmp eq ptr null, %205
  br i1 %206, label %207, label %211

207:                                              ; preds = %202, %199
  %208 = load ptr, ptr %8, align 8, !tbaa !5
  call void @agoo_page_destroy(ptr noundef %208)
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = call i32 (ptr, i32, ptr, ...) @agoo_err_set(ptr noundef %209, i32 noundef 305, ptr noundef @.str.15)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %220

211:                                              ; preds = %202
  %212 = load ptr, ptr %6, align 8, !tbaa !5
  %213 = load i32, ptr %7, align 4, !tbaa !9
  %214 = load ptr, ptr %8, align 8, !tbaa !5
  %215 = call ptr @cache_set(ptr noundef %212, i32 noundef %213, ptr noundef %214)
  store ptr %215, ptr %14, align 8, !tbaa !5
  %216 = icmp ne ptr null, %215
  br i1 %216, label %217, label %219

217:                                              ; preds = %211
  %218 = load ptr, ptr %14, align 8, !tbaa !5
  call void @agoo_page_destroy(ptr noundef %218)
  br label %219

219:                                              ; preds = %217, %211
  store i32 0, ptr %13, align 4
  br label %220

220:                                              ; preds = %219, %207, %196
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  %221 = load i32, ptr %13, align 4
  switch i32 %221, label %229 [
    i32 0, label %222
  ]

222:                                              ; preds = %220
  br label %223

223:                                              ; preds = %222, %180
  %224 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %224, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %229

225:                                              ; preds = %120
  %226 = load ptr, ptr %5, align 8, !tbaa !5
  %227 = load ptr, ptr %8, align 8, !tbaa !5
  %228 = call ptr @page_check(ptr noundef %226, ptr noundef %227)
  store ptr %228, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %229

229:                                              ; preds = %225, %223, %220, %179, %60, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 2048, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %230 = load ptr, ptr %4, align 8
  ret ptr %230
}

; Function Attrs: nounwind
declare i32 @access(ptr noundef, i32 noundef) #4

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

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 16904}
!12 = !{!"_cache", !7, i64 0, !7, i64 8192, !7, i64 16384, !6, i64 16896, !6, i64 16904, !6, i64 16912}
!13 = !{!14, !10, i64 16}
!14 = !{!"_agooGroup", !6, i64 0, !6, i64 8, !10, i64 16, !6, i64 24}
!15 = !{!14, !6, i64 8}
!16 = !{!7, !7, i64 0}
!17 = !{!14, !6, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!14, !6, i64 24}
!21 = !{!22, !10, i64 16}
!22 = !{!"_agooDir", !6, i64 0, !6, i64 8, !10, i64 16}
!23 = !{!22, !6, i64 8}
!24 = !{!22, !6, i64 0}
!25 = distinct !{!25, !19}
!26 = distinct !{!26, !19}
!27 = !{!28, !6, i64 0}
!28 = !{!"_agooPage", !6, i64 0, !6, i64 8, !29, i64 16, !30, i64 24, !31, i64 32}
!29 = !{!"long", !7, i64 0}
!30 = !{!"double", !7, i64 0}
!31 = !{!"_Bool", !7, i64 0}


; 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._cache = type { [1024 x ptr], [1024 x ptr], [64 x ptr], ptr, ptr, ptr }

@.str.3 = external hidden unnamed_addr constant [62 x i8], align 1
@cache = external hidden local_unnamed_addr global %struct._cache, align 8
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [11 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 nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #1

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

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

declare i32 @agoo_err_set(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #3

declare i32 @agoo_err_memory(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @stpcpy(ptr noalias noundef writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #4

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @agoo_group_get(ptr noundef %0, ptr noundef readonly %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = alloca [2048 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %4) #6
  %5 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.13) #7
  %.not = icmp ne ptr %5, null
  %.06691 = load ptr, ptr getelementptr inbounds (i8, ptr @cache, i64 16904), align 8
  %cond92 = icmp eq ptr %.06691, null
  %or.cond = select i1 %.not, i1 true, i1 %cond92
  br i1 %or.cond, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %3, %19
  %.06693 = phi ptr [ %.066, %19 ], [ %.06691, %3 ]
  %6 = getelementptr inbounds i8, ptr %.06693, i64 16
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = icmp slt i32 %7, %2
  br i1 %8, label %9, label %19

9:                                                ; preds = %.lr.ph
  %10 = getelementptr inbounds i8, ptr %.06693, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = sext i32 %7 to i64
  %13 = tail call i32 @strncmp(ptr noundef %1, ptr noundef %11, i64 noundef %12) #7
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %19

15:                                               ; preds = %9
  %16 = getelementptr inbounds i8, ptr %1, i64 %12
  %17 = load i8, ptr %16, align 1, !tbaa !12
  %18 = icmp eq i8 %17, 47
  br i1 %18, label %20, label %19

19:                                               ; preds = %.lr.ph, %9, %15
  %.066 = load ptr, ptr %.06693, align 8, !tbaa !13
  %cond = icmp eq ptr %.066, null
  br i1 %cond, label %.critedge, label %.lr.ph, !llvm.loop !14

20:                                               ; preds = %15
  %21 = getelementptr inbounds i8, ptr %.06693, i64 16
  %22 = getelementptr inbounds i8, ptr %.06693, i64 24
  %.06294 = load ptr, ptr %22, align 8, !tbaa !13
  %.not7795 = icmp eq ptr %.06294, null
  br i1 %.not7795, label %.critedge, label %.lr.ph97

.lr.ph97:                                         ; preds = %20
  %23 = ptrtoint ptr %4 to i64
  br label %24

.preheader:                                       ; preds = %47
  %.163100.pre = load ptr, ptr %22, align 8, !tbaa !13
  %.not79101 = icmp eq ptr %.163100.pre, null
  br i1 %.not79101, label %.critedge, label %.lr.ph103

24:                                               ; preds = %.lr.ph97, %47
  %.06296 = phi ptr [ %.06294, %.lr.ph97 ], [ %.062, %47 ]
  %25 = getelementptr inbounds i8, ptr %.06296, i64 16
  %26 = load i32, ptr %25, align 8, !tbaa !16
  %27 = add nsw i32 %26, %2
  %28 = icmp sgt i32 %27, 2047
  br i1 %28, label %47, label %29

29:                                               ; preds = %24
  %30 = getelementptr inbounds i8, ptr %.06296, i64 8
  %31 = load ptr, ptr %30, align 8, !tbaa !18
  %32 = call ptr @stpcpy(ptr noundef nonnull %4, ptr noundef %31) #6
  %33 = load i32, ptr %21, align 8, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr %1, i64 %34
  %36 = sub nsw i32 %2, %33
  %37 = sext i32 %36 to i64
  %38 = call ptr @strncpy(ptr noundef %32, ptr noundef %35, i64 noundef %37) #6
  %39 = load i32, ptr %21, align 8, !tbaa !5
  %40 = sub nsw i32 %2, %39
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i8, ptr %32, i64 %41
  store i8 0, ptr %42, align 1, !tbaa !12
  %43 = ptrtoint ptr %42 to i64
  %44 = sub i64 %43, %23
  %45 = trunc i64 %44 to i32
  %46 = call ptr @cache_get(ptr noundef nonnull %4, i32 noundef %45)
  %.not78 = icmp eq ptr %46, null
  br i1 %.not78, label %47, label %92

47:                                               ; preds = %29, %24
  %.062 = load ptr, ptr %.06296, align 8, !tbaa !13
  %.not77 = icmp eq ptr %.062, null
  br i1 %.not77, label %.preheader, label %24, !llvm.loop !19

.lr.ph103:                                        ; preds = %.preheader, %68
  %.163102 = phi ptr [ %.163, %68 ], [ %.163100.pre, %.preheader ]
  %48 = getelementptr inbounds i8, ptr %.163102, i64 16
  %49 = load i32, ptr %48, align 8, !tbaa !16
  %50 = add nsw i32 %49, %2
  %51 = icmp sgt i32 %50, 2047
  br i1 %51, label %68, label %52

52:                                               ; preds = %.lr.ph103
  %53 = getelementptr inbounds i8, ptr %.163102, i64 8
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  %55 = call ptr @stpcpy(ptr noundef nonnull %4, ptr noundef %54) #6
  %56 = load i32, ptr %21, align 8, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i8, ptr %1, i64 %57
  %59 = sub nsw i32 %2, %56
  %60 = sext i32 %59 to i64
  %61 = call ptr @strncpy(ptr noundef %55, ptr noundef %58, i64 noundef %60) #6
  %62 = load i32, ptr %21, align 8, !tbaa !5
  %63 = sub nsw i32 %2, %62
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i8, ptr %55, i64 %64
  store i8 0, ptr %65, align 1, !tbaa !12
  %66 = call i32 @access(ptr noundef nonnull %4, i32 noundef 4) #6
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %69, label %68

68:                                               ; preds = %52, %.lr.ph103
  %.163 = load ptr, ptr %.163102, align 8, !tbaa !13
  %.not79 = icmp eq ptr %.163, null
  br i1 %.not79, label %.critedge, label %.lr.ph103, !llvm.loop !20

69:                                               ; preds = %52
  %70 = getelementptr inbounds i8, ptr %55, i64 %64
  %71 = ptrtoint ptr %70 to i64
  %72 = ptrtoint ptr %4 to i64
  %73 = sub i64 %71, %72
  %74 = trunc i64 %73 to i32
  %75 = call ptr @cache_get(ptr noundef nonnull %4, i32 noundef %74)
  %76 = icmp eq ptr %75, null
  br i1 %76, label %77, label %.critedge

77:                                               ; preds = %69
  %78 = call ptr @agoo_page_create(ptr noundef nonnull %4)
  %79 = icmp eq ptr %78, null
  br i1 %79, label %80, label %82

80:                                               ; preds = %77
  %81 = call i32 @agoo_err_memory(ptr noundef %0, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, i32 noundef 956) #6
  br label %.critedge

82:                                               ; preds = %77
  %83 = call zeroext i1 @update_contents(ptr noundef nonnull %78)
  br i1 %83, label %84, label %87

84:                                               ; preds = %82
  %85 = load ptr, ptr %78, align 8, !tbaa !21
  %86 = icmp eq ptr %85, null
  br i1 %86, label %87, label %89

87:                                               ; preds = %84, %82
  call void @agoo_page_destroy(ptr noundef nonnull %78)
  %88 = call i32 (ptr, i32, ptr, ...) @agoo_err_set(ptr noundef %0, i32 noundef 305, ptr noundef nonnull @.str.15) #6
  br label %.critedge

89:                                               ; preds = %84
  %90 = call ptr @cache_set(ptr noundef nonnull %4, i32 noundef %74, ptr noundef nonnull %78)
  %.not80 = icmp eq ptr %90, null
  br i1 %.not80, label %.critedge, label %91

91:                                               ; preds = %89
  call void @agoo_page_destroy(ptr noundef nonnull %90)
  br label %.critedge

92:                                               ; preds = %29
  %93 = call ptr @page_check(ptr noundef %0, ptr noundef nonnull %46)
  br label %.critedge

.critedge:                                        ; preds = %19, %68, %20, %.preheader, %80, %87, %69, %89, %91, %3, %92
  %.1 = phi ptr [ %93, %92 ], [ null, %3 ], [ %75, %69 ], [ %78, %89 ], [ %78, %91 ], [ null, %87 ], [ null, %80 ], [ null, %.preheader ], [ null, %20 ], [ null, %68 ], [ null, %19 ]
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %4) #6
  ret ptr %.1
}

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

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

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


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