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

; 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.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.Expr = type { i8, i8, i32, %union.anon, ptr, ptr, %union.anon.0, i32, i32, i16, i16, i16, i8, ptr, ptr }
%union.anon = type { ptr }
%union.anon.0 = type { ptr }
%struct.sqlite3 = type { ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, i32, i32, i32, i32, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, [12 x i32], i32, %struct.sqlite3InitInfo, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %union.anon.2, %struct.Lookaside, ptr, ptr, ptr, ptr, i32, i32, %struct.Hash, ptr, ptr, ptr, %struct.Hash, %struct.Hash, %struct.BusyHandler, [2 x %struct.Db], ptr, i32, i32, i32, i64, i64, ptr }
%struct.sqlite3InitInfo = type { i32, i8, i8, i8, i8 }
%union.anon.2 = type { double }
%struct.Lookaside = type { i32, i16, i8, i32, i32, [3 x i32], ptr, ptr, ptr }
%struct.Hash = type { i32, i32, ptr, ptr }
%struct.BusyHandler = type { ptr, ptr, i32 }
%struct.Db = type { ptr, ptr, i8, i8, ptr }

@.str.1 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3ExprAssignVarNumber(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i16, align 2
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.Parse, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  store ptr %16, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #3
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %3
  store i32 1, ptr %10, align 4
  br label %158

20:                                               ; preds = %3
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.Expr, ptr %21, i32 0, i32 3
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  store ptr %23, ptr %8, align 8, !tbaa !5
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 1
  %26 = load i8, ptr %25, align 1, !tbaa !15
  %27 = sext i8 %26 to i32
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %34

29:                                               ; preds = %20
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.Parse, ptr %30, i32 0, i32 50
  %32 = load i16, ptr %31, align 8, !tbaa !16
  %33 = add i16 %32, 1
  store i16 %33, ptr %31, align 8, !tbaa !16
  store i16 %33, ptr %9, align 2, !tbaa !17
  br label %144

34:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !9
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 0
  %37 = load i8, ptr %36, align 1, !tbaa !15
  %38 = sext i8 %37 to i32
  %39 = icmp eq i32 %38, 63
  br i1 %39, label %40, label %108

40:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %41 = load i32, ptr %6, align 4, !tbaa !9
  %42 = icmp eq i32 %41, 2
  br i1 %42, label %43, label %50

43:                                               ; preds = %40
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 1
  %46 = load i8, ptr %45, align 1, !tbaa !15
  %47 = sext i8 %46 to i32
  %48 = sub nsw i32 %47, 48
  %49 = sext i32 %48 to i64
  store i64 %49, ptr %12, align 8, !tbaa !18
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %58

50:                                               ; preds = %40
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %51, i64 1
  %53 = load i32, ptr %6, align 4, !tbaa !9
  %54 = sub i32 %53, 1
  %55 = call i32 @sqlite3Atoi64(ptr noundef %52, ptr noundef %12, i32 noundef %54, i8 noundef zeroext 1)
  %56 = icmp eq i32 0, %55
  %57 = zext i1 %56 to i32
  store i32 %57, ptr %13, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %50, %43
  %59 = load i32, ptr %13, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %72, label %61

61:                                               ; preds = %58
  %62 = load i64, ptr %12, align 8, !tbaa !18
  %63 = icmp slt i64 %62, 1
  br i1 %63, label %72, label %64

64:                                               ; preds = %61
  %65 = load i64, ptr %12, align 8, !tbaa !18
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.sqlite3, ptr %66, i32 0, i32 31
  %68 = getelementptr inbounds [12 x i32], ptr %67, i64 0, i64 9
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = icmp sgt i64 %65, %70
  br i1 %71, label %72, label %78

72:                                               ; preds = %64, %61, %58
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.sqlite3, ptr %74, i32 0, i32 31
  %76 = getelementptr inbounds [12 x i32], ptr %75, i64 0, i64 9
  %77 = load i32, ptr %76, align 4, !tbaa !9
  call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef %73, ptr noundef @.str.1, i32 noundef %77)
  store i32 1, ptr %10, align 4
  br label %105

