; LLVM IR from nbosb/simdal :: deps/sqlite/src (shell)

; 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.IdxHash = type { ptr, [1023 x ptr] }
%struct.sqlite3expert = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, i32, %struct.IdxHash, ptr }
%struct.IdxStatement = type { i32, ptr, ptr, ptr, ptr }
%struct.IdxHashEntry = type { ptr, ptr, ptr, ptr, ptr }

@.str.22 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [5 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

; Function Attrs: nounwind uwtable
define dso_local i32 @idxFindIndexes(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.IdxHash, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.sqlite3expert, ptr %19, i32 0, i32 2
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  store ptr %21, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8192, ptr %9) #4
  call void @idxHashInit(ptr noundef %9)
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.sqlite3expert, ptr %22, i32 0, i32 7
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  store ptr %24, ptr %6, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %203, %2
  %26 = load i32, ptr %8, align 4, !tbaa !13
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %31

28:                                               ; preds = %25
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br label %31

31:                                               ; preds = %28, %25
  %32 = phi i1 [ false, %25 ], [ %30, %28 ]
  br i1 %32, label %33, label %207

33:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @idxHashClear(ptr noundef %9)
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.IdxStatement, ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !15
  %39 = call i32 (ptr, ptr, ptr, ptr, ...) @idxPrintfPrepareStmt(ptr noundef %34, ptr noundef %11, ptr noundef %35, ptr noundef @.str.22, ptr noundef %38)
  store i32 %39, ptr %8, align 4, !tbaa !13
  br label %40

40:                                               ; preds = %177, %175, %33
  %41 = load i32, ptr %8, align 4, !tbaa !13
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %47

43:                                               ; preds = %40
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = call i32 @sqlite3_step(ptr noundef %44)
  %46 = icmp eq i32 %45, 100
  br label %47

47:                                               ; preds = %43, %40
  %48 = phi i1 [ false, %40 ], [ %46, %43 ]
  br i1 %48, label %49, label %178

49:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = call ptr @sqlite3_column_text(ptr noundef %50, i32 noundef 3)
  store ptr %51, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %55, label %54

54:                                               ; preds = %49
  store i32 5, ptr %15, align 4
  br label %175, !llvm.loop !17

55:                                               ; preds = %49
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = call i64 @strlen(ptr noundef %56) #5
  %58 = trunc i64 %57 to i32
  store i32 %58, ptr %13, align 4, !tbaa !13
  store i32 0, ptr %14, align 4, !tbaa !13
  br label %59

59:                                               ; preds = %157, %55
  %60 = load i32, ptr %14, align 4, !tbaa !13
  %61 = load i32, ptr %13, align 4, !tbaa !13
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %63, label %160

63:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store ptr null, ptr %16, align 8, !tbaa !5
  %64 = load i32, ptr %14, align 4, !tbaa !13
  %65 = add nsw i32 %64, 13
  %66 = load i32, ptr %13, align 4, !tbaa !13
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %68, label %81

68:                                               ; preds = %63
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = load i32, ptr %14, align 4, !tbaa !13
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i8, ptr %69, i64 %71
  %73 = call i32 @memcmp(ptr noundef %72, ptr noundef @.str.23, i64 noundef 13) #5
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %81

75:                                               ; preds = %68
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = load i32, ptr %14, align 4, !tbaa !13
  %78 = add nsw i32 %77, 13
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i8, ptr %76, i64 %79
  store ptr %80, ptr %16, align 8, !tbaa !5
  br label %100

81:                                               ; preds = %68, %63
  %82 = load i32, ptr %14, align 4, !tbaa !13
  %83 = add nsw i32 %82, 22
  %84 = load i32, ptr %13, align 4, !tbaa !13
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %86, label %99

86:                                               ; preds = %81
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = load i32, ptr %14, align 4, !tbaa !13
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i8, ptr %87, i64 %89
  %91 = call i32 @memcmp(ptr noundef %90, ptr noundef @.str.24, i64 noundef 22) #5
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %99

93:                                               ; preds = %86
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = load i32, ptr %14, align 4, !tbaa !13
  %96 = add nsw i32 %95, 22
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i8, ptr %94, i64 %97
  store ptr %98, ptr %16, align 8, !tbaa !5
  br label %99

99:                                               ; preds = %93, %86, %81
  br label %100

100:                                              ; preds = %99, %75
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = icmp ne ptr %101, null
  br i1 %102, label %103, label %153

103:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !13
  br label %104

104:                                              ; preds = %133, %103
  %105 = load ptr, ptr %16, align 8, !tbaa !5
  %106 = load i32, ptr %18, align 4, !tbaa !13
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i8, ptr %105, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !19
  %110 = sext i8 %109 to i32
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %131

112:                                              ; preds = %104
  %113 = load ptr, ptr %16, align 8, !tbaa !5
  %114 = load i32, ptr %18, align 4, !tbaa !13
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i8, ptr %113, i64 %115
  %117 = load i8, ptr %116, align 1, !tbaa !19
  %118 = sext i8 %117 to i32
  %119 = icmp ne i32 %118, 32
  br i1 %119, label %129, label %120

120:                                              ; preds = %112
  %121 = load ptr, ptr %16, align 8, !tbaa !5
  %122 = load i32, ptr %18, align 4, !tbaa !13
  %123 = add nsw i32 %122, 1
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds i8, ptr %121, i64 %124
  %126 = load i8, ptr %125, align 1, !tbaa !19
  %127 = sext i8 %126 to i32
  %128 = icmp ne i32 %127, 40
  br label %129

129:                                              ; preds = %120, %112
  %130 = phi i1 [ true, %112 ], [ %128, %120 ]
  br label %131

131:                                              ; preds = %129, %104
  %132 = phi i1 [ false, %104 ], [ %130, %129 ]
  br i1 %132, label %133, label %136

133:                                              ; preds = %131
  %134 = load i32, ptr %18, align 4, !tbaa !13
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %18, align 4, !tbaa !13
  br label %104, !llvm.loop !20

136:                                              ; preds = %131
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.sqlite3expert, ptr %137, i32 0, i32 11
  %139 = load ptr, ptr %16, align 8, !tbaa !5
  %140 = load i32, ptr %18, align 4, !tbaa !13
  %141 = call ptr @idxHashSearch(ptr noundef %138, ptr noundef %139, i32 noundef %140)
  store ptr %141, ptr %17, align 8, !tbaa !5
  %142 = load ptr, ptr %17, align 8, !tbaa !5
  %143 = icmp ne ptr %142, null
  br i1 %143, label %144, label %151

144:                                              ; preds = %136
  %145 = load ptr, ptr %17, align 8, !tbaa !5
  %146 = call i32 @idxHashAdd(ptr noundef %8, ptr noundef %9, ptr noundef %145, ptr noundef null)
  %147 = load i32, ptr %8, align 4, !tbaa !13
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %149, label %150

149:                                              ; preds = %144
  store i32 12, ptr %15, align 4
  br label %152

150:                                              ; preds = %144
  br label %151

151:                                              ; preds = %150, %136
  store i32 7, ptr %15, align 4
  br label %152

152:                                              ; preds = %151, %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %154

153:                                              ; preds = %100
  store i32 0, ptr %15, align 4
  br label %154

154:                                              ; preds = %153, %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %155 = load i32, ptr %15, align 4
  switch i32 %155, label %175 [
    i32 0, label %156
    i32 7, label %160
  ]

156:                                              ; preds = %154
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %14, align 4, !tbaa !13
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %14, align 4, !tbaa !13
  br label %59, !llvm.loop !21

160:                                              ; preds = %154, %59
  %161 = load ptr, ptr %12, align 8, !tbaa !5
  %162 = getelementptr inbounds i8, ptr %161, i64 0
  %163 = load i8, ptr %162, align 1, !tbaa !19
  %164 = sext i8 %163 to i32
  %165 = icmp ne i32 %164, 45
  br i1 %165, label %166, label %174

166:                                              ; preds = %160
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.IdxStatement, ptr %167, i32 0, i32 3
  %169 = load ptr, ptr %168, align 8, !tbaa !22
  %170 = load ptr, ptr %12, align 8, !tbaa !5
  %171 = call ptr (ptr, ptr, ptr, ...) @idxAppendText(ptr noundef %8, ptr noundef %169, ptr noundef @.str.25, ptr noundef %170)
  %172 = load ptr, ptr %6, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.IdxStatement, ptr %172, i32 0, i32 3
  store ptr %171, ptr %173, align 8, !tbaa !22
  br label %174

174:                                              ; preds = %166, %160
  store i32 0, ptr %15, align 4
  br label %175

175:                                              ; preds = %174, %154, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %176 = load i32, ptr %15, align 4
  switch i32 %176, label %200 [
    i32 0, label %177
    i32 5, label %40
  ]

177:                                              ; preds = %175
  br label %40, !llvm.loop !17

178:                                              ; preds = %47
  %179 = getelementptr inbounds %struct.IdxHash, ptr %9, i32 0, i32 0
  %180 = load ptr, ptr %179, align 8, !tbaa !23
  store ptr %180, ptr %10, align 8, !tbaa !5
  br label %181

181:                                              ; preds = %194, %178
  %182 = load ptr, ptr %10, align 8, !tbaa !5
  %183 = icmp ne ptr %182, null
  br i1 %183, label %184, label %198

184:                                              ; preds = %181
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.IdxStatement, ptr %185, i32 0, i32 2
  %187 = load ptr, ptr %186, align 8, !tbaa !24
  %188 = load ptr, ptr %10, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.IdxHashEntry, ptr %188, i32 0, i32 0
  %190 = load ptr, ptr %189, align 8, !tbaa !25
  %191 = call ptr (ptr, ptr, ptr, ...) @idxAppendText(ptr noundef %8, ptr noundef %187, ptr noundef @.str.26, ptr noundef %190)
  %192 = load ptr, ptr %6, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.IdxStatement, ptr %192, i32 0, i32 2
  store ptr %191, ptr %193, align 8, !tbaa !24
  br label %194

194:                                              ; preds = %184
  %195 = load ptr, ptr %10, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.IdxHashEntry, ptr %195, i32 0, i32 4
  %197 = load ptr, ptr %196, align 8, !tbaa !27
  store ptr %197, ptr %10, align 8, !tbaa !5
  br label %181, !llvm.loop !28

198:                                              ; preds = %181
  %199 = load ptr, ptr %11, align 8, !tbaa !5
  call void @idxFinalize(ptr noundef %8, ptr noundef %199)
  store i32 0, ptr %15, align 4
  br label %200

200:                                              ; preds = %198, %175
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %201 = load i32, ptr %15, align 4
  switch i32 %201, label %210 [
    i32 0, label %202
    i32 12, label %208
  ]

202:                                              ; preds = %200
  br label %203

203:                                              ; preds = %202
  %204 = load ptr, ptr %6, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.IdxStatement, ptr %204, i32 0, i32 4
  %206 = load ptr, ptr %205, align 8, !tbaa !29
  store ptr %206, ptr %6, align 8, !tbaa !5
  br label %25, !llvm.loop !30

207:                                              ; preds = %31
  br label %208

208:                                              ; preds = %207, %200
  call void @idxHashClear(ptr noundef %9)
  %209 = load i32, ptr %8, align 4, !tbaa !13
  store i32 %209, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %210

210:                                              ; preds = %208, %200
  call void @llvm.lifetime.end.p0(i64 8192, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %211 = load i32, ptr %3, align 4
  ret i32 %211
}

; Function Attrs: nounwind uwtable
declare hidden void @idxHashInit(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @idxHashClear(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @idxPrintfPrepareStmt(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ...) #1

declare i32 @sqlite3_step(ptr noundef) #2

declare ptr @sqlite3_column_text(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @idxAppendText(ptr noundef, ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare hidden void @idxFinalize(ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 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 #4 = { nounwind }
attributes #5 = { 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, !6, i64 16}
!10 = !{!"sqlite3expert", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !6, i64 72, !11, i64 80, !12, i64 88, !6, i64 8280}
!11 = !{!"int", !7, i64 0}
!12 = !{!"IdxHash", !6, i64 0, !7, i64 8}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 56}
!15 = !{!16, !6, i64 8}
!16 = !{!"IdxStatement", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = !{!16, !6, i64 24}
!23 = !{!12, !6, i64 0}
!24 = !{!16, !6, i64 16}
!25 = !{!26, !6, i64 0}
!26 = !{!"IdxHashEntry", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!27 = !{!26, !6, i64 32}
!28 = distinct !{!28, !18}
!29 = !{!16, !6, i64 32}
!30 = distinct !{!30, !18}


; 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.IdxHash = type { ptr, [1023 x ptr] }

@.str.22 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [5 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

; Function Attrs: nounwind uwtable
define dso_local i32 @idxFindIndexes(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = alloca i32, align 4
  %4 = alloca %struct.IdxHash, align 8
  %5 = alloca ptr, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 0, ptr %3, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8192, ptr nonnull %4) #5
  call void @idxHashInit(ptr noundef nonnull %4)
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  %.05793 = load ptr, ptr %8, align 8, !tbaa !13
  %.not101 = icmp eq ptr %.05793, null
  br i1 %.not101, label %.loopexit85, label %.lr.ph96

.lr.ph96:                                         ; preds = %2
  %9 = getelementptr inbounds i8, ptr %0, i64 88
  br label %10

10:                                               ; preds = %.lr.ph96, %._crit_edge
  %.05794 = phi ptr [ %.05793, %.lr.ph96 ], [ %.057, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store ptr null, ptr %5, align 8, !tbaa !13
  call void @idxHashClear(ptr noundef nonnull %4)
  %11 = getelementptr inbounds i8, ptr %.05794, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !14
  %13 = call i32 (ptr, ptr, ptr, ptr, ...) @idxPrintfPrepareStmt(ptr noundef %7, ptr noundef nonnull %5, ptr noundef %1, ptr noundef nonnull @.str.22, ptr noundef %12)
  store i32 %13, ptr %3, align 4, !tbaa !12
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %.lr.ph87, label %.critedge

.lr.ph87:                                         ; preds = %10
  %15 = getelementptr inbounds i8, ptr %.05794, i64 24
  br label %17

thread-pre-split:                                 ; preds = %21, %54, %.loopexit
  %.pr = load i32, ptr %3, align 4, !tbaa !12
  %16 = icmp eq i32 %.pr, 0
  br i1 %16, label %17, label %.critedge

17:                                               ; preds = %.lr.ph87, %thread-pre-split
  %18 = load ptr, ptr %5, align 8, !tbaa !13
  %19 = call i32 @sqlite3_step(ptr noundef %18) #5
  %20 = icmp eq i32 %19, 100
  br i1 %20, label %21, label %.critedge

21:                                               ; preds = %17
  %22 = load ptr, ptr %5, align 8, !tbaa !13
  %23 = call ptr @sqlite3_column_text(ptr noundef %22, i32 noundef 3) #5
  %.not65 = icmp eq ptr %23, null
  br i1 %.not65, label %thread-pre-split, label %24, !llvm.loop !16

24:                                               ; preds = %21
  %25 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %23) #6
  %26 = trunc i64 %25 to i32
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %24
  %28 = and i64 %25, 2147483647
  %wide.trip.count = and i64 %25, 2147483647
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %52
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %52 ]
  %29 = add nuw nsw i64 %indvars.iv, 13
  %30 = icmp ult i64 %29, %28
  br i1 %30, label %31, label %34

31:                                               ; preds = %.lr.ph
  %32 = getelementptr inbounds i8, ptr %23, i64 %indvars.iv
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(13) %32, ptr noundef nonnull dereferenceable(13) @.str.23, i64 13)
  %33 = icmp eq i32 %bcmp, 0
  br i1 %33, label %.split.loop.exit102, label %34

34:                                               ; preds = %31, %.lr.ph
  %35 = trunc i64 %indvars.iv to i32
  %36 = add i32 %35, 22
  %37 = icmp slt i32 %36, %26
  br i1 %37, label %38, label %52

38:                                               ; preds = %34
  %39 = getelementptr inbounds i8, ptr %23, i64 %indvars.iv
  %bcmp66 = call i32 @bcmp(ptr noundef nonnull dereferenceable(22) %39, ptr noundef nonnull dereferenceable(22) @.str.24, i64 22)
  %40 = icmp eq i32 %bcmp66, 0
  br i1 %40, label %.split.loop.exit, label %52

.split.loop.exit:                                 ; preds = %38
  %41 = add nuw i64 %indvars.iv, 22
  br label %.split.loop.exit102

.split.loop.exit102:                              ; preds = %31, %.split.loop.exit
  %.pn.in = phi i64 [ %41, %.split.loop.exit ], [ %29, %31 ]
  %.pn = and i64 %.pn.in, 4294967295
  %.054 = getelementptr inbounds i8, ptr %23, i64 %.pn
  %invariant.gep = getelementptr inbounds i8, ptr %.054, i64 1
  br label %42

42:                                               ; preds = %.split.loop.exit102, %.critedge4
  %indvars.iv98 = phi i64 [ 0, %.split.loop.exit102 ], [ %indvars.iv.next99, %.critedge4 ]
  %43 = getelementptr inbounds i8, ptr %.054, i64 %indvars.iv98
  %44 = load i8, ptr %43, align 1, !tbaa !18
  switch i8 %44, label %.critedge4 [
    i8 0, label %.critedge2
    i8 32, label %45
  ]

45:                                               ; preds = %42
  %gep = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv98
  %46 = load i8, ptr %gep, align 1, !tbaa !18
  %.not70 = icmp eq i8 %46, 40
  br i1 %.not70, label %.critedge2, label %.critedge4

.critedge4:                                       ; preds = %42, %45
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  br label %42, !llvm.loop !19

.critedge2:                                       ; preds = %42, %45
  %47 = trunc nuw nsw i64 %indvars.iv98 to i32
  %48 = call ptr @idxHashSearch(ptr noundef nonnull %9, ptr noundef nonnull %.054, i32 noundef %47)
  %.not71 = icmp eq ptr %48, null
  br i1 %.not71, label %.loopexit, label %49

49:                                               ; preds = %.critedge2
  %50 = call i32 @idxHashAdd(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %48, ptr noundef null)
  %51 = load i32, ptr %3, align 4, !tbaa !12
  %.not72 = icmp eq i32 %51, 0
  br i1 %.not72, label %.loopexit, label %63

52:                                               ; preds = %38, %34
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !20

.loopexit:                                        ; preds = %52, %24, %49, %.critedge2
  %53 = load i8, ptr %23, align 1, !tbaa !18
  %.not73 = icmp eq i8 %53, 45
  br i1 %.not73, label %thread-pre-split, label %54

54:                                               ; preds = %.loopexit
  %55 = load ptr, ptr %15, align 8, !tbaa !21
  %56 = call ptr (ptr, ptr, ptr, ...) @idxAppendText(ptr noundef nonnull %3, ptr noundef %55, ptr noundef nonnull @.str.25, ptr noundef nonnull %23)
  store ptr %56, ptr %15, align 8, !tbaa !21
  br label %thread-pre-split

.critedge:                                        ; preds = %17, %thread-pre-split, %10
  %.05889 = load ptr, ptr %4, align 8, !tbaa !13
  %.not90 = icmp eq ptr %.05889, null
  br i1 %.not90, label %._crit_edge, label %.lr.ph92

.lr.ph92:                                         ; preds = %.critedge
  %57 = getelementptr inbounds i8, ptr %.05794, i64 16
  %.pre = load ptr, ptr %57, align 8, !tbaa !22
  br label %58

58:                                               ; preds = %.lr.ph92, %58
  %59 = phi ptr [ %.pre, %.lr.ph92 ], [ %61, %58 ]
  %.05891 = phi ptr [ %.05889, %.lr.ph92 ], [ %.058, %58 ]
  %60 = load ptr, ptr %.05891, align 8, !tbaa !23
  %61 = call ptr (ptr, ptr, ptr, ...) @idxAppendText(ptr noundef nonnull %3, ptr noundef %59, ptr noundef nonnull @.str.26, ptr noundef %60)
  store ptr %61, ptr %57, align 8, !tbaa !22
  %62 = getelementptr inbounds i8, ptr %.05891, i64 32
  %.058 = load ptr, ptr %62, align 8, !tbaa !13
  %.not = icmp eq ptr %.058, null
  br i1 %.not, label %._crit_edge, label %58, !llvm.loop !25

63:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %.loopexit85

._crit_edge:                                      ; preds = %58, %.critedge
  %64 = load ptr, ptr %5, align 8, !tbaa !13
  call void @idxFinalize(ptr noundef nonnull %3, ptr noundef %64)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %65 = getelementptr inbounds i8, ptr %.05794, i64 32
  %.057 = load ptr, ptr %65, align 8, !tbaa !13
  %66 = load i32, ptr %3, align 4, !tbaa !12
  %67 = icmp eq i32 %66, 0
  %68 = icmp ne ptr %.057, null
  %69 = select i1 %67, i1 %68, i1 false
  br i1 %69, label %10, label %.loopexit85, !llvm.loop !26

.loopexit85:                                      ; preds = %._crit_edge, %2, %63
  call void @idxHashClear(ptr noundef nonnull %4)
  %70 = load i32, ptr %3, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  ret i32 %70
}

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @idxPrintfPrepareStmt(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

declare i32 @sqlite3_step(ptr noundef) local_unnamed_addr #2

declare ptr @sqlite3_column_text(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @idxAppendText(ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @idxFinalize(ptr noundef, ptr noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn 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 #4 = { nofree nounwind willreturn memory(argmem: read) }
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, !10, i64 16}
!6 = !{!"sqlite3expert", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !10, i64 72, !7, i64 80, !11, i64 88, !10, i64 8280}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"IdxHash", !10, i64 0, !8, i64 8}
!12 = !{!7, !7, i64 0}
!13 = !{!10, !10, i64 0}
!14 = !{!15, !10, i64 8}
!15 = !{!"IdxStatement", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!8, !8, i64 0}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}
!21 = !{!15, !10, i64 24}
!22 = !{!15, !10, i64 16}
!23 = !{!24, !10, i64 0}
!24 = !{!"IdxHashEntry", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!25 = distinct !{!25, !17}
!26 = distinct !{!26, !17}


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