; LLVM IR from Siskin-framework/Rebol-SQLite :: src (sqlite-command-info)

; 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.rebol_ext_api = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.rxi_cmd_frame = type { [8 x %union.rxi_arg_val] }
%union.rxi_arg_val = type { %struct.anon.3 }
%struct.anon.3 = type { %union.anon, i32, i32 }
%union.anon = type { ptr }
%struct.Reb_Handle_Context = type { %union.anon.5, i32, i32, ptr }
%union.anon.5 = type { ptr }
%struct.Reb_Series = type { ptr, i32, i32, i32, i32, %union.anon.6 }
%union.anon.6 = type { ptr }
%struct.reb_sqlite_context = type { ptr, ptr, i32, i32 }
%struct.reb_sqlite_stmt = type { ptr, i32 }
%struct.anon.1 = type <{ ptr, i32 }>

@RL = external global ptr, align 8
@Handle_SQLiteDB = external global i32, align 4
@.str = external hidden unnamed_addr constant [66 x i8], align 1
@Handle_SQLiteSTMT = external global i32, align 4
@.str.1 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [113 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @cmd_sqlite_info(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca [8 x i8], align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  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
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %13 = load ptr, ptr @RL, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.rebol_ext_api, ptr %13, i32 0, i32 17
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = call ptr %15(i32 noundef 1000, i32 noundef 0)
  store ptr %16, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.rxi_cmd_frame, ptr %17, i32 0, i32 0
  %19 = getelementptr inbounds [8 x %union.rxi_arg_val], ptr %18, i64 0, i64 0
  %20 = getelementptr inbounds [8 x i8], ptr %19, i64 0, i64 2
  %21 = load i8, ptr %20, align 2, !tbaa !13
  %22 = zext i8 %21 to i32
  %23 = icmp eq i32 3, %22
  br i1 %23, label %24, label %127

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.rxi_cmd_frame, ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds [8 x %union.rxi_arg_val], ptr %26, i64 0, i64 2
  %28 = getelementptr inbounds %struct.anon.3, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 4, !tbaa !13
  store ptr %29, ptr %9, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.Reb_Handle_Context, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 4, !tbaa !14
  %33 = load i32, ptr @Handle_SQLiteDB, align 4, !tbaa !17
  %34 = icmp eq i32 %32, %33
  br i1 %34, label %35, label %72

35:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.Reb_Handle_Context, ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 4, !tbaa !13
  store ptr %38, ptr %10, align 8, !tbaa !5
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %42, label %41

41:                                               ; preds = %35
  store i32 1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %69

42:                                               ; preds = %35
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.Reb_Series, ptr %43, i32 0, i32 0
  %45 = load ptr, ptr %44, align 4, !tbaa !18
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.Reb_Series, ptr %46, i32 0, i32 2
  %48 = load i32, ptr %47, align 4, !tbaa !20
  %49 = zext i32 %48 to i64
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.reb_sqlite_context, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !21
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.reb_sqlite_context, ptr %54, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !23
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %64

58:                                               ; preds = %42
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.reb_sqlite_context, ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !23
  %62 = getelementptr inbounds %struct.Reb_Series, ptr %61, i32 0, i32 2
  %63 = load i32, ptr %62, align 4, !tbaa !20
  br label %65

64:                                               ; preds = %42
  br label %65

65:                                               ; preds = %64, %58
  %66 = phi i32 [ %63, %58 ], [ 0, %64 ]
  %67 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %45, i64 noundef %49, ptr noundef @.str, ptr noundef %50, ptr noundef %53, i32 noundef %66) #4
  %68 = sext i32 %67 to i64
  store i64 %68, ptr %6, align 8, !tbaa !9
  store i32 0, ptr %11, align 4
  br label %69

69:                                               ; preds = %65, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %70 = load i32, ptr %11, align 4
  switch i32 %70, label %124 [
    i32 0, label %71
  ]

71:                                               ; preds = %69
  br label %123

72:                                               ; preds = %24
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.Reb_Handle_Context, ptr %73, i32 0, i32 1
  %75 = load i32, ptr %74, align 4, !tbaa !14
  %76 = load i32, ptr @Handle_SQLiteSTMT, align 4, !tbaa !17
  %77 = icmp eq i32 %75, %76
  br i1 %77, label %78, label %121

78:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.Reb_Handle_Context, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 4, !tbaa !13
  store ptr %81, ptr %12, align 8, !tbaa !5
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = icmp ne ptr %82, null
  br i1 %83, label %85, label %84

84:                                               ; preds = %78
  store i32 1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %118

85:                                               ; preds = %78
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.Reb_Series, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 4, !tbaa !18
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.Reb_Series, ptr %89, i32 0, i32 2
  %91 = load i32, ptr %90, align 4, !tbaa !20
  %92 = zext i32 %91 to i64
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.reb_sqlite_stmt, ptr %94, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !24
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.reb_sqlite_stmt, ptr %97, i32 0, i32 1
  %99 = load i32, ptr %98, align 8, !tbaa !26
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.reb_sqlite_stmt, ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !24
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %109

104:                                              ; preds = %85
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.reb_sqlite_stmt, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !24
  %108 = call i32 @sqlite3_bind_parameter_count(ptr noundef %107)
  br label %110

109:                                              ; preds = %85
  br label %110

110:                                              ; preds = %109, %104
  %111 = phi i32 [ %108, %104 ], [ 0, %109 ]
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.reb_sqlite_stmt, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !24
  %115 = call i32 @sqlite3_data_count(ptr noundef %114)
  %116 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %88, i64 noundef %92, ptr noundef @.str.1, ptr noundef %93, ptr noundef %96, i32 noundef %99, i32 noundef %111, i32 noundef %115) #4
  %117 = sext i32 %116 to i64
  store i64 %117, ptr %6, align 8, !tbaa !9
  store i32 0, ptr %11, align 4
  br label %118