78:                                               ; preds = %64
  %79 = load i64, ptr %12, align 8, !tbaa !18
  %80 = trunc i64 %79 to i16
  store i16 %80, ptr %9, align 2, !tbaa !17
  %81 = load i16, ptr %9, align 2, !tbaa !17
  %82 = sext i16 %81 to i32
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.Parse, ptr %83, i32 0, i32 50
  %85 = load i16, ptr %84, align 8, !tbaa !16
  %86 = sext i16 %85 to i32
  %87 = icmp sgt i32 %82, %86
  br i1 %87, label %88, label %94

88:                                               ; preds = %78
  %89 = load i16, ptr %9, align 2, !tbaa !17
  %90 = sext i16 %89 to i32
  %91 = trunc i32 %90 to i16
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.Parse, ptr %92, i32 0, i32 50
  store i16 %91, ptr %93, align 8, !tbaa !16
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %104

94:                                               ; preds = %78
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.Parse, ptr %95, i32 0, i32 58
  %97 = load ptr, ptr %96, align 8, !tbaa !20
  %98 = load i16, ptr %9, align 2, !tbaa !17
  %99 = sext i16 %98 to i32
  %100 = call ptr @sqlite3VListNumToName(ptr noundef %97, i32 noundef %99)
  %101 = icmp eq ptr %100, null
  br i1 %101, label %102, label %103

102:                                              ; preds = %94
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %103

103:                                              ; preds = %102, %94
  br label %104

104:                                              ; preds = %103, %88
  store i32 0, ptr %10, align 4
  br label %105

105:                                              ; preds = %104, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %106 = load i32, ptr %10, align 4
  switch i32 %106, label %141 [
    i32 0, label %107
  ]

107:                                              ; preds = %105
  br label %125

108:                                              ; preds = %34
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.Parse, ptr %109, i32 0, i32 58
  %111 = load ptr, ptr %110, align 8, !tbaa !20
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = load i32, ptr %6, align 4, !tbaa !9
  %114 = call i32 @sqlite3VListNameToNum(ptr noundef %111, ptr noundef %112, i32 noundef %113)
  %115 = trunc i32 %114 to i16
  store i16 %115, ptr %9, align 2, !tbaa !17
  %116 = load i16, ptr %9, align 2, !tbaa !17
  %117 = sext i16 %116 to i32
  %118 = icmp eq i32 %117, 0
  br i1 %118, label %119, label %124

119:                                              ; preds = %108
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.Parse, ptr %120, i32 0, i32 50
  %122 = load i16, ptr %121, align 8, !tbaa !16
  %123 = add i16 %122, 1
  store i16 %123, ptr %121, align 8, !tbaa !16
  store i16 %123, ptr %9, align 2, !tbaa !17
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %119, %108
  br label %125

125:                                              ; preds = %124, %107
  %126 = load i32, ptr %11, align 4, !tbaa !9
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %140

128:                                              ; preds = %125
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.Parse, ptr %130, i32 0, i32 58
  %132 = load ptr, ptr %131, align 8, !tbaa !20
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = load i32, ptr %6, align 4, !tbaa !9
  %135 = load i16, ptr %9, align 2, !tbaa !17
  %136 = sext i16 %135 to i32
  %137 = call ptr @sqlite3VListAdd(ptr noundef %129, ptr noundef %132, ptr noundef %133, i32 noundef %134, i32 noundef %136)
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.Parse, ptr %138, i32 0, i32 58
  store ptr %137, ptr %139, align 8, !tbaa !20
  br label %140

140:                                              ; preds = %128, %125
  store i32 0, ptr %10, align 4
  br label %141

141:                                              ; preds = %140, %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  %142 = load i32, ptr %10, align 4
  switch i32 %142, label %158 [
    i32 0, label %143
  ]

143:                                              ; preds = %141
  br label %144

