; LLVM IR from chdb-io/chdb :: examples (chdbStub)

; 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.local_result = type { ptr, i64, ptr, double, i64, i64 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [10 x ptr], align 16
  %7 = alloca i32, align 4
  %8 = alloca [50 x i8], align 16
  %9 = alloca [100 x i8], align 16
  %10 = alloca [1000 x i8], align 16
  %11 = alloca [200 x i8], align 16
  %12 = alloca [200 x i8], align 16
  %13 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  store ptr @.str, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store ptr @.str.1, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store ptr @.str.2, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store ptr @.str.2, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  %14 = load i32, ptr %7, align 4, !tbaa !9
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr %7, align 4, !tbaa !9
  %16 = sext i32 %14 to i64
  %17 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %16
  store ptr @.str.3, ptr %17, align 8, !tbaa !5
  %18 = load i32, ptr %7, align 4, !tbaa !9
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %7, align 4, !tbaa !9
  %20 = sext i32 %18 to i64
  %21 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %20
  store ptr @.str.4, ptr %21, align 8, !tbaa !5
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = call i32 @strcmp(ptr noundef %22, ptr noundef @.str.5) #6
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %29, label %25

25:                                               ; preds = %0
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = call i32 @strcmp(ptr noundef %26, ptr noundef @.str.6) #6
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %42

29:                                               ; preds = %25, %0
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %7, align 4, !tbaa !9
  %32 = sext i32 %30 to i64
  %33 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %32
  store ptr @.str.7, ptr %33, align 8, !tbaa !5
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %7, align 4, !tbaa !9
  %36 = sext i32 %34 to i64
  %37 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %36
  store ptr @.str.8, ptr %37, align 8, !tbaa !5
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %7, align 4, !tbaa !9
  %40 = sext i32 %38 to i64
  %41 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %40
  store ptr @.str.9, ptr %41, align 8, !tbaa !5
  br label %52

42:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 50, ptr %8) #5
  %43 = getelementptr inbounds [50 x i8], ptr %8, i64 0, i64 0
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %43, ptr noundef @.str.10, ptr noundef %44) #5
  %46 = getelementptr inbounds [50 x i8], ptr %8, i64 0, i64 0
  %47 = call noalias ptr @strdup(ptr noundef %46) #5
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %7, align 4, !tbaa !9
  %50 = sext i32 %48 to i64
  %51 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %50
  store ptr %47, ptr %51, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 50, ptr %8) #5
  br label %52

52:                                               ; preds = %42, %29
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %69

55:                                               ; preds = %52
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = load i8, ptr %56, align 1, !tbaa !11
  %58 = sext i8 %57 to i32
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %69

60:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 100, ptr %9) #5
  %61 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %61, ptr noundef @.str.11, ptr noundef %62) #5
  %64 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %7, align 4, !tbaa !9
  %67 = sext i32 %65 to i64
  %68 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %67
  store ptr %64, ptr %68, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 100, ptr %9) #5
  br label %69

69:                                               ; preds = %60, %55, %52
  call void @llvm.lifetime.start.p0(i64 1000, ptr %10) #5
  %70 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %70, ptr noundef @.str.12, ptr noundef %71) #5
  %73 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %74 = load i32, ptr %7, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %7, align 4, !tbaa !9
  %76 = sext i32 %74 to i64
  %77 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %76
  store ptr %73, ptr %77, align 8, !tbaa !5
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %106

80:                                               ; preds = %69
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load i8, ptr %81, align 1, !tbaa !11
  %83 = sext i8 %82 to i32
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %106

85:                                               ; preds = %80
  %86 = load i32, ptr %7, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %7, align 4, !tbaa !9
  %88 = sext i32 %86 to i64
  %89 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %88
  store ptr @.str.13, ptr %89, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 200, ptr %11) #5
  %90 = getelementptr inbounds [200 x i8], ptr %11, i64 0, i64 0
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %90, ptr noundef @.str.14, ptr noundef %91) #5
  %93 = getelementptr inbounds [200 x i8], ptr %11, i64 0, i64 0
  %94 = load i32, ptr %7, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %7, align 4, !tbaa !9
  %96 = sext i32 %94 to i64
  %97 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %96
  store ptr %93, ptr %97, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 200, ptr %12) #5
  %98 = getelementptr inbounds [200 x i8], ptr %12, i64 0, i64 0
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %98, ptr noundef @.str.15, ptr noundef %99) #5
  %101 = getelementptr inbounds [200 x i8], ptr %12, i64 0, i64 0
  %102 = load i32, ptr %7, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %7, align 4, !tbaa !9
  %104 = sext i32 %102 to i64
  %105 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %104
  store ptr %101, ptr %105, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 200, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 200, ptr %11) #5
  br label %106

106:                                              ; preds = %85, %80, %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %107 = load i32, ptr %7, align 4, !tbaa !9
  %108 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 0
  %109 = call ptr @query_stable(i32 noundef %107, ptr noundef %108)
  store ptr %109, ptr %13, align 8, !tbaa !5
  %110 = load ptr, ptr %13, align 8, !tbaa !5
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %130

112:                                              ; preds = %106
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.local_result, ptr %113, i32 0, i32 0
  %115 = load ptr, ptr %114, align 8, !tbaa !12
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef %115)
  %117 = load ptr, ptr %13, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.local_result, ptr %117, i32 0, i32 3
  %119 = load double, ptr %118, align 8, !tbaa !16
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, double noundef %119)
  %121 = load ptr, ptr %13, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.local_result, ptr %121, i32 0, i32 4
  %123 = load i64, ptr %122, align 8, !tbaa !17
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, i64 noundef %123)
  %125 = load ptr, ptr %13, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.local_result, ptr %125, i32 0, i32 5
  %127 = load i64, ptr %126, align 8, !tbaa !18
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, i64 noundef %127)
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free_result(ptr noundef %129)
  br label %130

130:                                              ; preds = %112, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 1000, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  ret i32 0
}

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #3

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

declare ptr @query_stable(i32 noundef, ptr noundef) #4

declare i32 @printf(ptr noundef, ...) #4

declare void @free_result(ptr noundef) #4

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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, !6, i64 0}
!13 = !{!"local_result", !6, i64 0, !14, i64 8, !6, i64 16, !15, i64 24, !14, i64 32, !14, i64 40}
!14 = !{!"long", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!13, !15, i64 24}
!17 = !{!13, !14, i64 32}
!18 = !{!13, !14, i64 40}


; 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 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [10 x ptr], align 16
  %2 = alloca [50 x i8], align 16
  %3 = alloca [100 x i8], align 16
  %4 = alloca [1000 x i8], align 16
  %5 = alloca [200 x i8], align 16
  %6 = alloca [200 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #6
  store ptr @.str.3, ptr %1, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr @.str.4, ptr %7, align 8, !tbaa !5
  %8 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull dereferenceable(1) @.str.5) #7
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %13, label %10

10:                                               ; preds = %0
  %11 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull dereferenceable(1) @.str.6) #7
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %17

13:                                               ; preds = %10, %0
  %14 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr @.str.7, ptr %14, align 16, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %1, i64 24
  store ptr @.str.8, ptr %15, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %1, i64 32
  store ptr @.str.9, ptr %16, align 16, !tbaa !5
  br label %21

17:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %2) #6
  %18 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.10, ptr noundef nonnull @.str) #6
  %19 = call noalias ptr @strdup(ptr noundef nonnull %2) #6
  %20 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr %19, ptr %20, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %2) #6
  br label %21

21:                                               ; preds = %13, %17
  %.0 = phi i32 [ 5, %13 ], [ 3, %17 ]
  %22 = load i8, ptr @.str.2, align 1, !tbaa !9
  %.not = icmp eq i8 %22, 0
  %23 = add nuw nsw i32 %.0, 1
  %24 = zext nneg i32 %.0 to i64
  %25 = getelementptr inbounds [10 x ptr], ptr %1, i64 0, i64 %24
  br i1 %.not, label %.thread, label %27

.thread:                                          ; preds = %21
  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %4) #6
  %26 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef nonnull @.str.1) #6
  store ptr %4, ptr %25, align 8, !tbaa !5
  br label %44

27:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %3) #6
  %28 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef nonnull @.str.2) #6
  store ptr %3, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %4) #6
  %29 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef nonnull @.str.1) #6
  %30 = add nuw nsw i32 %.0, 2
  %31 = zext nneg i32 %23 to i64
  %32 = getelementptr inbounds [10 x ptr], ptr %1, i64 0, i64 %31
  store ptr %4, ptr %32, align 16, !tbaa !5
  %33 = add nuw nsw i32 %.0, 3
  %34 = zext nneg i32 %30 to i64
  %35 = getelementptr inbounds [10 x ptr], ptr %1, i64 0, i64 %34
  store ptr @.str.13, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %5) #6
  %36 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.14, ptr noundef nonnull @.str.2) #6
  %37 = add nuw nsw i32 %.0, 4
  %38 = zext nneg i32 %33 to i64
  %39 = getelementptr inbounds [10 x ptr], ptr %1, i64 0, i64 %38
  store ptr %5, ptr %39, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %6) #6
  %40 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.15, ptr noundef nonnull @.str.2) #6
  %41 = add nuw nsw i32 %.0, 5
  %42 = zext nneg i32 %37 to i64
  %43 = getelementptr inbounds [10 x ptr], ptr %1, i64 0, i64 %42
  store ptr %6, ptr %43, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %5) #6
  br label %44

44:                                               ; preds = %.thread, %27
  %.2 = phi i32 [ %41, %27 ], [ %23, %.thread ]
  %45 = call ptr @query_stable(i32 noundef %.2, ptr noundef nonnull %1) #6
  %.not30 = icmp eq ptr %45, null
  br i1 %.not30, label %58, label %46

46:                                               ; preds = %44
  %47 = load ptr, ptr %45, align 8, !tbaa !10
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %47)
  %49 = getelementptr inbounds i8, ptr %45, i64 24
  %50 = load double, ptr %49, align 8, !tbaa !14
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, double noundef %50)
  %52 = getelementptr inbounds i8, ptr %45, i64 32
  %53 = load i64, ptr %52, align 8, !tbaa !15
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, i64 noundef %53)
  %55 = getelementptr inbounds i8, ptr %45, i64 40
  %56 = load i64, ptr %55, align 8, !tbaa !16
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i64 noundef %56)
  call void @free_result(ptr noundef nonnull %45) #6
  br label %58

58:                                               ; preds = %46, %44
  call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #6
  ret i32 0
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #4

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

declare ptr @query_stable(i32 noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare void @free_result(ptr noundef) local_unnamed_addr #5

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 0}
!11 = !{!"local_result", !6, i64 0, !12, i64 8, !6, i64 16, !13, i64 24, !12, i64 32, !12, i64 40}
!12 = !{!"long", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!11, !13, i64 24}
!15 = !{!11, !12, i64 32}
!16 = !{!11, !12, i64 40}


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