; LLVM IR from ibr-ds/STANlite :: Enclave/sqlite (insert)

; 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.Table = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i16, i16, i16, i16, i8, i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct.Parse = type { ptr, ptr, ptr, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, %struct.Token, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i8, i8, i8, [10 x %struct.yColCache], [8 x i32], %struct.Token, %struct.Token, i16, i8, i8, i8, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Token, ptr, ptr, ptr, ptr, ptr }
%struct.yColCache = type { i32, i16, i8, i32, i32, i32 }
%struct.Token = type { ptr, i32 }
%struct.Index = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i16, i16, i16, i8, i8 }

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

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

declare ptr @sqlite3GetVdbe(ptr noundef) #2

declare void @sqlite3TableLock(ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef) #2

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

declare void @sqlite3VdbeSetP4KeyInfo(ptr noundef, ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3OpenTableAndIndices(ptr noundef %0, ptr noundef %1, i32 noundef %2, i8 noundef zeroext %3, i32 noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #0 {
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store i32 %2, ptr %12, align 4, !tbaa !9
  store i8 %3, ptr %13, align 1, !tbaa !11
  store i32 %4, ptr %14, align 4, !tbaa !9
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %25 = load ptr, ptr %11, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.Table, ptr %25, i32 0, i32 16
  %27 = load i32, ptr %26, align 4, !tbaa !12
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %8
  store i32 0, ptr %9, align 4
  store i32 1, ptr %23, align 4
  br label %168

30:                                               ; preds = %8
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.Parse, ptr %31, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8, !tbaa !15
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.Table, ptr %34, i32 0, i32 20
  %36 = load ptr, ptr %35, align 8, !tbaa !18
  %37 = call i32 @sqlite3SchemaToIndex(ptr noundef %33, ptr noundef %36)
  store i32 %37, ptr %19, align 4, !tbaa !9
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = call ptr @sqlite3GetVdbe(ptr noundef %38)
  store ptr %39, ptr %22, align 8, !tbaa !5
  %40 = load i32, ptr %14, align 4, !tbaa !9
  %41 = icmp slt i32 %40, 0
  br i1 %41, label %42, label %46

42:                                               ; preds = %30
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.Parse, ptr %43, i32 0, i32 17
  %45 = load i32, ptr %44, align 4, !tbaa !19
  store i32 %45, ptr %14, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %42, %30
  %47 = load i32, ptr %14, align 4, !tbaa !9
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %14, align 4, !tbaa !9
  store i32 %47, ptr %20, align 4, !tbaa !9
  %49 = load ptr, ptr %16, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %54

51:                                               ; preds = %46
  %52 = load i32, ptr %20, align 4, !tbaa !9
  %53 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %52, ptr %53, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %51, %46
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Table, ptr %55, i32 0, i32 9
  %57 = load i32, ptr %56, align 8, !tbaa !20
  %58 = and i32 %57, 32
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %75

60:                                               ; preds = %54
  %61 = load ptr, ptr %15, align 8, !tbaa !5
  %62 = icmp eq ptr %61, null
  br i1 %62, label %69, label %63

63:                                               ; preds = %60
  %64 = load ptr, ptr %15, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 0
  %66 = load i8, ptr %65, align 1, !tbaa !11
  %67 = zext i8 %66 to i32
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %75

69:                                               ; preds = %63, %60
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = load i32, ptr %20, align 4, !tbaa !9
  %72 = load i32, ptr %19, align 4, !tbaa !9
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = load i32, ptr %12, align 4, !tbaa !9
  call void @sqlite3OpenTable(ptr noundef %70, i32 noundef %71, i32 noundef %72, ptr noundef %73, i32 noundef %74)
  br label %88

75:                                               ; preds = %63, %54
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = load i32, ptr %19, align 4, !tbaa !9
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.Table, ptr %78, i32 0, i32 7
  %80 = load i32, ptr %79, align 8, !tbaa !21
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = icmp eq i32 %81, 106
  %83 = zext i1 %82 to i32
  %84 = trunc i32 %83 to i8
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.Table, ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !22
  call void @sqlite3TableLock(ptr noundef %76, i32 noundef %77, i32 noundef %80, i8 noundef zeroext %84, ptr noundef %87)
  br label %88

88:                                               ; preds = %75, %69
  %89 = load ptr, ptr %17, align 8, !tbaa !5
  %90 = icmp ne ptr %89, null
  br i1 %90, label %91, label %94

91:                                               ; preds = %88
  %92 = load i32, ptr %14, align 4, !tbaa !9
  %93 = load ptr, ptr %17, align 8, !tbaa !5
  store i32 %92, ptr %93, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %91, %88
  store i32 0, ptr %18, align 4, !tbaa !9
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.Table, ptr %95, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !23
  store ptr %97, ptr %21, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %150, %94
  %99 = load ptr, ptr %21, align 8, !tbaa !5
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %156

101:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %102 = load i32, ptr %14, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %14, align 4, !tbaa !9
  store i32 %102, ptr %24, align 4, !tbaa !9
  %104 = load ptr, ptr %21, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.Index, ptr %104, i32 0, i32 16
  %106 = load i8, ptr %105, align 1
  %107 = and i8 %106, 3
  %108 = zext i8 %107 to i32
  %109 = icmp eq i32 %108, 2
  br i1 %109, label %110, label %123

110:                                              ; preds = %101
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.Table, ptr %111, i32 0, i32 9
  %113 = load i32, ptr %112, align 8, !tbaa !20
  %114 = and i32 %113, 32
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %123, label %116

116:                                              ; preds = %110
  %117 = load ptr, ptr %16, align 8, !tbaa !5
  %118 = icmp ne ptr %117, null
  br i1 %118, label %119, label %122

119:                                              ; preds = %116
  %120 = load i32, ptr %24, align 4, !tbaa !9
  %121 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %120, ptr %121, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %119, %116
  store i8 0, ptr %13, align 1, !tbaa !11
  br label %123

123:                                              ; preds = %122, %110, %101
  %124 = load ptr, ptr %15, align 8, !tbaa !5
  %125 = icmp eq ptr %124, null
  br i1 %125, label %135, label %126

126:                                              ; preds = %123
  %127 = load ptr, ptr %15, align 8, !tbaa !5
  %128 = load i32, ptr %18, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i8, ptr %127, i64 %130
  %132 = load i8, ptr %131, align 1, !tbaa !11
  %133 = zext i8 %132 to i32
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %135, label %149

135:                                              ; preds = %126, %123
  %136 = load ptr, ptr %22, align 8, !tbaa !5
  %137 = load i32, ptr %12, align 4, !tbaa !9
  %138 = load i32, ptr %24, align 4, !tbaa !9
  %139 = load ptr, ptr %21, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.Index, ptr %139, i32 0, i32 11
  %141 = load i32, ptr %140, align 8, !tbaa !24
  %142 = load i32, ptr %19, align 4, !tbaa !9
  %143 = call i32 @sqlite3VdbeAddOp3(ptr noundef %136, i32 noundef %137, i32 noundef %138, i32 noundef %141, i32 noundef %142)
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = load ptr, ptr %21, align 8, !tbaa !5
  call void @sqlite3VdbeSetP4KeyInfo(ptr noundef %144, ptr noundef %145)
  %146 = load ptr, ptr %22, align 8, !tbaa !5
  %147 = load i8, ptr %13, align 1, !tbaa !11
  %148 = zext i8 %147 to i16
  call void @sqlite3VdbeChangeP5(ptr noundef %146, i16 noundef zeroext %148)
  br label %149

149:                                              ; preds = %135, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr %21, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.Index, ptr %151, i32 0, i32 5
  %153 = load ptr, ptr %152, align 8, !tbaa !26
  store ptr %153, ptr %21, align 8, !tbaa !5
  %154 = load i32, ptr %18, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %18, align 4, !tbaa !9
  br label %98, !llvm.loop !27

156:                                              ; preds = %98
  %157 = load i32, ptr %14, align 4, !tbaa !9
  %158 = load ptr, ptr %10, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.Parse, ptr %158, i32 0, i32 17
  %160 = load i32, ptr %159, align 4, !tbaa !19
  %161 = icmp sgt i32 %157, %160
  br i1 %161, label %162, label %166

162:                                              ; preds = %156
  %163 = load i32, ptr %14, align 4, !tbaa !9
  %164 = load ptr, ptr %10, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.Parse, ptr %164, i32 0, i32 17
  store i32 %163, ptr %165, align 4, !tbaa !19
  br label %166

166:                                              ; preds = %162, %156
  %167 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %167, ptr %9, align 4
  store i32 1, ptr %23, align 4
  br label %168

168:                                              ; preds = %166, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  %169 = load i32, ptr %9, align 4
  ret i32 %169
}

declare void @sqlite3VdbeChangeP5(ptr noundef, i16 noundef zeroext) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 }