144:                                              ; preds = %143, %29
  %145 = load i16, ptr %9, align 2, !tbaa !17
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.Expr, ptr %146, i32 0, i32 9
  store i16 %145, ptr %147, align 8, !tbaa !21
  %148 = load i16, ptr %9, align 2, !tbaa !17
  %149 = sext i16 %148 to i32
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.sqlite3, ptr %150, i32 0, i32 31
  %152 = getelementptr inbounds [12 x i32], ptr %151, i64 0, i64 9
  %153 = load i32, ptr %152, align 4, !tbaa !9
  %154 = icmp sgt i32 %149, %153
  br i1 %154, label %155, label %157

155:                                              ; preds = %144
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef %156, ptr noundef @.str.2)
  br label %157

157:                                              ; preds = %155, %144
  store i32 0, ptr %10, align 4
  br label %158

158:                                              ; preds = %157, %141, %19
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  %159 = load i32, ptr %10, align 4
  switch i32 %159, label %161 [
    i32 0, label %160
    i32 1, label %160
  ]

160:                                              ; preds = %158, %158
  ret void

161:                                              ; preds = %158
  unreachable
}

declare i32 @sqlite3Atoi64(ptr noundef, ptr noundef, i32 noundef, i8 noundef zeroext) #1

declare ptr @sqlite3VListNumToName(ptr noundef, i32 noundef) #1

declare i32 @sqlite3VListNameToNum(ptr noundef, ptr noundef, i32 noundef) #1