118:                                              ; preds = %110, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %119 = load i32, ptr %11, align 4
  switch i32 %119, label %124 [
    i32 0, label %120
  ]

120:                                              ; preds = %118
  br label %122

121:                                              ; preds = %72
  br label %122

122:                                              ; preds = %121, %120
  br label %123

123:                                              ; preds = %122, %71
  store i32 0, ptr %11, align 4
  br label %124

124:                                              ; preds = %123, %118, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %125 = load i32, ptr %11, align 4
  switch i32 %125, label %176 [
    i32 0, label %126
  ]

126:                                              ; preds = %124
  br label %153

127:                                              ; preds = %2
  %128 = load ptr, ptr @RL, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.rebol_ext_api, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !27
  %131 = getelementptr inbounds [8 x i8], ptr %8, i64 0, i64 0
  call void %130(ptr noundef %131)
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.Reb_Series, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 4, !tbaa !18
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.Reb_Series, ptr %135, i32 0, i32 2
  %137 = load i32, ptr %136, align 4, !tbaa !20
  %138 = zext i32 %137 to i64
  %139 = getelementptr inbounds [8 x i8], ptr %8, i64 0, i64 1
  %140 = load i8, ptr %139, align 1, !tbaa !13
  %141 = zext i8 %140 to i32
  %142 = getelementptr inbounds [8 x i8], ptr %8, i64 0, i64 2
  %143 = load i8, ptr %142, align 1, !tbaa !13
  %144 = zext i8 %143 to i32
  %145 = getelementptr inbounds [8 x i8], ptr %8, i64 0, i64 3
  %146 = load i8, ptr %145, align 1, !tbaa !13
  %147 = zext i8 %146 to i32
  %148 = call ptr @sqlite3_libversion()
  %149 = call i64 @sqlite3_memory_used()
  %150 = call i64 @sqlite3_memory_highwater(i32 noundef 0)
  %151 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %134, i64 noundef %138, ptr noundef @.str.2, i32 noundef 3, i32 noundef 10, i32 noundef 2, i32 noundef %141, i32 noundef %144, i32 noundef %147, ptr noundef %148, i64 noundef %149, i64 noundef %150) #4
  %152 = sext i32 %151 to i64
  store i64 %152, ptr %6, align 8, !tbaa !9
  br label %153

153:                                              ; preds = %127, %126
  %154 = load i64, ptr %6, align 8, !tbaa !9
  %155 = icmp slt i64 %154, 0
  br i1 %155, label %156, label %157

156:                                              ; preds = %153
  store i32 1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %176

157:                                              ; preds = %153
  %158 = load i64, ptr %6, align 8, !tbaa !9
  %159 = trunc i64 %158 to i32
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.Reb_Series, ptr %160, i32 0, i32 1
  store i32 %159, ptr %161, align 4, !tbaa !28
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.rxi_cmd_frame, ptr %163, i32 0, i32 0
  %165 = getelementptr inbounds [8 x %union.rxi_arg_val], ptr %164, i64 0, i64 1
  %166 = getelementptr inbounds %struct.anon.1, ptr %165, i32 0, i32 0
  store ptr %162, ptr %166, align 4, !tbaa !13
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.rxi_cmd_frame, ptr %167, i32 0, i32 0
  %169 = getelementptr inbounds [8 x %union.rxi_arg_val], ptr %168, i64 0, i64 0
  %170 = getelementptr inbounds [8 x i8], ptr %169, i64 0, i64 1
  store i8 24, ptr %170, align 1, !tbaa !13
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.rxi_cmd_frame, ptr %171, i32 0, i32 0
  %173 = getelementptr inbounds [8 x %union.rxi_arg_val], ptr %172, i64 0, i64 1
  %174 = getelementptr inbounds %struct.anon.1, ptr %173, i32 0, i32 1
  store i32 0, ptr %174, align 4, !tbaa !13
  br label %175

175:                                              ; preds = %157
  store i32 4, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %176

176:                                              ; preds = %175, %156, %124
  call void @llvm.lifetime.end.p0(i64 8, 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
  %177 = load i32, ptr %3, align 4
  ret i32 %177
}

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

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 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 @sqlite3_bind_parameter_count(ptr noundef) #3

declare i32 @sqlite3_data_count(ptr noundef) #3

declare ptr @sqlite3_libversion() #3

declare i64 @sqlite3_memory_used() #3

declare i64 @sqlite3_memory_highwater(i32 noundef) #3

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

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 136}
!12 = !{!"rebol_ext_api", !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, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, 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, !6, i64 336}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !16, i64 8}
!15 = !{!"Reb_Handle_Context", !7, i64 0, !16, i64 8, !16, i64 12, !16, i64 14, !6, i64 16}
!16 = !{!"int", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"Reb_Series", !6, i64 0, !16, i64 8, !16, i64 12, !16, i64 16, !16, i64 20, !7, i64 24}
!20 = !{!19, !16, i64 12}
!21 = !{!22, !6, i64 0}
!22 = !{!"reb_sqlite_context", !6, i64 0, !6, i64 8, !16, i64 16, !16, i64 20}
!23 = !{!22, !6, i64 8}
!24 = !{!25, !6, i64 0}
!25 = !{!"reb_sqlite_stmt", !6, i64 0, !16, i64 8}
!26 = !{!25, !16, i64 8}
!27 = !{!12, !6, i64 0}
!28 = !{!19, !16, i64 8}


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

@RL = external local_unnamed_addr global ptr, align 8
@Handle_SQLiteDB = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [66 x i8], align 1
@Handle_SQLiteSTMT = external local_unnamed_addr global i32, align 4
@.str.1 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [113 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 1, 5) i32 @cmd_sqlite_info(ptr nocapture noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca [8 x i8], align 1
  %4 = load ptr, ptr @RL, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 136
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %7 = tail call ptr %6(i32 noundef 1000, i32 noundef 0) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 2
  %9 = load i8, ptr %8, align 2, !tbaa !11
  %10 = icmp eq i8 %9, 3
  br i1 %10, label %11, label %54

11:                                               ; preds = %2
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load ptr, ptr %12, align 4, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = load i32, ptr %14, align 4, !tbaa !12
  %16 = load i32, ptr @Handle_SQLiteDB, align 4, !tbaa !15
  %17 = icmp eq i32 %15, %16
  br i1 %17, label %18, label %34

18:                                               ; preds = %11
  %19 = load ptr, ptr %13, align 4, !tbaa !11
  %.not.not50 = icmp eq ptr %19, null
  br i1 %.not.not50, label %.thread, label %20

20:                                               ; preds = %18
  %21 = load ptr, ptr %7, align 4, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %7, i64 12
  %23 = load i32, ptr %22, align 4, !tbaa !18
  %24 = zext i32 %23 to i64
  %25 = load ptr, ptr %19, align 8, !tbaa !19
  %26 = getelementptr inbounds i8, ptr %19, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !21
  %.not49 = icmp eq ptr %27, null
  br i1 %.not49, label %31, label %28

28:                                               ; preds = %20
  %29 = getelementptr inbounds i8, ptr %27, i64 12
  %30 = load i32, ptr %29, align 4, !tbaa !18
  br label %31

31:                                               ; preds = %28, %20
  %32 = phi i32 [ %30, %28 ], [ 0, %20 ]
  %33 = tail call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %21, i64 noundef %24, ptr noundef nonnull @.str, ptr noundef nonnull %19, ptr noundef %25, i32 noundef %32) #4
  br label %.thread54

34:                                               ; preds = %11
  %35 = load i32, ptr @Handle_SQLiteSTMT, align 4, !tbaa !15
  %36 = icmp eq i32 %15, %35
  br i1 %36, label %37, label %.thread54.thread

37:                                               ; preds = %34
  %38 = load ptr, ptr %13, align 4, !tbaa !11
  %.not.not = icmp eq ptr %38, null
  br i1 %.not.not, label %.thread, label %39

39:                                               ; preds = %37
  %40 = load ptr, ptr %7, align 4, !tbaa !16
  %41 = getelementptr inbounds i8, ptr %7, i64 12
  %42 = load i32, ptr %41, align 4, !tbaa !18
  %43 = zext i32 %42 to i64
  %44 = load ptr, ptr %38, align 8, !tbaa !22
  %45 = getelementptr inbounds i8, ptr %38, i64 8
  %46 = load i32, ptr %45, align 8, !tbaa !24
  %.not48 = icmp eq ptr %44, null
  br i1 %.not48, label %49, label %47

47:                                               ; preds = %39
  %48 = tail call i32 @sqlite3_bind_parameter_count(ptr noundef nonnull %44) #4
  %.pre = load ptr, ptr %38, align 8, !tbaa !22
  br label %49

49:                                               ; preds = %47, %39
  %50 = phi ptr [ %.pre, %47 ], [ null, %39 ]
  %51 = phi i32 [ %48, %47 ], [ 0, %39 ]
  %52 = tail call i32 @sqlite3_data_count(ptr noundef %50) #4
  %53 = tail call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %40, i64 noundef %43, ptr noundef nonnull @.str.1, ptr noundef nonnull %38, ptr noundef %44, i32 noundef %46, i32 noundef %51, i32 noundef %52) #4
  br label %.thread54

54:                                               ; preds = %2
  %55 = load ptr, ptr @RL, align 8, !tbaa !5
  %56 = load ptr, ptr %55, align 8, !tbaa !25
  call void %56(ptr noundef nonnull %3) #4
  %57 = load ptr, ptr %7, align 4, !tbaa !16
  %58 = getelementptr inbounds i8, ptr %7, i64 12
  %59 = load i32, ptr %58, align 4, !tbaa !18
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %3, i64 1
  %62 = load i8, ptr %61, align 1, !tbaa !11
  %63 = zext i8 %62 to i32
  %64 = getelementptr inbounds i8, ptr %3, i64 2
  %65 = load i8, ptr %64, align 1, !tbaa !11
  %66 = zext i8 %65 to i32
  %67 = getelementptr inbounds i8, ptr %3, i64 3
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = zext i8 %68 to i32
  %70 = call ptr @sqlite3_libversion() #4
  %71 = call i64 @sqlite3_memory_used() #4
  %72 = call i64 @sqlite3_memory_highwater(i32 noundef 0) #4
  %73 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %57, i64 noundef %60, ptr noundef nonnull @.str.2, i32 noundef 3, i32 noundef 10, i32 noundef 2, i32 noundef %63, i32 noundef %66, i32 noundef %69, ptr noundef %70, i64 noundef %71, i64 noundef %72) #4
  br label %.thread54

.thread54:                                        ; preds = %31, %49, %54
  %.443.in = phi i32 [ %73, %54 ], [ %53, %49 ], [ %33, %31 ]
  %74 = icmp slt i32 %.443.in, 0
  br i1 %74, label %.thread, label %.thread54.thread

.thread54.thread:                                 ; preds = %34, %.thread54
  %.44358 = phi i32 [ %.443.in, %.thread54 ], [ 0, %34 ]
  %75 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 %.44358, ptr %75, align 4, !tbaa !26
  %76 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %7, ptr %76, align 4, !tbaa !11
  %77 = getelementptr inbounds i8, ptr %0, i64 1
  store i8 24, ptr %77, align 1, !tbaa !11
  %78 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 0, ptr %78, align 4, !tbaa !11
  br label %.thread

.thread:                                          ; preds = %37, %18, %.thread54, %.thread54.thread
  %.4 = phi i32 [ 4, %.thread54.thread ], [ 1, %.thread54 ], [ 1, %18 ], [ 1, %37 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret i32 %.4
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

declare i32 @sqlite3_bind_parameter_count(ptr noundef) local_unnamed_addr #3

declare i32 @sqlite3_data_count(ptr noundef) local_unnamed_addr #3

declare ptr @sqlite3_libversion() local_unnamed_addr #3

declare i64 @sqlite3_memory_used() local_unnamed_addr #3

declare i64 @sqlite3_memory_highwater(i32 noundef) local_unnamed_addr #3

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

!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 136}
!10 = !{!"rebol_ext_api", !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, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, 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, !6, i64 336}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !14, i64 8}
!13 = !{!"Reb_Handle_Context", !7, i64 0, !14, i64 8, !14, i64 12, !14, i64 14, !6, i64 16}
!14 = !{!"int", !7, i64 0}
!15 = !{!14, !14, i64 0}
!16 = !{!17, !6, i64 0}
!17 = !{!"Reb_Series", !6, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !7, i64 24}
!18 = !{!17, !14, i64 12}
!19 = !{!20, !6, i64 0}
!20 = !{!"reb_sqlite_context", !6, i64 0, !6, i64 8, !14, i64 16, !14, i64 20}
!21 = !{!20, !6, i64 8}
!22 = !{!23, !6, i64 0}
!23 = !{!"reb_sqlite_stmt", !6, i64 0, !14, i64 8}
!24 = !{!23, !14, i64 8}
!25 = !{!10, !6, i64 0}
!26 = !{!17, !14, i64 8}


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