!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 = !{!7, !7, i64 0}
!12 = !{!13, !10, i64 84}
!13 = !{!"Table", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !14, i64 68, !14, i64 70, !14, i64 72, !14, i64 74, !7, i64 76, !10, i64 80, !10, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!14 = !{!"short", !7, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"Parse", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !7, i64 36, !7, i64 37, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !6, i64 88, !6, i64 96, !17, i64 104, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !7, i64 192, !7, i64 193, !7, i64 194, !7, i64 196, !7, i64 396, !17, i64 432, !17, i64 448, !14, i64 464, !7, i64 466, !7, i64 467, !7, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !17, i64 536, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584}
!17 = !{!"Token", !6, i64 0, !10, i64 8}
!18 = !{!13, !6, i64 112}
!19 = !{!16, !10, i64 52}
!20 = !{!13, !10, i64 64}
!21 = !{!13, !10, i64 56}
!22 = !{!13, !6, i64 0}
!23 = !{!13, !6, i64 16}
!24 = !{!25, !10, i64 88}
!25 = !{!"Index", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !14, i64 92, !14, i64 94, !14, i64 96, !7, i64 98, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99}
!26 = !{!25, !6, i64 40}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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

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

declare ptr @sqlite3GetVdbe(ptr noundef) local_unnamed_addr #1

declare void @sqlite3TableLock(ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #1

declare i32 @sqlite3VdbeAddOp3(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

declare i32 @sqlite3SchemaToIndex(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3OpenTableAndIndices(ptr noundef %0, ptr noundef %1, i32 noundef %2, i8 noundef zeroext %3, i32 noundef %4, ptr noundef readonly %5, ptr noundef writeonly %6, ptr noundef writeonly %7) local_unnamed_addr #0 {
  %9 = getelementptr inbounds i8, ptr %1, i64 84
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %121

11:                                               ; preds = %8
  %12 = load ptr, ptr %0, align 8, !tbaa !12
  %13 = getelementptr inbounds i8, ptr %1, i64 112
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  %15 = tail call i32 @sqlite3SchemaToIndex(ptr noundef %12, ptr noundef %14) #2
  %16 = tail call ptr @sqlite3GetVdbe(ptr noundef nonnull %0) #2
  %17 = icmp slt i32 %4, 0
  br i1 %17, label %18, label %21

18:                                               ; preds = %11
  %19 = getelementptr inbounds i8, ptr %0, i64 52
  %20 = load i32, ptr %19, align 4, !tbaa !16
  br label %21

21:                                               ; preds = %18, %11
  %.055 = phi i32 [ %20, %18 ], [ %4, %11 ]
  %22 = add nsw i32 %.055, 1
  %.not64 = icmp eq ptr %6, null
  br i1 %.not64, label %24, label %23

23:                                               ; preds = %21
  store i32 %.055, ptr %6, align 4, !tbaa !17
  br label %24

24:                                               ; preds = %23, %21
  %25 = getelementptr inbounds i8, ptr %1, i64 64
  %26 = load i32, ptr %25, align 8, !tbaa !18
  %27 = and i32 %26, 32
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %34

29:                                               ; preds = %24
  %30 = icmp eq ptr %5, null
  br i1 %30, label %33, label %31

31:                                               ; preds = %29
  %32 = load i8, ptr %5, align 1, !tbaa !19
  %.not65 = icmp eq i8 %32, 0
  br i1 %.not65, label %34, label %33

33:                                               ; preds = %31, %29
  tail call void @sqlite3OpenTable(ptr noundef nonnull %0, i32 noundef %.055, i32 noundef %15, ptr noundef nonnull %1, i32 noundef %2)
  br label %40

34:                                               ; preds = %31, %24
  %35 = getelementptr inbounds i8, ptr %1, i64 56
  %36 = load i32, ptr %35, align 8, !tbaa !20
  %37 = icmp eq i32 %2, 106
  %38 = zext i1 %37 to i8
  %39 = load ptr, ptr %1, align 8, !tbaa !21
  tail call void @sqlite3TableLock(ptr noundef nonnull %0, i32 noundef %15, i32 noundef %36, i8 noundef zeroext %38, ptr noundef %39) #2
  br label %40

40:                                               ; preds = %34, %33
  %.not66 = icmp eq ptr %7, null
  br i1 %.not66, label %42, label %41

41:                                               ; preds = %40
  store i32 %22, ptr %7, align 4, !tbaa !17
  br label %42

42:                                               ; preds = %41, %40
  %43 = getelementptr inbounds i8, ptr %1, i64 16
  %invariant.gep = getelementptr inbounds i8, ptr %5, i64 1
  %.05469 = load ptr, ptr %43, align 8, !tbaa !22
  %.not6770 = icmp eq ptr %.05469, null
  br i1 %.not6770, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %42
  %44 = icmp eq ptr %5, null
  br i1 %44, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph
  br i1 %.not64, label %.lr.ph.split.us.split.us, label %.lr.ph.split.us.split

.lr.ph.split.us.split.us:                         ; preds = %.lr.ph.split.us, %54
  %.05474.us.us = phi ptr [ %.054.us.us, %54 ], [ %.05469, %.lr.ph.split.us ]
  %.05373.us.us = phi i8 [ %.1.us.us, %54 ], [ %3, %.lr.ph.split.us ]
  %.15672.us.us = phi i32 [ %45, %54 ], [ %22, %.lr.ph.split.us ]
  %.05771.us.us = phi i32 [ %60, %54 ], [ 0, %.lr.ph.split.us ]
  %45 = add nsw i32 %.15672.us.us, 1
  %46 = getelementptr inbounds i8, ptr %.05474.us.us, i64 99
  %47 = load i8, ptr %46, align 1
  %48 = and i8 %47, 3
  %49 = icmp eq i8 %48, 2
  br i1 %49, label %50, label %54

50:                                               ; preds = %.lr.ph.split.us.split.us
  %51 = load i32, ptr %25, align 8, !tbaa !18
  %52 = and i32 %51, 32
  %53 = icmp eq i32 %52, 0
  %.053.mux.us.us = select i1 %53, i8 %.05373.us.us, i8 0
  br label %54

54:                                               ; preds = %50, %.lr.ph.split.us.split.us
  %.1.us.us = phi i8 [ %.053.mux.us.us, %50 ], [ %.05373.us.us, %.lr.ph.split.us.split.us ]
  %55 = getelementptr inbounds i8, ptr %.05474.us.us, i64 88
  %56 = load i32, ptr %55, align 8, !tbaa !23
  %57 = tail call i32 @sqlite3VdbeAddOp3(ptr noundef %16, i32 noundef %2, i32 noundef %.15672.us.us, i32 noundef %56, i32 noundef %15) #2
  tail call void @sqlite3VdbeSetP4KeyInfo(ptr noundef nonnull %0, ptr noundef nonnull %.05474.us.us) #2
  %58 = zext i8 %.1.us.us to i16
  tail call void @sqlite3VdbeChangeP5(ptr noundef %16, i16 noundef zeroext %58) #2
  %59 = getelementptr inbounds i8, ptr %.05474.us.us, i64 40
  %60 = add nuw nsw i32 %.05771.us.us, 1
  %.054.us.us = load ptr, ptr %59, align 8, !tbaa !22
  %.not67.us.us = icmp eq ptr %.054.us.us, null
  br i1 %.not67.us.us, label %._crit_edge, label %.lr.ph.split.us.split.us, !llvm.loop !25

.lr.ph.split.us.split:                            ; preds = %.lr.ph.split.us, %71
  %.05474.us = phi ptr [ %.054.us, %71 ], [ %.05469, %.lr.ph.split.us ]
  %.05373.us = phi i8 [ %.1.us, %71 ], [ %3, %.lr.ph.split.us ]
  %.15672.us = phi i32 [ %61, %71 ], [ %22, %.lr.ph.split.us ]
  %.05771.us = phi i32 [ %77, %71 ], [ 0, %.lr.ph.split.us ]
  %61 = add nsw i32 %.15672.us, 1
  %62 = getelementptr inbounds i8, ptr %.05474.us, i64 99
  %63 = load i8, ptr %62, align 1
  %64 = and i8 %63, 3
  %65 = icmp eq i8 %64, 2
  br i1 %65, label %66, label %71

66:                                               ; preds = %.lr.ph.split.us.split
  %67 = load i32, ptr %25, align 8, !tbaa !18
  %68 = and i32 %67, 32
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 %.15672.us, ptr %6, align 4, !tbaa !17
  br label %71

71:                                               ; preds = %70, %66, %.lr.ph.split.us.split
  %.1.us = phi i8 [ %.05373.us, %66 ], [ %.05373.us, %.lr.ph.split.us.split ], [ 0, %70 ]
  %72 = getelementptr inbounds i8, ptr %.05474.us, i64 88
  %73 = load i32, ptr %72, align 8, !tbaa !23
  %74 = tail call i32 @sqlite3VdbeAddOp3(ptr noundef %16, i32 noundef %2, i32 noundef %.15672.us, i32 noundef %73, i32 noundef %15) #2
  tail call void @sqlite3VdbeSetP4KeyInfo(ptr noundef nonnull %0, ptr noundef nonnull %.05474.us) #2
  %75 = zext i8 %.1.us to i16
  tail call void @sqlite3VdbeChangeP5(ptr noundef %16, i16 noundef zeroext %75) #2
  %76 = getelementptr inbounds i8, ptr %.05474.us, i64 40
  %77 = add nuw nsw i32 %.05771.us, 1
  %.054.us = load ptr, ptr %76, align 8, !tbaa !22
  %.not67.us = icmp eq ptr %.054.us, null
  br i1 %.not67.us, label %._crit_edge, label %.lr.ph.split.us.split, !llvm.loop !25

.lr.ph.split:                                     ; preds = %.lr.ph
  br i1 %.not64, label %.lr.ph.split.split.us, label %.lr.ph.split.split

.lr.ph.split.split.us:                            ; preds = %.lr.ph.split, %94
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %94 ], [ 0, %.lr.ph.split ]
  %.05474.us77 = phi ptr [ %.054.us84, %94 ], [ %.05469, %.lr.ph.split ]
  %.05373.us78 = phi i8 [ %.1.us83, %94 ], [ %3, %.lr.ph.split ]
  %.15672.us79 = phi i32 [ %78, %94 ], [ %22, %.lr.ph.split ]
  %78 = add nsw i32 %.15672.us79, 1
  %79 = getelementptr inbounds i8, ptr %.05474.us77, i64 99
  %80 = load i8, ptr %79, align 1
  %81 = and i8 %80, 3
  %82 = icmp eq i8 %81, 2
  br i1 %82, label %83, label %87

83:                                               ; preds = %.lr.ph.split.split.us
  %84 = load i32, ptr %25, align 8, !tbaa !18
  %85 = and i32 %84, 32
  %86 = icmp eq i32 %85, 0
  %.053.mux.us82 = select i1 %86, i8 %.05373.us78, i8 0
  br label %87

87:                                               ; preds = %83, %.lr.ph.split.split.us
  %.1.us83 = phi i8 [ %.053.mux.us82, %83 ], [ %.05373.us78, %.lr.ph.split.split.us ]
  %gep.us = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv102
  %88 = load i8, ptr %gep.us, align 1, !tbaa !19
  %.not68.us = icmp eq i8 %88, 0
  br i1 %.not68.us, label %94, label %89

89:                                               ; preds = %87
  %90 = getelementptr inbounds i8, ptr %.05474.us77, i64 88
  %91 = load i32, ptr %90, align 8, !tbaa !23
  %92 = tail call i32 @sqlite3VdbeAddOp3(ptr noundef %16, i32 noundef %2, i32 noundef %.15672.us79, i32 noundef %91, i32 noundef %15) #2
  tail call void @sqlite3VdbeSetP4KeyInfo(ptr noundef nonnull %0, ptr noundef nonnull %.05474.us77) #2
  %93 = zext i8 %.1.us83 to i16
  tail call void @sqlite3VdbeChangeP5(ptr noundef %16, i16 noundef zeroext %93) #2
  br label %94

94:                                               ; preds = %89, %87
  %95 = getelementptr inbounds i8, ptr %.05474.us77, i64 40
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %.054.us84 = load ptr, ptr %95, align 8, !tbaa !22
  %.not67.us85 = icmp eq ptr %.054.us84, null
  br i1 %.not67.us85, label %._crit_edge.loopexit93, label %.lr.ph.split.split.us, !llvm.loop !25

.lr.ph.split.split:                               ; preds = %.lr.ph.split, %113
  %indvars.iv = phi i64 [ %indvars.iv.next, %113 ], [ 0, %.lr.ph.split ]
  %.05474 = phi ptr [ %.054, %113 ], [ %.05469, %.lr.ph.split ]
  %.05373 = phi i8 [ %.1, %113 ], [ %3, %.lr.ph.split ]
  %.15672 = phi i32 [ %96, %113 ], [ %22, %.lr.ph.split ]
  %96 = add nsw i32 %.15672, 1
  %97 = getelementptr inbounds i8, ptr %.05474, i64 99
  %98 = load i8, ptr %97, align 1
  %99 = and i8 %98, 3
  %100 = icmp eq i8 %99, 2
  br i1 %100, label %101, label %106

101:                                              ; preds = %.lr.ph.split.split
  %102 = load i32, ptr %25, align 8, !tbaa !18
  %103 = and i32 %102, 32
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %106, label %105

105:                                              ; preds = %101
  store i32 %.15672, ptr %6, align 4, !tbaa !17
  br label %106

106:                                              ; preds = %101, %105, %.lr.ph.split.split
  %.1 = phi i8 [ %.05373, %101 ], [ %.05373, %.lr.ph.split.split ], [ 0, %105 ]
  %gep = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv
  %107 = load i8, ptr %gep, align 1, !tbaa !19
  %.not68 = icmp eq i8 %107, 0
  br i1 %.not68, label %113, label %108

108:                                              ; preds = %106
  %109 = getelementptr inbounds i8, ptr %.05474, i64 88
  %110 = load i32, ptr %109, align 8, !tbaa !23
  %111 = tail call i32 @sqlite3VdbeAddOp3(ptr noundef %16, i32 noundef %2, i32 noundef %.15672, i32 noundef %110, i32 noundef %15) #2
  tail call void @sqlite3VdbeSetP4KeyInfo(ptr noundef nonnull %0, ptr noundef nonnull %.05474) #2
  %112 = zext i8 %.1 to i16
  tail call void @sqlite3VdbeChangeP5(ptr noundef %16, i16 noundef zeroext %112) #2
  br label %113

113:                                              ; preds = %108, %106
  %114 = getelementptr inbounds i8, ptr %.05474, i64 40
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.054 = load ptr, ptr %114, align 8, !tbaa !22
  %.not67 = icmp eq ptr %.054, null
  br i1 %.not67, label %._crit_edge.loopexit94, label %.lr.ph.split.split, !llvm.loop !25

._crit_edge.loopexit93:                           ; preds = %94
  %115 = trunc nuw i64 %indvars.iv.next103 to i32
  br label %._crit_edge

._crit_edge.loopexit94:                           ; preds = %113
  %116 = trunc nuw i64 %indvars.iv.next to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %71, %54, %._crit_edge.loopexit94, %._crit_edge.loopexit93, %42
  %.057.lcssa = phi i32 [ 0, %42 ], [ %115, %._crit_edge.loopexit93 ], [ %116, %._crit_edge.loopexit94 ], [ %60, %54 ], [ %77, %71 ]
  %.156.lcssa = phi i32 [ %22, %42 ], [ %78, %._crit_edge.loopexit93 ], [ %96, %._crit_edge.loopexit94 ], [ %45, %54 ], [ %61, %71 ]
  %117 = getelementptr inbounds i8, ptr %0, i64 52
  %118 = load i32, ptr %117, align 4, !tbaa !16
  %119 = icmp sgt i32 %.156.lcssa, %118
  br i1 %119, label %120, label %121

120:                                              ; preds = %._crit_edge
  store i32 %.156.lcssa, ptr %117, align 4, !tbaa !16
  br label %121

121:                                              ; preds = %._crit_edge, %120, %8
  %.0 = phi i32 [ 0, %8 ], [ %.057.lcssa, %120 ], [ %.057.lcssa, %._crit_edge ]
  ret i32 %.0
}

declare void @sqlite3VdbeChangeP5(ptr noundef, i16 noundef zeroext) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 }

!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 84}
!6 = !{!"Table", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !11, i64 68, !11, i64 70, !11, i64 72, !11, i64 74, !8, i64 76, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!13, !7, i64 0}
!13 = !{!"Parse", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !8, i64 28, !8, i64 29, !8, i64 30, !8, i64 31, !8, i64 32, !8, i64 33, !8, i64 34, !8, i64 35, !8, i64 36, !8, i64 37, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 96, !14, i64 104, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !8, i64 192, !8, i64 193, !8, i64 194, !8, i64 196, !8, i64 396, !14, i64 432, !14, i64 448, !11, i64 464, !8, i64 466, !8, i64 467, !8, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !14, i64 536, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584}
!14 = !{!"Token", !7, i64 0, !10, i64 8}
!15 = !{!6, !7, i64 112}
!16 = !{!13, !10, i64 52}
!17 = !{!10, !10, i64 0}
!18 = !{!6, !10, i64 64}
!19 = !{!8, !8, i64 0}
!20 = !{!6, !10, i64 56}
!21 = !{!6, !7, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!24, !10, i64 88}
!24 = !{!"Index", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !10, i64 88, !11, i64 92, !11, i64 94, !11, i64 96, !8, i64 98, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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