declare ptr @sqlite3VListAdd(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

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

!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 0}
!12 = !{!"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, !13, 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, !13, i64 432, !13, 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, !13, i64 536, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584}
!13 = !{!"Token", !6, i64 0, !10, i64 8}
!14 = !{!"short", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!12, !14, i64 464}
!17 = !{!14, !14, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = !{!12, !6, i64 488}
!21 = !{!22, !14, i64 48}
!22 = !{!"Expr", !7, i64 0, !7, i64 1, !10, i64 4, !7, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !14, i64 48, !14, i64 50, !14, i64 52, !7, i64 54, !6, i64 56, !6, i64 64}


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

@.str.1 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3ExprAssignVarNumber(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = alloca i64, align 8
  %5 = load ptr, ptr %0, align 8, !tbaa !5
  %6 = icmp eq ptr %1, null
  br i1 %6, label %67, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %9, i64 1
  %11 = load i8, ptr %10, align 1, !tbaa !13
  %12 = icmp eq i8 %11, 0
  br i1 %12, label %13, label %17

13:                                               ; preds = %7
  %14 = getelementptr inbounds i8, ptr %0, i64 464
  %15 = load i16, ptr %14, align 8, !tbaa !14
  %16 = add i16 %15, 1
  store i16 %16, ptr %14, align 8, !tbaa !14
  br label %.thread67

17:                                               ; preds = %7
  %18 = load i8, ptr %9, align 1, !tbaa !13
  %19 = icmp eq i8 %18, 63
  br i1 %19, label %20, label %46

20:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %21 = icmp eq i32 %2, 2
  br i1 %21, label %22, label %25

22:                                               ; preds = %20
  %23 = sext i8 %11 to i64
  %24 = add nsw i64 %23, -48
  store i64 %24, ptr %4, align 8, !tbaa !15
  br label %29

25:                                               ; preds = %20
  %26 = add i32 %2, -1
  %27 = call i32 @sqlite3Atoi64(ptr noundef nonnull %10, ptr noundef nonnull %4, i32 noundef %26, i8 noundef zeroext 1) #3
  %28 = icmp ne i32 %27, 0
  %.pre = load i64, ptr %4, align 8
  br label %29

29:                                               ; preds = %25, %22
  %30 = phi i64 [ %24, %22 ], [ %.pre, %25 ]
  %.0 = phi i1 [ false, %22 ], [ %28, %25 ]
  %31 = icmp slt i64 %30, 1
  %or.cond = select i1 %.0, i1 true, i1 %31
  %.phi.trans.insert = getelementptr inbounds i8, ptr %5, i64 148
  %.pre70 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !17
  %32 = sext i32 %.pre70 to i64
  %33 = icmp sgt i64 %30, %32
  %or.cond72 = select i1 %or.cond, i1 true, i1 %33
  br i1 %or.cond72, label %._crit_edge, label %34

34:                                               ; preds = %29
  %35 = trunc i64 %30 to i16
  %36 = getelementptr inbounds i8, ptr %0, i64 464
  %37 = load i16, ptr %36, align 8, !tbaa !14
  %38 = icmp slt i16 %37, %35
  br i1 %38, label %39, label %40

39:                                               ; preds = %34
  store i16 %35, ptr %36, align 8, !tbaa !14
  br label %.thread63

40:                                               ; preds = %34
  %41 = sext i16 %35 to i32
  %42 = getelementptr inbounds i8, ptr %0, i64 488
  %43 = load ptr, ptr %42, align 8, !tbaa !18
  %44 = call ptr @sqlite3VListNumToName(ptr noundef %43, i32 noundef %41) #3
  %45 = icmp eq ptr %44, null
  br i1 %45, label %.thread63, label %55

46:                                               ; preds = %17
  %47 = getelementptr inbounds i8, ptr %0, i64 488
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  %49 = tail call i32 @sqlite3VListNameToNum(ptr noundef %48, ptr noundef nonnull %9, i32 noundef %2) #3
  %50 = trunc i32 %49 to i16
  %sext.mask = and i32 %49, 65535
  %51 = icmp eq i32 %sext.mask, 0
  br i1 %51, label %.thread57, label %.thread67

.thread57:                                        ; preds = %46
  %52 = getelementptr inbounds i8, ptr %0, i64 464
  %53 = load i16, ptr %52, align 8, !tbaa !14
  %54 = add i16 %53, 1
  store i16 %54, ptr %52, align 8, !tbaa !14
  br label %56

.thread63:                                        ; preds = %39, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %56

55:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %.thread67

56:                                               ; preds = %.thread63, %.thread57
  %.14461 = phi i16 [ %54, %.thread57 ], [ %35, %.thread63 ]
  %57 = getelementptr inbounds i8, ptr %0, i64 488
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %59 = sext i16 %.14461 to i32
  %60 = call ptr @sqlite3VListAdd(ptr noundef %5, ptr noundef %58, ptr noundef nonnull %9, i32 noundef %2, i32 noundef %59) #3
  store ptr %60, ptr %57, align 8, !tbaa !18
  br label %.thread67

._crit_edge:                                      ; preds = %29
  call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef nonnull %0, ptr noundef nonnull @.str.1, i32 noundef %.pre70) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %67

.thread67:                                        ; preds = %46, %55, %56, %13
  %.3 = phi i16 [ %16, %13 ], [ %35, %55 ], [ %.14461, %56 ], [ %50, %46 ]
  %61 = getelementptr inbounds i8, ptr %1, i64 48
  store i16 %.3, ptr %61, align 8, !tbaa !19
  %62 = sext i16 %.3 to i32
  %63 = getelementptr inbounds i8, ptr %5, i64 148
  %64 = load i32, ptr %63, align 4, !tbaa !17
  %65 = icmp slt i32 %64, %62
  br i1 %65, label %66, label %67

66:                                               ; preds = %.thread67
  call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef nonnull %0, ptr noundef nonnull @.str.2) #3
  br label %67

67:                                               ; preds = %._crit_edge, %.thread67, %66, %3
  ret void
}

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

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

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

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

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

!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, !7, i64 0}
!6 = !{!"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, !11, 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, !11, i64 432, !11, i64 448, !12, 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, !11, i64 536, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"Token", !7, i64 0, !10, i64 8}
!12 = !{!"short", !8, i64 0}
!13 = !{!8, !8, i64 0}
!14 = !{!6, !12, i64 464}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !8, i64 0}
!17 = !{!10, !10, i64 0}
!18 = !{!6, !7, i64 488}
!19 = !{!20, !12, i64 48}
!20 = !{!"Expr", !8, i64 0, !8, i64 1, !10, i64 4, !8, i64 8, !7, i64 16, !7, i64 24, !8, i64 32, !10, i64 40, !10, i64 44, !12, i64 48, !12, i64 50, !12, i64 52, !8, i64 54, !7, i64 56, !7, i64 64}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass