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

; 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.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.Select = type { ptr, i8, i16, i32, i32, i32, [2 x i32], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, 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, %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 = 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 }
%struct.ExprList = type { i32, ptr }
%struct.Schema = type { i32, i32, %struct.Hash, %struct.Hash, %struct.Hash, %struct.Hash, ptr, i8, i8, i16, i32 }

@.str.34 = external hidden unnamed_addr constant [30 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
declare dso_local void @sqlite3DeleteTable(ptr noundef, ptr noundef) #2

declare ptr @sqlite3ResultSetOfSelect(ptr noundef, ptr noundef) #1

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

declare void @sqlite3SelectDelete(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3ViewGetColumnNames(ptr noundef %0, ptr noundef %1) #2 {
  %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 i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = 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) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.Parse, ptr %13, i32 0, i32 0
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  store ptr %15, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call i32 @sqlite3VtabCallConnect(ptr noundef %16, ptr noundef %17)
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %2
  store i32 1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %169

21:                                               ; preds = %2
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.Table, ptr %22, i32 0, i32 16
  %24 = load i32, ptr %23, align 4, !tbaa !15
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %21
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %169

27:                                               ; preds = %21
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.Table, ptr %28, i32 0, i32 11
  %30 = load i16, ptr %29, align 2, !tbaa !17
  %31 = sext i16 %30 to i32
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %27
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %169

34:                                               ; preds = %27
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.Table, ptr %35, i32 0, i32 11
  %37 = load i16, ptr %36, align 2, !tbaa !17
  %38 = sext i16 %37 to i32
  %39 = icmp slt i32 %38, 0
  br i1 %39, label %40, label %45

40:                                               ; preds = %34
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.Table, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !18
  call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef %41, ptr noundef @.str.34, ptr noundef %44)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %169

45:                                               ; preds = %34
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.Table, ptr %47, i32 0, i32 3
  %49 = load ptr, ptr %48, align 8, !tbaa !19
  %50 = call ptr @sqlite3SelectDup(ptr noundef %46, ptr noundef %49, i32 noundef 0)
  store ptr %50, ptr %7, align 8, !tbaa !5
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %156

53:                                               ; preds = %45
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.Parse, ptr %54, i32 0, i32 17
  %56 = load i32, ptr %55, align 4, !tbaa !20
  store i32 %56, ptr %9, align 4, !tbaa !9
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.Select, ptr %58, i32 0, i32 7
  %60 = load ptr, ptr %59, align 8, !tbaa !21
  call void @sqlite3SrcListAssignCursors(ptr noundef %57, ptr noundef %60)
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.Table, ptr %61, i32 0, i32 11
  store i16 -1, ptr %62, align 2, !tbaa !17
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.sqlite3, ptr %63, i32 0, i32 58
  %65 = getelementptr inbounds %struct.Lookaside, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 8, !tbaa !23
  %67 = add i32 %66, 1
  store i32 %67, ptr %65, align 8, !tbaa !23
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.sqlite3, ptr %68, i32 0, i32 59
  %70 = load ptr, ptr %69, align 8, !tbaa !30
  store ptr %70, ptr %11, align 8, !tbaa !5
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.sqlite3, ptr %71, i32 0, i32 59
  store ptr null, ptr %72, align 8, !tbaa !30
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = call ptr @sqlite3ResultSetOfSelect(ptr noundef %73, ptr noundef %74)
  store ptr %75, ptr %6, align 8, !tbaa !5
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.sqlite3, ptr %77, i32 0, i32 59
  store ptr %76, ptr %78, align 8, !tbaa !30
  %79 = load i32, ptr %9, align 4, !tbaa !9
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.Parse, ptr %80, i32 0, i32 17
  store i32 %79, ptr %81, align 4, !tbaa !20
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Table, ptr %82, i32 0, i32 6
  %84 = load ptr, ptr %83, align 8, !tbaa !31
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %122

86:                                               ; preds = %53
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.Table, ptr %88, i32 0, i32 6
  %90 = load ptr, ptr %89, align 8, !tbaa !31
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.Table, ptr %91, i32 0, i32 11
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.Table, ptr %93, i32 0, i32 1
  %95 = call i32 @sqlite3ColumnsFromExprList(ptr noundef %87, ptr noundef %90, ptr noundef %92, ptr noundef %94)
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.sqlite3, ptr %96, i32 0, i32 17
  %98 = load i8, ptr %97, align 1, !tbaa !32
  %99 = zext i8 %98 to i32
  %100 = icmp eq i32 %99, 0
  br i1 %100, label %101, label %121

101:                                              ; preds = %86
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.Parse, ptr %102, i32 0, i32 16
  %104 = load i32, ptr %103, align 8, !tbaa !33
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %121

106:                                              ; preds = %101
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.Table, ptr %107, i32 0, i32 11
  %109 = load i16, ptr %108, align 2, !tbaa !17
  %110 = sext i16 %109 to i32
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.Select, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !34
  %114 = getelementptr inbounds %struct.ExprList, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !35
  %116 = icmp eq i32 %110, %115
  br i1 %116, label %117, label %121

117:                                              ; preds = %106
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  call void @sqlite3SelectAddColumnTypeAndCollation(ptr noundef %118, ptr noundef %119, ptr noundef %120)
  br label %121

121:                                              ; preds = %117, %106, %101, %86
  br label %146

122:                                              ; preds = %53
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = icmp ne ptr %123, null
  br i1 %124, label %125, label %140

125:                                              ; preds = %122
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.Table, ptr %126, i32 0, i32 11
  %128 = load i16, ptr %127, align 2, !tbaa !17
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.Table, ptr %129, i32 0, i32 11
  store i16 %128, ptr %130, align 2, !tbaa !17
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.Table, ptr %131, i32 0, i32 1
  %133 = load ptr, ptr %132, align 8, !tbaa !37
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.Table, ptr %134, i32 0, i32 1
  store ptr %133, ptr %135, align 8, !tbaa !37
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.Table, ptr %136, i32 0, i32 11
  store i16 0, ptr %137, align 2, !tbaa !17
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.Table, ptr %138, i32 0, i32 1
  store ptr null, ptr %139, align 8, !tbaa !37
  br label %145

140:                                              ; preds = %122
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.Table, ptr %141, i32 0, i32 11
  store i16 0, ptr %142, align 2, !tbaa !17
  %143 = load i32, ptr %8, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %8, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %140, %125
  br label %146

146:                                              ; preds = %145, %121
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  call void @sqlite3DeleteTable(ptr noundef %147, ptr noundef %148)
  %149 = load ptr, ptr %10, align 8, !tbaa !5
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  call void @sqlite3SelectDelete(ptr noundef %149, ptr noundef %150)
  %151 = load ptr, ptr %10, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.sqlite3, ptr %151, i32 0, i32 58
  %153 = getelementptr inbounds %struct.Lookaside, ptr %152, i32 0, i32 0
  %154 = load i32, ptr %153, align 8, !tbaa !23
  %155 = add i32 %154, -1
  store i32 %155, ptr %153, align 8, !tbaa !23
  br label %159

156:                                              ; preds = %45
  %157 = load i32, ptr %8, align 4, !tbaa !9
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %8, align 4, !tbaa !9
  br label %159

159:                                              ; preds = %156, %146
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.Table, ptr %160, i32 0, i32 20
  %162 = load ptr, ptr %161, align 8, !tbaa !38
  %163 = getelementptr inbounds %struct.Schema, ptr %162, i32 0, i32 9
  %164 = load i16, ptr %163, align 2, !tbaa !39
  %165 = zext i16 %164 to i32
  %166 = or i32 %165, 2
  %167 = trunc i32 %166 to i16
  store i16 %167, ptr %163, align 2, !tbaa !39
  %168 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %168, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %169

169:                                              ; preds = %159, %40, %33, %26, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %170 = load i32, ptr %3, align 4
  ret i32 %170
}

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

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

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

declare void @sqlite3SelectAddColumnTypeAndCollation(ptr noundef, ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!16, !10, i64 84}
!16 = !{!"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}
!17 = !{!16, !14, i64 70}
!18 = !{!16, !6, i64 0}
!19 = !{!16, !6, i64 24}
!20 = !{!12, !10, i64 52}
!21 = !{!22, !6, i64 32}
!22 = !{!"Select", !6, i64 0, !7, i64 8, !14, i64 10, !10, i64 12, !10, i64 16, !10, i64 20, !7, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104}
!23 = !{!24, !10, i64 344}
!24 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !25, i64 48, !25, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !14, i64 80, !7, i64 82, !7, i64 83, !7, i64 84, !7, i64 85, !7, i64 86, !7, i64 87, !7, i64 88, !7, i64 89, !7, i64 90, !7, i64 91, !7, i64 92, !7, i64 93, !7, i64 94, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !7, i64 112, !10, i64 160, !26, i64 164, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !7, i64 336, !27, i64 344, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !10, i64 432, !10, i64 436, !28, i64 440, !6, i64 464, !6, i64 472, !6, i64 480, !28, i64 488, !28, i64 512, !29, i64 536, !7, i64 560, !6, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !25, i64 648, !25, i64 656, !6, i64 664}
!25 = !{!"long long", !7, i64 0}
!26 = !{!"sqlite3InitInfo", !10, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!27 = !{!"Lookaside", !10, i64 0, !14, i64 4, !7, i64 6, !10, i64 8, !10, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48}
!28 = !{!"Hash", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!29 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !10, i64 16}
!30 = !{!24, !6, i64 400}
!31 = !{!16, !6, i64 48}
!32 = !{!24, !7, i64 85}
!33 = !{!12, !10, i64 48}
!34 = !{!22, !6, i64 0}
!35 = !{!36, !10, i64 0}
!36 = !{!"ExprList", !10, i64 0, !6, i64 8}
!37 = !{!16, !6, i64 8}
!38 = !{!16, !6, i64 112}
!39 = !{!40, !14, i64 114}
!40 = !{!"Schema", !10, i64 0, !10, i64 4, !28, i64 8, !28, i64 32, !28, i64 56, !28, i64 80, !6, i64 104, !7, i64 112, !7, i64 113, !14, i64 114, !10, i64 116}


; 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.34 = external hidden unnamed_addr constant [30 x i8], align 1

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

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

declare ptr @sqlite3ResultSetOfSelect(ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare void @sqlite3SelectDelete(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @sqlite3ViewGetColumnNames(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = tail call i32 @sqlite3VtabCallConnect(ptr noundef nonnull %0, ptr noundef %1) #2
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %5, label %67

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %1, i64 84
  %7 = load i32, ptr %6, align 4, !tbaa !13
  %.not58 = icmp eq i32 %7, 0
  br i1 %.not58, label %8, label %67

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %1, i64 70
  %10 = load i16, ptr %9, align 2, !tbaa !15
  %11 = icmp sgt i16 %10, 0
  br i1 %11, label %67, label %12

12:                                               ; preds = %8
  %13 = icmp slt i16 %10, 0
  br i1 %13, label %14, label %16

14:                                               ; preds = %12
  %15 = load ptr, ptr %1, align 8, !tbaa !16
  tail call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef nonnull %0, ptr noundef nonnull @.str.34, ptr noundef %15) #2
  br label %67

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %1, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !17
  %19 = tail call ptr @sqlite3SelectDup(ptr noundef %3, ptr noundef %18, i32 noundef 0) #2
  %.not59 = icmp eq ptr %19, null
  br i1 %.not59, label %61, label %20

20:                                               ; preds = %16
  %21 = getelementptr inbounds i8, ptr %0, i64 52
  %22 = load i32, ptr %21, align 4, !tbaa !18
  %23 = getelementptr inbounds i8, ptr %19, i64 32
  %24 = load ptr, ptr %23, align 8, !tbaa !19
  tail call void @sqlite3SrcListAssignCursors(ptr noundef nonnull %0, ptr noundef %24)
  store i16 -1, ptr %9, align 2, !tbaa !15
  %25 = getelementptr inbounds i8, ptr %3, i64 344
  %26 = load i32, ptr %25, align 8, !tbaa !21
  %27 = add i32 %26, 1
  store i32 %27, ptr %25, align 8, !tbaa !21
  %28 = getelementptr inbounds i8, ptr %3, i64 400
  %29 = load ptr, ptr %28, align 8, !tbaa !28
  store ptr null, ptr %28, align 8, !tbaa !28
  %30 = tail call ptr @sqlite3ResultSetOfSelect(ptr noundef nonnull %0, ptr noundef nonnull %19) #2
  store ptr %29, ptr %28, align 8, !tbaa !28
  store i32 %22, ptr %21, align 4, !tbaa !18
  %31 = getelementptr inbounds i8, ptr %1, i64 48
  %32 = load ptr, ptr %31, align 8, !tbaa !29
  %.not60 = icmp eq ptr %32, null
  br i1 %.not60, label %50, label %33

33:                                               ; preds = %20
  %34 = getelementptr inbounds i8, ptr %1, i64 8
  %35 = tail call i32 @sqlite3ColumnsFromExprList(ptr noundef nonnull %0, ptr noundef nonnull %32, ptr noundef nonnull %9, ptr noundef nonnull %34) #2
  %36 = getelementptr inbounds i8, ptr %3, i64 85
  %37 = load i8, ptr %36, align 1, !tbaa !30
  %38 = icmp eq i8 %37, 0
  br i1 %38, label %39, label %58

39:                                               ; preds = %33
  %40 = getelementptr inbounds i8, ptr %0, i64 48
  %41 = load i32, ptr %40, align 8, !tbaa !31
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %58

43:                                               ; preds = %39
  %44 = load i16, ptr %9, align 2, !tbaa !15
  %45 = sext i16 %44 to i32
  %46 = load ptr, ptr %19, align 8, !tbaa !32
  %47 = load i32, ptr %46, align 8, !tbaa !33
  %48 = icmp eq i32 %47, %45
  br i1 %48, label %49, label %58

49:                                               ; preds = %43
  tail call void @sqlite3SelectAddColumnTypeAndCollation(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %19) #2
  br label %58

50:                                               ; preds = %20
  %.not61 = icmp eq ptr %30, null
  br i1 %.not61, label %57, label %51

51:                                               ; preds = %50
  %52 = getelementptr inbounds i8, ptr %30, i64 70
  %53 = load i16, ptr %52, align 2, !tbaa !15
  store i16 %53, ptr %9, align 2, !tbaa !15
  %54 = getelementptr inbounds i8, ptr %30, i64 8
  %55 = load ptr, ptr %54, align 8, !tbaa !35
  %56 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr %55, ptr %56, align 8, !tbaa !35
  store i16 0, ptr %52, align 2, !tbaa !15
  store ptr null, ptr %54, align 8, !tbaa !35
  br label %58

57:                                               ; preds = %50
  store i16 0, ptr %9, align 2, !tbaa !15
  br label %58

58:                                               ; preds = %51, %57, %33, %39, %43, %49
  %.053 = phi i32 [ 0, %49 ], [ 0, %43 ], [ 0, %39 ], [ 0, %33 ], [ 0, %51 ], [ 1, %57 ]
  tail call void @sqlite3DeleteTable(ptr noundef nonnull %3, ptr noundef %30)
  tail call void @sqlite3SelectDelete(ptr noundef nonnull %3, ptr noundef nonnull %19) #2
  %59 = load i32, ptr %25, align 8, !tbaa !21
  %60 = add i32 %59, -1
  store i32 %60, ptr %25, align 8, !tbaa !21
  br label %61

61:                                               ; preds = %16, %58
  %.1 = phi i32 [ %.053, %58 ], [ 1, %16 ]
  %62 = getelementptr inbounds i8, ptr %1, i64 112
  %63 = load ptr, ptr %62, align 8, !tbaa !36
  %64 = getelementptr inbounds i8, ptr %63, i64 114
  %65 = load i16, ptr %64, align 2, !tbaa !37
  %66 = or i16 %65, 2
  store i16 %66, ptr %64, align 2, !tbaa !37
  br label %67

67:                                               ; preds = %8, %5, %2, %61, %14
  %.0 = phi i32 [ 1, %14 ], [ %.1, %61 ], [ 1, %2 ], [ 0, %5 ], [ 0, %8 ]
  ret i32 %.0
}

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

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

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

declare void @sqlite3SelectAddColumnTypeAndCollation(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = !{!14, !10, i64 84}
!14 = !{!"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, !12, i64 68, !12, i64 70, !12, i64 72, !12, 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}
!15 = !{!14, !12, i64 70}
!16 = !{!14, !7, i64 0}
!17 = !{!14, !7, i64 24}
!18 = !{!6, !10, i64 52}
!19 = !{!20, !7, i64 32}
!20 = !{!"Select", !7, i64 0, !8, i64 8, !12, i64 10, !10, i64 12, !10, i64 16, !10, i64 20, !8, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104}
!21 = !{!22, !10, i64 344}
!22 = !{!"sqlite3", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !23, i64 48, !23, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !12, i64 80, !8, i64 82, !8, i64 83, !8, i64 84, !8, i64 85, !8, i64 86, !8, i64 87, !8, i64 88, !8, i64 89, !8, i64 90, !8, i64 91, !8, i64 92, !8, i64 93, !8, i64 94, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !8, i64 112, !10, i64 160, !24, i64 164, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !8, i64 336, !25, i64 344, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !10, i64 432, !10, i64 436, !26, i64 440, !7, i64 464, !7, i64 472, !7, i64 480, !26, i64 488, !26, i64 512, !27, i64 536, !8, i64 560, !7, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !23, i64 648, !23, i64 656, !7, i64 664}
!23 = !{!"long long", !8, i64 0}
!24 = !{!"sqlite3InitInfo", !10, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!25 = !{!"Lookaside", !10, i64 0, !12, i64 4, !8, i64 6, !10, i64 8, !10, i64 12, !8, i64 16, !7, i64 32, !7, i64 40, !7, i64 48}
!26 = !{!"Hash", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16}
!27 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !10, i64 16}
!28 = !{!22, !7, i64 400}
!29 = !{!14, !7, i64 48}
!30 = !{!22, !8, i64 85}
!31 = !{!6, !10, i64 48}
!32 = !{!20, !7, i64 0}
!33 = !{!34, !10, i64 0}
!34 = !{!"ExprList", !10, i64 0, !7, i64 8}
!35 = !{!14, !7, i64 8}
!36 = !{!14, !7, i64 112}
!37 = !{!38, !12, i64 114}
!38 = !{!"Schema", !10, i64 0, !10, i64 4, !26, i64 8, !26, i64 32, !26, i64 56, !26, i64 80, !7, i64 104, !8, i64 112, !8, i64 113, !12, i64 114, !10, i64 116}


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